fabricatio 0.2.6.dev5__cp39-cp39-win_amd64.whl → 0.2.6.dev7__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,171 +1,658 @@
1
1
  """Extra models for built-in actions."""
2
2
 
3
- from typing import List
3
+ from typing import List, Self
4
4
 
5
5
  from fabricatio.models.generic import Base, Display, FinalizedDumpAble, PrepareVectorization, ProposedAble
6
6
  from pydantic import Field
7
7
 
8
8
 
9
+ # <editor-fold desc="ArticleEssence">
9
10
  class Equation(Base):
10
- """Structured representation of mathematical equations (including their physical or conceptual meanings)."""
11
+ """Mathematical formalism specification for research contributions.
12
+
13
+ Encodes equations with dual representation: semantic meaning and typeset-ready notation.
14
+ """
11
15
 
12
16
  description: str
13
- """A concise explanation of the equation's meaning, purpose, and relevance in the context of the research."""
17
+ """Equation significance structured in three elements:
18
+ 1. Physical/conceptual meaning
19
+ 2. Role in technical workflow
20
+ 3. Relationship to paper's core contribution
21
+ Example: 'Defines constrained search space dimensionality reduction. Used in architecture optimization phase (Section 3.2). Enables 40% parameter reduction.'"""
14
22
 
15
23
  latex_code: str
16
- """The LaTeX code used to represent the equation in a publication-ready format."""
24
+ """LaTeX representation following academic typesetting standards:
25
+ - Must use equation environment
26
+ - Multiline equations aligned at '='
27
+ - Unit annotations where applicable
28
+ Example: r'\begin{equation} \\mathcal{L}_{NAS} = \alpha \\|\theta\\|_2 + \beta H(p) \\end{equation}'"""
17
29
 
18
30
 
19
31
  class Figure(Base):
20
- """Structured representation of figures (including their academic significance and explanatory captions)."""
32
+ """Visual component specification for technical communication.
33
+
34
+ Combines graphical assets with structured academic captioning.
35
+ """
21
36
 
22
37
  description: str
23
- """A detailed explanation of the figure's content and its role in conveying key insights."""
38
+ """Figure interpretation guide containing:
39
+ 1. Key visual elements mapping
40
+ 2. Data representation methodology
41
+ 3. Connection to research findings
42
+ Example: 'Architecture search space topology (left) vs. convergence curves (right). Demonstrates NAS efficiency gains through constrained search.'"""
24
43
 
25
44
  figure_caption: str
26
- """The caption accompanying the figure, summarizing its main points and academic value."""
45
+ """Complete caption following Nature-style guidelines:
46
+ 1. Brief overview statement (首句总结)
47
+ 2. Technical detail layer
48
+ 3. Result implication
49
+ Example: 'Figure 3: Differentiable NAS framework. (a) Search space topology with constrained dimensions. (b) Training convergence across language pairs. Dashed lines indicate baseline methods.'"""
27
50
 
28
51
  figure_path: str
29
- """The exact path to the figure file, must exist in the file system, SHALL never be a PLACEHOLDER."""
52
+ """Filesystem path to high-resolution vector graphic (PDF/EPS/SVG).
53
+ Strict validation requirements:
54
+ - Absolute path under /assets/figures/
55
+ - Naming convention: fig[chapter]-[section]_[description].pdf
56
+ Example: '/assets/figures/fig3-2_nas_convergence.pdf'"""
30
57
 
31
58
 
32
59
  class Highlightings(Base):
33
- """Structured representation of highlighted elements in an academic paper (including equations, algorithms, figures, and tables)."""
60
+ """Technical showcase aggregator for research artifacts.
61
+
62
+ Curates core scientific components with machine-parseable annotations.
63
+ """
34
64
 
35
- # Academic Achievements Showcase
36
65
  highlighted_equations: List[Equation] = Field(default_factory=list)
37
- """Core mathematical equations that represent breakthroughs in the field, accompanied by explanations of their physical or conceptual significance,Should always be in LaTeX format wrapped in $ or $$ signs."""
66
+ """3-5 pivotal equations representing theoretical contributions.
67
+ Each must:
68
+ - Use $$ wrapping for display math
69
+ - Contain at least one novel operator/symbol
70
+ - Reference in Methods/Results sections
71
+ Example: Equation describing proposed loss function"""
38
72
 
39
73
  highlighted_algorithms: List[str] = Field(default_factory=list)
40
- """Pseudocode for key algorithms, annotated to highlight innovative components."""
74
+ """Algorithm pseudocode following ACM style:
75
+ 1. Numbered steps with bold keywords
76
+ 2. Complexity analysis subsection
77
+ 3. Novel components marked with ※
78
+ Example:
79
+ 'Algorithm 1: Constrained NAS
80
+ 1. Initialize search space with §3.1 constraints ※
81
+ 2. While not converged:
82
+ a. Compute gradient ▽θ
83
+ b. Update architecture parameters...'"""
41
84
 
42
85
  highlighted_figures: List[Figure] = Field(default_factory=list)
43
- """Critical diagrams or illustrations, each accompanied by a caption explaining their academic importance."""
86
+ """4-6 key figures demonstrating:
87
+ 1. Framework overview (1 required)
88
+ 2. Quantitative results (2-3 required)
89
+ 3. Ablation studies (1 optional)
90
+ Each must appear in Results/Discussion chapters."""
44
91
 
45
92
  highlighted_tables: List[str] = Field(default_factory=list)
46
- """Important data tables, annotated to indicate statistical significance or other notable findings."""
93
+ """Critical data presentations using booktabs format:
94
+ - Minimum 3 comparison baselines
95
+ - Statistical significance markers (*/†/‡)
96
+ - Standard deviation in parentheses
97
+ Example:
98
+ \begin{tabular}{lcc}
99
+ \toprule
100
+ Method & BLEU & Δ Params \\
101
+ \\midrule
102
+ Ours & 32.4 & -41\\%† \\
103
+ \bottomrule
104
+ \\end{tabular}"""
47
105
 
48
106
 
49
107
  class ArticleEssence(ProposedAble, Display, PrepareVectorization):
50
- """Structured representation of the core elements of an academic paper(providing a comprehensive digital profile of the paper's essential information)."""
108
+ """Semantic fingerprint of academic paper for structured analysis.
109
+
110
+ Encodes research artifacts with dual human-machine interpretability.
111
+ """
51
112
 
52
- # Basic Metadata
53
113
  title: str = Field(...)
54
- """The full title of the paper, including any subtitles if applicable."""
114
+ """Complete title with technical specificity (12-18 words).
115
+ Must contain:
116
+ 1. Methodology focus
117
+ 2. Application domain
118
+ 3. Performance metric
119
+ Example: 'EfficientViT: Multi-Scale Linear Attention for High-Resolution Dense Prediction'"""
55
120
 
56
121
  authors: List[str]
57
- """A list of the paper's authors, typically in the order of contribution."""
122
+ """Author list with institutional annotations.
123
+ Format: [First Last¹, First Last²]
124
+ Superscripts mapping to affiliations.
125
+ Example: ['Yuanhao Zhou¹', 'Lei Chen²']"""
58
126
 
59
127
  keywords: List[str]
60
- """A list of keywords that summarize the paper's focus and facilitate indexing."""
128
+ """5-8 ACM CCS concepts in camel case.
129
+ Example: ['Computing methodologies~Neural networks', 'Hardware~Emerging technologies']"""
61
130
 
62
131
  publication_year: int
63
- """The year in which the paper was published."""
132
+ """Publication timestamp in ISO 8601 (YYYY format).
133
+ Constraint: 2017 ≤ year ≤ current_year"""
64
134
 
65
- # Core Content Elements
66
135
  highlightings: Highlightings = Field(default_factory=Highlightings)
67
- """A collection of highlighted elements in the paper, including equations, algorithms, figures, and tables."""
136
+ """Technical highlight reel containing:
137
+ - Core equations (Theory)
138
+ - Key algorithms (Implementation)
139
+ - Critical figures (Results)
140
+ - Benchmark tables (Evaluation)"""
68
141
 
69
142
  domain: List[str]
70
- """The research domains or fields addressed by the paper (e.g., ['Natural Language Processing', 'Computer Vision'])."""
143
+ """Primary research domains from ACM CCS 2023 taxonomy.
144
+ Exactly 2-3 categories required.
145
+ Example: ['Computing methodologies → Machine learning']"""
71
146
 
72
147
  abstract: str = Field(...)
73
- """A structured abstract that outlines the research problem, methodology, and conclusions in three distinct sections."""
148
+ """Three-paragraph structured abstract:
149
+ Paragraph 1: Problem & Motivation (2-3 sentences)
150
+ Paragraph 2: Methodology & Innovations (3-4 sentences)
151
+ Paragraph 3: Results & Impact (2-3 sentences)
152
+ Total length: 150-250 words"""
74
153
 
75
154
  core_contributions: List[str]
76
- """Key academic contributions that distinguish the paper from prior work in the field."""
155
+ """3-5 technical contributions using CRediT taxonomy verbs.
156
+ Each item starts with action verb.
157
+ Example:
158
+ - 'Developed constrained NAS framework'
159
+ - 'Established cross-lingual transfer metrics'"""
77
160
 
78
161
  technical_novelty: List[str]
79
- """Specific technical innovations introduced by the research, listed as individual points."""
162
+ """Patent-style claims with technical specificity.
163
+ Format: 'A [system/method] comprising [novel components]...'
164
+ Example:
165
+ 'A neural architecture search system comprising:
166
+ a differentiable constrained search space;
167
+ multi-lingual transferability predictors...'"""
80
168
 
81
- # Academic Discussion Dimensions
82
169
  research_problems: List[str]
83
- """A clearly defined research question or problem addressed by the study."""
170
+ """Problem statements as how/why questions.
171
+ Example:
172
+ - 'How to reduce NAS computational overhead while maintaining search diversity?'
173
+ - 'Why do existing architectures fail in low-resource cross-lingual transfer?'"""
84
174
 
85
175
  limitations: List[str]
86
- """An analysis of the methodological or experimental limitations of the research."""
176
+ """Technical limitations analysis containing:
177
+ 1. Constraint source (data/method/theory)
178
+ 2. Impact quantification
179
+ 3. Mitigation pathway
180
+ Example:
181
+ 'Methodology constraint: Single-objective optimization (affects 5% edge cases),
182
+ mitigated through future multi-task extension'"""
87
183
 
88
184
  future_work: List[str]
89
- """Suggestions for potential directions or topics for follow-up studies."""
185
+ """Research roadmap items with 3 horizons:
186
+ 1. Immediate extensions (1 year)
187
+ 2. Mid-term directions (2-3 years)
188
+ 3. Long-term vision (5+ years)
189
+ Example:
190
+ 'Short-term: Adapt framework for vision transformers (ongoing with CVPR submission)'"""
90
191
 
91
192
  impact_analysis: List[str]
92
- """An assessment of the paper's potential influence on the development of the field."""
193
+ """Bibliometric impact projections:
194
+ - Expected citation counts (next 3 years)
195
+ - Target application domains
196
+ - Standard adoption potential
197
+ Example:
198
+ 'Predicted 150+ citations via integration into MMEngine (Alibaba OpenMMLab)'"""
93
199
 
94
200
  def _prepare_vectorization_inner(self) -> str:
95
201
  return self.model_dump_json()
96
202
 
97
203
 
204
+ # </editor-fold>
205
+
206
+
98
207
  class ArticleProposal(ProposedAble, Display):
99
- """Structured representation of the proposal for an academic paper."""
208
+ """Structured proposal for academic paper development with core research elements.
209
+
210
+ Guides LLM in generating comprehensive research proposals with clearly defined components.
211
+ """
100
212
 
101
213
  title: str = Field(...)
102
- """The proposed title of the paper."""
214
+ """Paper title in academic style (Title Case, 8-15 words). Example: 'Exploring Neural Architecture Search for Low-Resource Machine Translation'"""
103
215
 
104
216
  focused_problem: List[str] = Field(default_factory=list)
105
- """The specific research problem or question that the paper aims to address."""
217
+ """Specific research problem(s) or question(s) addressed (list of 1-3 concise statements).
218
+ Example: ['NAS computational overhead in low-resource settings', 'Architecture transferability across language pairs']"""
219
+
106
220
  research_aim: List[str] = Field(default_factory=list)
107
- """The main objective or goal of the research, outlining what the study aims to achieve."""
221
+ """Primary research objectives (list of 2-4 measurable goals).
222
+ Example: ['Develop parameter-efficient NAS framework', 'Establish cross-lingual architecture transfer metrics']"""
223
+
108
224
  research_methods: List[str] = Field(default_factory=list)
109
- """The methods used in the research, including the approach, techniques, and tools employed."""
225
+ """Methodological components (list of techniques/tools).
226
+ Example: ['Differentiable architecture search', 'Transformer-based search space', 'Multi-lingual perplexity evaluation']"""
110
227
 
228
+ technical_approaches: List[str] = Field(default_factory=list)
111
229
 
230
+
231
+ # <editor-fold desc="ArticleOutline">
112
232
  class ArticleSubsectionOutline(Base):
113
- """Structured representation of the subsections of an academic paper."""
233
+ """Atomic research component specification for academic paper generation."""
114
234
 
115
235
  title: str = Field(...)
116
- """The title of the subsection."""
236
+ """Technical focus descriptor following ACL title conventions:
237
+ - Title Case with 4-8 word limit
238
+ - Contains method and domain components
239
+ Example: 'Differentiable Search Space Optimization'"""
117
240
 
118
241
  description: str = Field(...)
119
- """A brief description of the subsection's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
242
+ """Tripartite content specification with strict structure:
243
+ 1. Technical Core: Method/algorithm/formalism (1 sentence)
244
+ 2. Structural Role: Placement rationale in section (1 clause)
245
+ 3. Research Value: Contribution to paper's thesis (1 clause)
246
+
247
+ Example: 'Introduces entropy-constrained architecture parameters enabling
248
+ gradient-based NAS. Serves as foundation for Section 3.2. Critical for
249
+ maintaining search space diversity while ensuring convergence.'"""
120
250
 
121
251
 
122
252
  class ArticleSectionOutline(Base):
123
- """Structured representation of the sections of an academic paper."""
253
+ """Methodological unit organizing related technical components."""
124
254
 
125
255
  title: str = Field(...)
126
- """The title of the section."""
256
+ """Process-oriented header with phase identification:
257
+ - Title Case with 5-10 word limit
258
+ - Indicates research stage/methodological focus
259
+ Example: 'Cross-Lingual Evaluation Protocol'"""
260
+
127
261
  description: str = Field(...)
128
- """A brief description of the section's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
129
- subsections: List[ArticleSubsectionOutline]
130
- """The subsections of the section, outlining their content and significance."""
262
+ """Functional specification with four required elements:
263
+ 1. Research Stage: Paper progression position
264
+ 2. Technical Innovations: Novel components
265
+ 3. Scholarly Context: Relationship to prior work
266
+ 4. Forward Flow: Connection to subsequent sections
267
+
268
+ Example: 'Implements constrained NAS framework building on Section 2's
269
+ theoretical foundations. Introduces dynamic resource allocation mechanism.
270
+ Directly supports Results section through ablation study parameters.'"""
271
+
272
+ subsections: List[ArticleSubsectionOutline] = Field(..., min_length=3, max_length=5)
273
+ """IMRaD-compliant substructure with technical progression:
274
+ 1. Conceptual Framework
275
+ 2. Methodological Details
276
+ 3. Implementation Strategy
277
+ 4. Validation Approach
278
+ 5. Transition Logic
279
+
280
+ Example Flow:
281
+ [
282
+ 'Search Space Constraints',
283
+ 'Gradient Optimization Protocol',
284
+ 'Multi-GPU Implementation',
285
+ 'Convergence Validation',
286
+ 'Cross-Lingual Extension'
287
+ ]"""
131
288
 
132
289
 
133
290
  class ArticleChapterOutline(Base):
134
- """Structured representation of the chapters of an academic paper."""
291
+ """Macro-structural unit implementing standard academic paper organization."""
135
292
 
136
293
  title: str = Field(...)
137
- """The title of the chapter."""
294
+ """IMRaD-compliant chapter title with domain specification:
295
+ - Title Case with 2-4 word limit
296
+ - Matches standard paper sections
297
+ Example: 'Multilingual Evaluation Results'"""
298
+
138
299
  description: str = Field(...)
139
- """A brief description of the chapter's content should be, how it fits into the overall structure of the paper, and its significance in the context of the research."""
140
- sections: List[ArticleSectionOutline]
141
- """The sections of the chapter, outlining their content and significance."""
300
+ """Strategic chapter definition containing:
301
+ 1. Research Phase: Introduction/Methods/Results/etc.
302
+ 2. Chapter Objectives: 3-5 specific goals
303
+ 3. Thesis Alignment: Supported claims/contributions
304
+ 4. Structural Flow: Adjacent chapter relationships
305
+
306
+ Example: 'Presents cross-lingual NAS results across 10 language pairs.
307
+ Validates efficiency claims from Introduction. Provides empirical basis
308
+ for Discussion chapter. Contrasts with single-language baselines.'"""
309
+
310
+ sections: List[ArticleSectionOutline] = Field(..., min_length=3, max_length=5)
311
+ """Standard academic progression implementing chapter goals:
312
+ 1. Context Establishment
313
+ 2. Technical Presentation
314
+ 3. Empirical Validation
315
+ 4. Comparative Analysis
316
+ 5. Synthesis
317
+
318
+ Example Structure:
319
+ [
320
+ 'Experimental Setup',
321
+ 'Monolingual Baselines',
322
+ 'Cross-Lingual Transfer',
323
+ 'Low-Resource Scaling',
324
+ 'Error Analysis'
325
+ ]"""
142
326
 
143
327
 
144
328
  class ArticleOutline(ProposedAble, Display, FinalizedDumpAble):
145
- """Structured representation of the outline for an academic paper."""
329
+ """Complete academic paper blueprint with hierarchical validation."""
146
330
 
147
331
  title: str = Field(...)
148
- """The proposed title of the paper."""
332
+ """Full technical title following ACL 2024 guidelines:
333
+ - Title Case with 12-18 word limit
334
+ - Structure: [Method] for [Task] via [Approach] in [Domain]
335
+ Example: 'Efficient Differentiable NAS for Low-Resource MT Through
336
+ Parameter-Sharing: A Cross-Lingual Study'"""
149
337
 
150
338
  prospect: str = Field(...)
151
- """A brief description of the research problem or question that the paper aims to address manipulating methods or techniques"""
152
-
153
- chapters: List[ArticleChapterOutline]
154
- """The chapters of the paper, outlining their content and significance."""
339
+ """Consolidated research statement with four pillars:
340
+ 1. Problem Identification: Current limitations
341
+ 2. Methodological Response: Technical approach
342
+ 3. Empirical Validation: Evaluation strategy
343
+ 4. Scholarly Impact: Field contributions
344
+
345
+ Example: 'Addressing NAS computational barriers through constrained
346
+ differentiable search spaces, validated via cross-lingual MT experiments
347
+ across 50+ languages, enabling efficient architecture discovery with
348
+ 60% reduced search costs.'"""
349
+
350
+ chapters: List[ArticleChapterOutline] = Field(..., min_length=5, max_length=8)
351
+ """IMRaD structure with enhanced academic validation:
352
+ 1. Introduction: Problem Space & Contributions
353
+ 2. Background: Theoretical Foundations
354
+ 3. Methods: Technical Innovations
355
+ 4. Experiments: Protocol Design
356
+ 5. Results: Empirical Findings
357
+ 6. Discussion: Interpretation & Limitations
358
+ 7. Conclusion: Synthesis & Future Work
359
+ 8. Appendices: Supplementary Materials"""
155
360
 
156
361
  def finalized_dump(self) -> str:
157
- """Finalized dump of the article outline.
362
+ """Generates standardized hierarchical markup for academic publishing systems.
363
+
364
+ Implements ACL 2024 outline conventions with four-level structure:
365
+ = Chapter Title (Level 1)
366
+ == Section Title (Level 2)
367
+ === Subsection Title (Level 3)
368
+ ==== Subsubsection Title (Level 4)
158
369
 
159
370
  Returns:
160
- str: The finalized dump of the article outline.
371
+ str: Strictly formatted outline with academic sectioning
372
+
373
+ Example:
374
+ = Methodology
375
+ == Neural Architecture Search Framework
376
+ === Differentiable Search Space
377
+ ==== Constrained Optimization Parameters
378
+ === Implementation Details
379
+ == Evaluation Protocol
161
380
  """
162
381
  lines: List[str] = []
382
+ for i, chapter in enumerate(self.chapters, 1):
383
+ lines.append(f"= Chapter {i}: {chapter.title}")
384
+ for j, section in enumerate(chapter.sections, 1):
385
+ lines.append(f"== {i}.{j} {section.title}")
386
+ for k, subsection in enumerate(section.subsections, 1):
387
+ lines.append(f"=== {i}.{j}.{k} {subsection.title}")
388
+ return "\n".join(lines)
389
+
390
+
391
+ # </editor-fold>
392
+
393
+
394
+ # <editor-fold desc="Article">
395
+ class Paragraph(ProposedAble):
396
+ """Structured academic paragraph blueprint for controlled content generation."""
397
+
398
+ description: str
399
+ """Functional summary of the paragraph's role in document structure.
400
+ Example: 'Establishes NAS efficiency improvements through differentiable methods'"""
401
+
402
+ writing_aim: List[str]
403
+ """Specific communicative objectives for this paragraph's content.
404
+ Example: ['Introduce gradient-based NAS', 'Compare computational costs',
405
+ 'Link efficiency to practical applications']"""
406
+
407
+ lines: List[str]
408
+ """Hierarchically structured content with enforced rhetorical elements:
409
+ 1. Topic Sentence: Principal claim/position (1 sentence)
410
+ 2. Development: Evidence chain with citations (2-4 sentences)
411
+ 3. Synthesis: Interpretation & significance (1 sentence)
412
+ 4. Transition: Logical bridge to next paragraph (optional)
413
+
414
+ Example: [
415
+ 'Differentiable NAS revolutionized architecture search efficiency.',
416
+ 'DARTS reduced search costs from 2000+ to 4 GPU days (Liu et al., 2019) while maintaining competitive ImageNet accuracy.',
417
+ 'This order-of-magnitude improvement enables NAS deployment in resource-constrained research contexts.',
418
+ 'These efficiency gains directly impact our framework's design choices as detailed in Section 3.'
419
+ ]"""
420
+
421
+
422
+ class SectionRef(ProposedAble):
423
+ """Cross-component reference system for maintaining document consistency."""
424
+
425
+ ref_chapter_title: str
426
+ """Title of referenced chapter (e.g., 'Methodology')"""
427
+
428
+ ref_section_title: str
429
+ """Exact section header text (e.g., '3.2 Gradient Optimization')"""
163
430
 
164
- for chapter in self.chapters:
165
- lines.append(f"= {chapter.title}")
166
- for section in chapter.sections:
167
- lines.append(f"== {section.title}")
168
- for subsection in section.subsections:
169
- lines.append(f"=== {subsection.title}")
431
+ ref_subsection_title: str
432
+ """Specific subsection identifier (e.g., '3.2.1 Learning Rate Scheduling')"""
170
433
 
171
- return "\n\n".join(lines)
434
+
435
+ class ArticleBase(ProposedAble, Display):
436
+ """Foundation for hierarchical document components with dependency tracking."""
437
+
438
+ description: str
439
+ """Functional purpose statement for this component's role in the paper.
440
+ Example: 'Defines evaluation metrics for cross-lingual transfer experiments'"""
441
+
442
+ writing_aim: List[str]
443
+ """Author intentions mapped to rhetorical moves:
444
+ Example: ['Establish metric validity', 'Compare with baseline approaches',
445
+ 'Justify threshold selection']"""
446
+
447
+ title: str = Field(...)
448
+ """Standardized academic header following ACL style guidelines:
449
+ - Title Case with maximal 12-word length
450
+ - No abbreviations without prior definition
451
+ Example: 'Multilingual Benchmark Construction'"""
452
+
453
+ support_to: List[SectionRef]
454
+ """Upstream dependencies requiring this component's validation.
455
+ Format: List of hierarchical references to supported claims/sections
456
+ Example: [SectionRef(chapter='Results', section='4.1', subsection='4.1.2')]"""
457
+
458
+ depend_on: List[SectionRef]
459
+ """Downstream prerequisites for content validity.
460
+ Format: List of references to foundational components
461
+ Example: [SectionRef(chapter='Methods', section='2.3', subsection='2.3.4')]"""
462
+
463
+
464
+ class ArticleSubsection(ArticleBase):
465
+ """Atomic argumentative unit with technical specificity."""
466
+
467
+ title: str = Field(...)
468
+ """Technical descriptor with maximal information density:
469
+ Format: [Method]-[Domain]-[Innovation]
470
+ Example: 'Transformer-Based Architecture Search Space'"""
471
+
472
+ support_to: List[SectionRef]
473
+ """Immediate parent components and supported hypotheses.
474
+ Example: [SectionRef(chapter='Methods', section='3', subsection='3.1')]"""
475
+
476
+ depend_on: List[SectionRef]
477
+ """Technical dependencies including equations, algorithms, and datasets.
478
+ Example: [SectionRef(chapter='Background', section='2.2', subsection='2.2.3')]"""
479
+
480
+ paragraphs: List[Paragraph] = Field(..., min_length=3, max_length=5)
481
+ """Technical exposition following ACM writing guidelines:
482
+ 1. Contextualization: Position in research design
483
+ 2. Technical Detail: Equations/algorithms/code
484
+ 3. Validation: Citations/experimental confirmation
485
+ 4. Interpretation: Scholarly significance
486
+ 5. Transition: Logical connection to subsequent content
487
+
488
+ Example Paragraph Chain:
489
+ [
490
+ 'Our search space builds on standard CNN architectures...',
491
+ 'Formally, we define architecture parameters $\\alpha \\in R^d$ where...',
492
+ 'This parameterization reduces search complexity by 42% compared to...',
493
+ 'The efficiency gains validate our approach to...'
494
+ ]"""
495
+
496
+
497
+ class ArticleSection(ArticleBase):
498
+ """Methodological complete unit presenting cohesive research phase."""
499
+
500
+ title: str = Field(...)
501
+ """Process-oriented header indicating methodological scope.
502
+ Example: 'Cross-Lingual Transfer Evaluation Protocol'"""
503
+
504
+ support_to: List[SectionRef]
505
+ """Supported research questions and paper-level claims.
506
+ Example: [SectionRef(chapter='Introduction', section='1', subsection='1.2')]"""
507
+
508
+ depend_on: List[SectionRef]
509
+ """Required methodological components and theoretical frameworks.
510
+ Example: [SectionRef(chapter='Background', section='2', subsection='2.4')]"""
511
+
512
+ subsections: List[ArticleSubsection] = Field(..., min_length=3, max_length=5)
513
+ """Thematic progression implementing section's research function:
514
+ 1. Conceptual Framework
515
+ 2. Technical Implementation
516
+ 3. Experimental Validation
517
+ 4. Comparative Analysis
518
+ 5. Synthesis
519
+
520
+ Example Subsection Flow:
521
+ [
522
+ 'Evaluation Metrics',
523
+ 'Dataset Preparation',
524
+ 'Baseline Comparisons',
525
+ 'Ablation Studies',
526
+ 'Interpretation Framework'
527
+ ]"""
528
+
529
+
530
+ class ArticleChapter(ArticleBase):
531
+ """Macro-structural unit implementing IMRaD document architecture."""
532
+
533
+ title: str = Field(...)
534
+ """Standard IMRaD chapter title with domain specification.
535
+ Example: 'Neural Architecture Search for Low-Resource Languages'"""
536
+
537
+ support_to: List[SectionRef]
538
+ """Supported thesis statements and paper-level contributions.
539
+ Example: [SectionRef(chapter='Abstract', section='', subsection='')]"""
540
+
541
+ depend_on: List[SectionRef]
542
+ """Foundational chapters and external knowledge prerequisites.
543
+ Example: [SectionRef(chapter='Related Work', section='2', subsection='2.3')]"""
544
+
545
+ sections: List[ArticleSection] = Field(..., min_length=3, max_length=5)
546
+ """Complete research narrative implementing chapter objectives:
547
+ 1. Context Establishment
548
+ 2. Methodology Exposition
549
+ 3. Results Presentation
550
+ 4. Critical Analysis
551
+ 5. Synthesis
552
+
553
+ Example Section Hierarchy:
554
+ [
555
+ 'Theoretical Framework',
556
+ 'Experimental Design',
557
+ 'Results Analysis',
558
+ 'Threats to Validity',
559
+ 'Comparative Discussion'
560
+ ]"""
561
+
562
+
563
+ class Article(ProposedAble, Display):
564
+ """Complete academic paper specification with validation constraints."""
565
+
566
+ title: str = Field(...)
567
+ """Full technical descriptor following ACL 2024 guidelines:
568
+ Structure: [Method] for [Task] in [Domain]: [Subtitle with Technical Focus]
569
+ Example: 'Efficient Differentiable NAS for Low-Resource MT:
570
+ A Parameter-Sharing Approach to Cross-Lingual Transfer'"""
571
+
572
+ abstract: str = Field(...)
573
+ """Structured summary with controlled natural language:
574
+ 1. Context: 2 clauses (problem + gap)
575
+ 2. Methods: 3 clauses (approach + innovation + implementation)
576
+ 3. Results: 3 clauses (metrics + comparisons + significance)
577
+ 4. Impact: 2 clauses (theoretical + practical)
578
+
579
+ Example: 'Neural architecture search (NAS) faces prohibitive... [150 words]'"""
580
+
581
+ chapters: List[ArticleChapter] = Field(..., min_length=5, max_length=8)
582
+ """IMRaD-compliant document structure with enhanced validation:
583
+ 1. Introduction: Motivation & Contributions
584
+ 2. Background: Literature & Theory
585
+ 3. Methods: Technical Implementation
586
+ 4. Experiments: Protocols & Setup
587
+ 5. Results: Empirical Findings
588
+ 6. Discussion: Interpretation & Limitations
589
+ 7. Conclusion: Summary & Future Work
590
+
591
+ Additional: Appendices, Ethics Review, Reproducibility Statements"""
592
+
593
+ def init_from_outline(self, outline: ArticleOutline) -> Self:
594
+ """Initialize the article from a given outline.
595
+
596
+ Args:
597
+ outline (ArticleOutline): The outline to initialize from.
598
+
599
+ Returns:
600
+ Self: The current instance of the article.
601
+ """
602
+ # Set the title from the outline
603
+ self.title = outline.title
604
+
605
+ # Initialize chapters based on outline's chapters
606
+ self.chapters = []
607
+
608
+ for chapter_outline in outline.chapters:
609
+ # Create a new chapter
610
+ chapter = ArticleChapter(
611
+ title=chapter_outline.title,
612
+ description=chapter_outline.description,
613
+ writing_aim=["Implement " + chapter_outline.description],
614
+ support_to=[],
615
+ depend_on=[],
616
+ sections=[],
617
+ )
618
+
619
+ # Create sections for each chapter
620
+ for section_outline in chapter_outline.sections:
621
+ section = ArticleSection(
622
+ title=section_outline.title,
623
+ description=section_outline.description,
624
+ writing_aim=["Address " + section_outline.description],
625
+ support_to=[],
626
+ depend_on=[],
627
+ subsections=[],
628
+ )
629
+
630
+ # Create subsections for each section
631
+ for subsection_outline in section_outline.subsections:
632
+ subsection = ArticleSubsection(
633
+ title=subsection_outline.title,
634
+ description=subsection_outline.description,
635
+ writing_aim=["Explain " + subsection_outline.description],
636
+ support_to=[],
637
+ depend_on=[],
638
+ paragraphs=[
639
+ Paragraph(
640
+ description=f"Implementation of {subsection_outline.title}",
641
+ writing_aim=["Present key concepts", "Support main arguments"],
642
+ lines=[],
643
+ )
644
+ ],
645
+ )
646
+ section.subsections.append(subsection)
647
+
648
+ chapter.sections.append(section)
649
+
650
+ self.chapters.append(chapter)
651
+
652
+ # Generate a placeholder abstract from the outline's prospect
653
+ self.abstract = f"Abstract: {outline.prospect}"
654
+
655
+ return self
656
+
657
+
658
+ # </editor-fold>