File size: 52,510 Bytes
9fe907e
 
 
 
594a54d
9fe907e
 
 
 
 
 
 
 
 
7c94a76
9fe907e
 
47a67cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
 
c0c1fce
9fe907e
c0c1fce
9fe907e
 
 
 
 
 
 
c0c1fce
9fe907e
c0c1fce
 
 
 
 
 
 
9fe907e
 
 
 
c0c1fce
9fe907e
 
c0c1fce
 
 
9fe907e
 
4be6005
bd44f6b
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7285193
 
 
 
 
 
 
 
 
9fe907e
 
 
 
 
 
7285193
 
9fe907e
 
 
 
 
 
7285193
 
 
9fe907e
 
7285193
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
394e759
 
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
394e759
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
394e759
 
 
 
 
 
 
9fe907e
 
 
394e759
 
 
 
 
 
 
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e6db92
83fea6c
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
83fea6c
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
83fea6c
 
 
 
 
 
 
9fe907e
 
 
83fea6c
 
 
 
 
 
 
9fe907e
 
2e6db92
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
cda1eff
 
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
cda1eff
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
cda1eff
 
 
 
 
 
 
 
9fe907e
 
 
cda1eff
 
 
 
 
 
 
 
 
 
9fe907e
 
cda1eff
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
22ac137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
22ac137
 
 
 
 
 
 
 
 
 
 
 
 
9fe907e
 
 
22ac137
 
 
 
 
 
 
9fe907e
 
 
22ac137
 
 
 
 
 
 
 
 
 
9fe907e
 
4414593
9fe907e
594a54d
 
 
 
 
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93e8bdb
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594a54d
 
 
 
 
 
 
9fe907e
594a54d
 
 
 
 
 
 
9fe907e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594a54d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
// ============================================
// NLP Evolution Timeline - Enhanced Educational Content
// Benchmark-driven historical narrative with pedagogical depth
// ============================================

const eras = {
    era1: {
        title: "1950s–1970s: Symbolic & Rule-Based Era",
        tagline: "Language as Formal Logic",
        period: "1950–1979",
        evaluationPhilosophy: "Human judgment via Turing Test; demonstration-based evaluation",
        hardwareContext: "Mainframes (IBM 701, PDP-1), LISP (1958), Prolog (1972)",
        coreParadigm: "Symbolic AI: Language treated as structured symbolic logic with explicit knowledge representation",
        keyShift: "Formal grammars and logical reasoning as the foundation of language understanding",
        representativeTask: "Machine Translation, Question Answering",
        
        milestones: [
            { year: "1950", event: "Turing Test Proposed", significance: "Established imitation game as behavioral criterion for machine intelligence; foundational for NLP evaluation" },
            { year: "1952", event: "First MT Conference (MIT)", significance: "First major international MT gathering; catalyzed government funding for computational linguistics" },
            { year: "1954", event: "Georgetown–IBM Experiment", significance: "First public MT demo (Russian→English); 60 sentences, 250 words; created false optimism that MT would be solved in 3–5 years" },
            { year: "1956", event: "Chomsky Hierarchy Introduced", significance: "Formal classification of grammars (Type-0 to Type-3); mathematical foundation for natural language formalisms" },
            { year: "1957", event: "Syntactic Structures Published", significance: "Launched transformational-generative grammar; phrase-structure rules and transformations for syntax" },
            { year: "1958", event: "Finite-State Languages (Chomsky & Miller)", significance: "Proved finite-state Markov processes inadequate for syntax; CFGs strictly more powerful" },
            { year: "1959", event: "Formal Properties of Grammars", significance: "Established decidability results for Chomsky hierarchy; CFG membership decidable, context-sensitive not in general" },
            { year: "1960", event: "Bar-Hillel's MT Survey", significance: "Concluded fully automatic high-quality MT unrealistic short-term; advocated human-aided MT" },
            { year: "1964", event: "STUDENT System (Bobrow)", significance: "First NLP system solving algebra word problems; mapped restricted English to equations" },
            { year: "1964", event: "SIR System (Raphael)", significance: "Semantic Information Retrieval using deductive inference; pioneered semantic networks for NLU" },
            { year: "1965", event: "Simmons' QA Survey", significance: "First comprehensive survey of English QA systems; established evaluation criteria for NL interfaces" },
            { year: "1966", event: "ELIZA Program (Weizenbaum)", significance: "Pattern-matching chatbot simulating Rogerian psychotherapist; demonstrated surface-level interaction without understanding" },
            { year: "1966", event: "ALPAC Report Published", significance: "First major funding crisis; concluded MT slower, less accurate, and twice as expensive as human translation; triggered first NLP 'AI winter'" },
            { year: "1967", event: "Woods' Procedural Semantics", significance: "Semantic interpretation as computational procedure; laid groundwork for parsing-semantic integration" },
            { year: "1967", event: "CYK Parsing Algorithm", significance: "First O(n³) polynomial-time parsing for ambiguous CFGs; proved efficient CFG recognition feasible" },
            { year: "1968", event: "Semantic Information Processing (Minsky, ed.)", significance: "Landmark volume collecting seminal dissertations (SIR, STUDENT, Semantic Memory); articulated knowledge-based NLP agenda" },
            { year: "1968", event: "Quillian's Semantic Memory", significance: "Network-based semantic representation; concepts as nodes connected by relations; structured associative memory" },
            { year: "1969", event: "Conceptual Dependency (Schank)", significance: "Language-independent semantic representation using primitive actions (ATRANS, PTRANS, INGEST); canonical meaning representation" },
            { year: "1970", event: "Earley Parsing Algorithm", significance: "Efficient general CFG parsing; O(n³) worst-case, O(n²) unambiguous, linear for practical grammars" },
            { year: "1970", event: "ATN Formalism (Woods)", significance: "Augmented Transition Networks extended finite-state automata with registers and recursion; tractable parsing approximating transformational grammar" },
            { year: "1970", event: "Montague Grammar", significance: "Model-theoretic semantics for natural language; English fragments with mathematical rigor of formal logic" },
            { year: "1971", event: "SHRDLU (Winograd)", significance: "Blocks-world NLU integrating syntax (PROGRAMMAR), semantics, and reasoning (MICRO-PLANNER) in micro-domain" },
            { year: "1972", event: "LUNAR System (Woods et al.)", significance: "First practical QA system; accessed geological database via ATN parsing with ~3,500-word vocabulary" },
            { year: "1972", event: "Understanding Natural Language (Winograd)", significance: "Argued language understanding requires interleaving syntax, semantics, pragmatics—not independent pipeline modules" },
            { year: "1973", event: "14 Primitive Actions (Schank)", significance: "Full specification of conceptual primitives and inference rules; computational basis for Yale story understanding systems (MARGIE, SAM, PAM)" },
            { year: "1975", event: "Minsky's Frame Theory", significance: "Frames as data structures for stereotyped situations with slots and defaults; influenced semantic processing in NLP" },
            { year: "1976", event: "Computer Power and Human Reason (Weizenbaum)", significance: "Critique of symbolic AI; argued computers should not make decisions requiring human judgment and compassion" }
        ],
        
        techniques: [
            "Context-Free Grammars (CFG) and Recursive Transition Networks",
			"Recursive Transition Networks (RTN) of states with recursive calls to other networks; equivalent to CFGs",
            "Augmented Transition Networks (ATN) for parsing",
			"Definite Clause Grammar (DCG) Logic-programming based grammar formalism; rules are Horn clauses",
            "First-order logic and theorem proving",
            "Semantic networks and frame-based representations",
            "Pattern matching and template-based generation",
            "Finite-state automata for morphological analysis"
        ],
        
        pros: [
			"<strong>Linguistic grounding:</strong> Systems built on formal linguistic theory (Chomskyan grammar)",
            "<strong>Precise control:</strong> Engineers can directly modify specific behaviors without retraining",
            "<strong>Data efficiency:</strong> No requirement for large corpora—knowledge is engineered",
			"<strong>Transparency and Explainability:</strong>	System behavior can be traced to specific rules, making decisions interpretable",
			"<strong>Explicit Knowledge Encoding:</strong>	World knowledge is made explicit rather than implicit in model parameters",
			"<strong>Handling of Syntactic Complexity:</strong>	Formal grammars can capture recursive, nested, and long-distance dependencies",
			"<strong>Integration of Multiple Knowledge:</strong> Sources	Syntax, semantics, and pragmatics can be unified within a single architecture",
			"<strong>No Training Data Required:</strong>	Systems can be built for domains where no annotated corpora exist",
            "<strong>Interpretability:</strong> Explicit rules allow step-by-step verification of system behavior"
        ],
        
        cons: [
            "<strong>Scalability crisis:</strong> Rule explosion—coverage requires exponentially many rules",
            "<strong>Domain brittleness:</strong> Fails catastrophically on inputs outside engineered coverage",
            "<strong>No learning:</strong> Systems cannot improve from exposure to more data",
            "<strong>Knowledge acquisition bottleneck:</strong> Requires expensive expert linguists",
            "<strong>Domain specificity:</strong> SHRDLU's success in blocks world failed to generalize",
			"<strong>Combinatorial Explosion:</strong>	Rule interactions grow exponentially as rule sets expand",
			"<strong>Inability to Handle Uncertainty:</strong>	Binary rule application cannot model graded, probabilistic phenomena"
        ],
        
        educationalNote: "This foundational era of NLP spans three distinct phases: establishing theoretical frameworks in the 1950s, constructing the first working programs in the 1960s, and developing integrated systems that combined syntax, semantics, and world knowledge in the 1970s. However, the period was severely disrupted by the 1966 ALPAC Report, which triggered the first \"AI Winter\" due to overhyped expectations from carefully curated demonstrations. This collapse serves as a vital lesson in evaluation rigor, cementing the fundamental principle that an engineered demonstration does not equal actual general capability."
    },  
    era2: {
        title: "1980s–1990s: Statistical Revolution",
        tagline: "Language as Probability Distribution",
        period: "1980–1999",
        evaluationPhilosophy: "Quantitative metrics (precision, recall, F1); shared task competitions (MUC, TREC)",
        hardwareContext: "Workstations (Sun, DEC), early PCs, increasing disk storage for corpora",
        coreParadigm: "Data-driven probabilistic modeling; language as a stochastic process rather than deterministic logic",
        keyShift: "From handcrafted rules to learning patterns from annotated text corpora",
        representativeTask: "Part-of-Speech Tagging, Information Extraction, Document Retrieval",
        
        milestones: [
            { year: "1987", event: "MUC-1 (Message Understanding Conference)", significance: "First rigorous IE evaluation; established precision/recall/F1 as standard NLP metrics" },
            { year: "1988", event: "IBM Statistical MT (Brown et al.)", significance: "Noisy-channel model; purely statistical approach to translation" },
            { year: "1988", event: "Church's HMM POS Tagger", significance: "Demonstrated that statistical models could outperform rule-based systems" },
            { year: "1990", event: "WordNet (Princeton)", significance: "Lexical database with semantic relations; enabled word sense disambiguation research" },
            { year: "1992", event: "TREC (Text REtrieval Conference)", significance: "Large-scale IR evaluation; TREC-8 (1999) QA track launched modern question answering" },
            { year: "1993", event: "Penn Treebank Release", significance: "1M words with syntactic annotations; became the standard for parser evaluation" },
            { year: "1996", event: "Maximum Entropy Models (Ratnaparkhi)", significance: "Feature-based discriminative framework for tagging and parsing" },
            { year: "1998", event: "BNC (British National Corpus)", significance: "100M words; demonstrated scale requirements for statistical methods" }
        ],
        
        techniques: [
			"Hidden Markov Models (HMM) is a probabilistic finite state machines with hidden states and observable emissions; Viterbi algorithm for decoding",
			"N-gram Language Models: Markov assumption: probability of word depends only on previous n–1 words; with smoothing",
			"Smoothing Methods: Good-Turing discounting, Katz backoff, Kneser-Ney smoothing",
			"TF-IDF Weighting is Term frequency–inverse document frequency for term importance scoring",
			"Vector Space Models is	Bag-of-words representations in high-dimensional space; cosine similarity",
			"Naive Bayes Classifiers is probabilistic classifier based on Bayes’ theorem with strong independence assumptions",
			"Decision Trees is	tree-structured classifiers learned from annotated data",
			"Expectation-Maximization (EM) is iterative algorithm for maximum likelihood estimation with hidden variables",
			"Maximum Entropy (MaxEnt)	Discriminative framework selecting the distribution with maximum entropy subject to feature constraints"
        ],
        
        pros: [
            "<strong>Scalability:</strong> Performance improves (log-linearly) with more data",
            "<strong>Robustness:</strong> Handles noise and variation through probability distributions",
            "<strong>Automatic learning:</strong> Reduces manual engineering via training from corpora",
            "<strong>Rigorous evaluation:</strong> MUC/TREC established blind evaluation on held-out test sets",
			"<strong>Generalization:</strong>Applying probability and smoothing to help models perform accurately on unseen data."
        ],
        
        cons: [
            "<strong>Data sparsity:</strong> Zero probabilities for unseen n-grams; smoothing is imperfect",
            "<strong>Shallow representation:</strong> No deep semantic understanding—surface patterns only",
            "<strong>Limited context:</strong> N-grams capture local context but miss long-range dependencies",
            "<strong>Domain sensitivity:</strong> Models trained on Wall Street Journal fail on other domains",
			"<strong>Feature Engineering:</strong> Shifting effort from rule-writing to designing feature templates and annotating data.",
			"<strong>Computational Complexity:</strong> Demanding massive computing power to train large corpora and search high-dimensional spaces."
        ],
        
        educationalNote: "This era established modern NLP through shared tasks like MUC and TREC, driving rapid, measurable progress using precision/recall/F1 metrics. Key innovations included the Penn Treebank's train-test-split methodology, the noisy-channel model's informational framework, and the tension between generative and discriminative approaches."
    },
    
    era3: {
        title: "2000–2013: Machine Learning & Structured Prediction",
        tagline: "Feature Engineering & Discriminative Training",
        period: "2000–2013",
        evaluationPhilosophy: "Task-specific F1 scores; statistical significance testing; shared tasks (CoNLL)",
        hardwareContext: "Multi-core CPUs, 64-bit architectures, NLTK (2001), scikit-learn (2007)",
        coreParadigm: "Discriminative learning with rich feature engineering; structured prediction for output dependencies",
        keyShift: "From generative models (HMM) to discriminative models (CRF, SVM) with global optimization",
        representativeTask: "Named Entity Recognition (CoNLL-2003), Dependency Parsing (CoNLL-X), Sentiment Analysis",
        
        milestones: [
             {"year": "2000","event": "CoNLL-2000 Chunking Shared Task","significance": "Established the standardized shared task format (data splits, evaluation, leaderboards) that dominated 2000s NLP research."},
		     {"year": "2001","event": "Conditional Random Fields (Lafferty et al.)","significance": "Introduced undirected graphical models for sequence labeling that avoided label bias, becoming the state-of-the-art approach for over a decade."},
		     {"year": "2002/2004","event": "NLTK (Natural Language Toolkit)","significance": "Democratized NLP education and research by providing an open-source Python library of modules, datasets, and tutorials."},
		     {"year": "2003","event": "Latent Dirichlet Allocation (Blei et al.)","significance": "Provided a principled Bayesian framework for unsupervised topic modeling, enabling thematic structure discovery in large text corpora."},
		     {"year": "2003","event": "CoNLL-2003 NER Shared Task","significance": "Standardized English NER benchmarking using the Reuters corpus and BIO tagging, establishing evaluation protocols still used today."},
		     {"year": "1998/2002","event": "SVMs for Text Classification (Joachims)","significance": "Demonstrated that kernel methods with high-dimensional features could achieve state-of-the-art text classification without overfitting."},
		     {"year": "2003","event": "MaltParser / Transition-Based Dependency Parsing (Nivre)","significance": "Introduced an efficient arc-eager transition system for deterministic, linear-time dependency parsing across multiple languages."},
		     {"year": "2005","event": "MSTParser / Graph-Based Dependency Parsing (McDonald et al.)","significance": "Formulated dependency parsing as finding a maximum spanning tree, providing the theoretical foundation for graph-based parsing."},
		     {"year": "2006","event": "WMT (Workshop on Machine Translation)","significance": "Established an annual competitive evaluation with standardized metrics and datasets that drove the transition from SMT to NMT."},
		     {"year": "2006","event": "CoNLL-X Shared Task (Multilingual Dependency Parsing)","significance": "Unified treebanks for 13 languages, establishing dependency parsing as a viable alternative to constituency parsing."},
		     {"year": "2006","event": "Berkeley Parser (PCFG-LA) (Petrov et al.)","significance": "Achieved state-of-the-art constituency parsing by using EM to automatically refine coarse treebank symbols into latent subcategories."},
		     {"year": "2008","event": "Collobert & Weston (Neural Network Architecture for NLP)","significance": "Pioneered a joint CNN architecture for multitask NLP, proving deep networks could learn features with minimal hand-engineering."},
		     {"year": "2010","event": "Word Representations for Semi-Supervised Learning (Turian et al.)","significance": "Proved that pre-trained, unsupervised word representations consistently improved supervised baselines, laying the groundwork for word embeddings."},
  		     {"year": "2011","event": "IBM Watson Wins Jeopardy!","significance": "Demonstrated a practical question-answering system combining information retrieval, NLP, and curated knowledge bases."}
        ],
        
        techniques: [
            "Conditional Random Fields (CRF): Undirected graphical model with global normalization for sequence labeling using arbitrary feature functions.",
			"Support Vector Machines (SVM): Maximum-margin classifier using kernel methods optimized for high-dimensional, sparse data spaces.",
			"Structured Perceptron / MIRA: Online learning algorithms that perform structured prediction updates across the entire output framework.",
			"Feature Engineering: Manual creation of domain-specific feature templates spanning lexical, syntactic, and structural text properties.",
			"Dependency Parsing — Transition-Based (MaltParser): Deterministic, stack-based parsing algorithm predicting incremental transition actions via a classifier.",
			"Dependency Parsing — Graph-Based (MSTParser): Global optimization algorithm finding the maximum spanning tree over directed token graphs.",
			"Constituency Parsing (Berkeley Parser / PCFG-LA): Probabilistic context-free grammar refined automatically using latent variables and expectation-maximization.",
			"Topic Modeling (LDA): Generative Bayesian framework modeling text as distributions of topics and words via Dirichlet priors.",
			"Word Clustering (Brown): Hierarchical distribution-based clustering method grouping words based on bigram mutual information.",
			"Semi-Supervised Learning: Training approach leveraging small labeled sets alongside unlabeled data through self-training or structural features.",
			"Active Learning: Selection strategy targeting and prioritizing the most informative data points for manual human annotation."
        ],
        
        pros: [
            "<strong>Global Optimization:</strong> Jointly models entire sequences to prevent label bias and avoid over-favoring low-entropy transitions.",
            "<strong>Feature Flexibility:</strong> Allows the use of arbitrary, overlapping, and non-independent features without needing generative independence assumptions.",
            "<strong>Structured Prediction:</strong> Explicitly captures output dependencies and constraints through joint inference instead of isolated classifications.",
            "<strong>Task-Specific Optimization:</strong> Optimizes conditional likelihood directly to better align training objectives with final evaluation metrics.",
            "<strong>Semi-Supervised Gains:</strong> Leverages unsupervised word representations to boost supervised accuracy and ease manual annotation bottlenecks.",
            "<strong>Benchmark Culture:</strong> Establishes reproducible shared task frameworks that allow for standardized testing and competitive development.",
            "<strong>Efficient Parsing Algorithms:</strong> Delivers practical, large-scale text processing through linear-time transition-based and polynomial-time graph-based parsers."
        ],
        
        cons: [
            "<strong>Feature Engineering Burden:</strong> Requires intensive domain expertise to manually design labor-intensive, task-specific feature templa.",
            "<strong>Error Propagation:</strong> Pipeline architectures pass upstream mistakes downstream with no mechanism for recovery.",
            "<strong>Discrete Representations:</strong> Relies on binary or categorical indicators that lack any inherent notion of semantic similarity between features.",
            "<strong>Limited Compositionality:</strong> Struggles to model hierarchical structure and semantic composition without hand-crafted rules.",
            "<strong>Scalability of Inference:</strong> Exact inference is restricted to chain or tree structures, requiring slow approximations for general graphs.",
            "<strong>Domain Adaptation Cost:</strong> Demands renewed feature engineering and manual re-annotation when moving to new genres or languages.",
            "<strong>Parser Limitations:</strong> Transition parsers suffer from greedy error propagation, while graph parsers miss higher-order structural dependencies."
        ],
        
        educationalNote: "The CoNLL shared tasks (2000–2013) created a 'benchmark culture' that persists today. Teach CoNLL-2003 NER as the canonical example: it standardized train/dev/test splits, enabling fair comparison. Note the tension between <em>feature engineering</em> (this era) and <em>representation learning</em> (next era). The 2008 Collobert & Weston paper was largely overlooked—neural methods wouldn't dominate until computational resources caught up."
    },
    
    era4: {
        title: "2014–2017: Deep Learning & Distributed Representations",
        tagline: "End-to-End Representation Learning",
        period: "2014–2017",
        evaluationPhilosophy: "Word similarity benchmarks (SimLex, WordSim); downstream task performance; end-to-end metrics",
        hardwareContext: "NVIDIA GPUs (CUDA), cuDNN, TensorFlow (2015), PyTorch (2016), word2vec C++ optimization",
        coreParadigm: "Dense vector representations; neural networks learn continuous representations enabling similarity-based reasoning",
        keyShift: "From sparse one-hot vectors to dense distributed representations; from feature engineering to architecture engineering",
        representativeTask: "Neural Machine Translation, Sentiment Analysis, Reading Comprehension",
        
        milestones: [
             {"year": "2013","event": "Word2Vec (Mikolov et al., Google)","significance": "Introduced computationally efficient architectures (Skip-gram/CBOW) that learned high-quality word embeddings, enabling linear semantic translation in vector spaces."  },
			 {"year": "2013/2014","event": "SimLex-999 & WordSim-353","significance": "Established rigorous intrinsic evaluation benchmarks by differentiating genuine semantic similarity from mere topical association in word pairs."  },
			 {"year": "2014","event": "GloVe (Pennington et al., Stanford)","significance": "Combined count-based and prediction-based methods into a global log-bilinear regression model that optimized ratios of co-occurrence probabilities."  },
			 {"year": "2014","event": "Sequence-to-Sequence Learning (Sutskever et al.; Cho et al.)","significance": "Established the RNN-based encoder-decoder paradigm for sequence transduction, though constrained by a fixed-length vector information bottleneck."  },
			 {"year": "2014","event": "Neural Attention Mechanism (Bahdanau et al.)","significance": "Introduced soft attention to dynamically score and weight source hidden states, successfully eliminating the fixed-length context bottleneck."  },
			 {"year": "2014","event": "CNN for Sentence Classification (Kim)","significance": "Demonstrated that simple 1D convolutional neural networks using pre-trained vectors could serve as highly efficient, parallelizable alternatives to RNNs."  },
			 {"year": "2015","event": "SQuAD 1.0 (Rajpurkar et al.)","significance": "Shifted reading comprehension benchmarks from basic classification tasks to extractive span text identification using Wikipedia passages."  },
			 {"year": "2015","event": "SNLI (Bowman et al.)","significance": "Provided a massive, high-quality human-annotated corpus that established natural language inference as a premier target for representation learning."  },
			 {"year": "2015","event": "LSTM/GRU Dominance","significance": "Gated recurrent architectures became the default across NLP by solving the vanishing gradient problem over hundreds of tokens."  },
			 {"year": "2016","event": "Google Neural Machine Translation (GNMT)","significance": "Scaled neural machine translation to a global production system, replacing phrase-based SMT and reducing translation errors by 60%."  },
			 {"year": "2016","event": "FastText (Bojanowski et al., Facebook)","significance": "Enriched word representations with subword character n-grams, enabling models to accurately generate embeddings for out-of-vocabulary words."  },
			 {"year": "2017","event": "Transformer Architecture (Vaswani et al., Google)","significance": "Eliminated recurrence entirely in favor of highly parallelizable multi-head self-attention mechanisms, founding modern large language model design."}

        ],
        
        techniques: [
            "Word Embeddings: Skip-gram, CBOW (word2vec); GloVe; FastText",
			"Recurrent Architectures: LSTM with forget/input/output gates; GRU with update/reset gates",
			"Encoder-Decoder (Seq2Seq): RNN encoder compresses source; RNN decoder generates target",
			"Neural Attention: Soft alignment between encoder and decoder states",
			"Convolutional Networks for Text: 1D convolutions with multiple filter sizes + max-pooling",
			"Self-Attention	Direct: pairwise interaction between all sequence positions",
			"Subword Tokenization: WordPiece, BPE, character n-grams",
			"Pretrained Word Vectors: Static embeddings (word2vec, GloVe) as universal initialization",
			"Dropout & Regularization: Random masking of units/weights during training",
			"Mini-batch GPU Training: Parallel gradient computation on NVIDIA GPUs with CUDA/cuDNN",
			"Residual Connections: Skip connections enabling training of very deep networks"
        ],
        
        pros: [
            "<strong>Semantic Similarity:</strong> Cosine similarity captures relatedness and enables vector-space analogy reasoning.",
			"<strong>Reduced Engineering:</strong> Shuts down manual feature design by automatically discovering patterns from raw text.",
			"<strong>End-to-End Training:</strong> Uses joint backpropagation to eliminate sequential pipeline error propagation.",
			"<strong>Transfer Learning:</strong> Employs pre-trained vectors to consistently boost performance on downstream tasks.",
			"<strong>Compositionality:</strong> Uses neural components to build complex phrase and sentence representations.",
			"<strong>Parallelization:</strong> Replaces slow sequential operations with highly parallelized matrix math across sequences.",
			"<strong>Subword Handling:</strong> Uses character n-grams to represent out-of-vocabulary words and morphology."
        ],
        
        cons: [
            "<strong>Polysemy:</strong> Assigns a single vector per word, conflating distinctly different meanings.",
			"<strong>Contextual Limitation:</strong> Generates context-independent representations that ignore surrounding words during inference.",
			"<strong>Computational Cost:</strong> Demands high-performance hardware and extensive GPU memory for deep architectures.",
			"<strong>Interpretability:</strong> Functions as a black box requiring complex, imperfect post-hoc analysis.",
			"<strong>Data Requirements:</strong> Needs billions of text tokens, causing bottlenecks for low-resource languages.",
			"<strong>Long-Range Dependencies:</strong> Gated recurrent networks still dilute structural information over hundreds of tokens.",
			"<strong>Fixed Vocabulary:</strong> Standard models cannot generate vectors for unseen words without subword extensions."
        ],
        
        educationalNote: "This era marked NLP's \"ImageNet moment\" by shifting from static, word-level embeddings to parallelizable deep learning architectures. Studying this period requires using vector analogies to demonstrate semantic spaces while tracing how soft attention resolved fixed-length sequence bottlenecks to inspire the universal Transformer. Finally, it should highlight how new benchmarks like SQuAD transitioned tasks from classification to extractive span tracking, leaving unresolved polysemy limits to motivate the next contextual era."
    },
    
    era5: {
        title: "2018–2022: Pretrained Transformers & Emergent Capabilities",
        tagline: "Transfer Learning at Scale",
        period: "2018–2022",
        evaluationPhilosophy: "GLUE/SuperGLUE leaderboards; few-shot evaluation; perplexity; human evaluation for generation",
        hardwareContext: "TPU v2/v3, V100/A100 GPUs, Hugging Face Transformers (2019), distributed training frameworks",
        coreParadigm: "Pretrain on large unlabeled text, fine-tune on downstream tasks; self-attention enables parallelization and long-range modeling",
        keyShift: "From training task-specific models to pretraining universal language models; from supervised to self-supervised learning",
        representativeTask: "Universal NLU (GLUE), Text Generation, Few-shot Learning, Code Generation",
        
        milestones: [
              {"year": "2018","event": "ELMo: Deep Contextualized Word Representations (Peters et al.)","significance": "Introduced bidirectional LSTM contextualized embeddings where word vectors are dynamically generated as a function of the entire input sentence."  },
			  {"year": "2018","event": "BERT: Bidirectional Encoder Representations from Transformers (Devlin et al., Google)","significance": "Established the pretrain-then-fine-tune paradigm across NLP by utilizing deep bidirectional transformer encoding and masked language modeling."  },
			  {"year": "2018","event": "GLUE Benchmark (Wang et al.)","significance": "Aggregated 9 diverse NLU tasks into a single score, driving a standardized multi-task leaderboard culture across representation learning."  },
			  {"year": "2018","event": "GPT-1: Generative Pretraining (Radford et al., OpenAI)","significance": "Demonstrated that causal generative pretraining on a transformer decoder could build broadly transferable linguistic knowledge for diverse downstream tasks."  },
			  {"year": "2019","event": "GPT-2: Language Models are Unsupervised Multitask Learners (Radford et al., OpenAI)","significance": "Validated the scaling hypothesis at 1.5B parameters, showing emergent zero-shot task transfer simply by conditioning the model on text prompts."  },
			  {"year": "2019","event": "RoBERTa: Robustly Optimized BERT (Liu et al., Facebook)","significance": "Proved training methodology matters as much as design by matching newer architectures through hyperparameter tuning, dynamic masking, and 10x more data."  },
			  {"year": "2020","event": "T5: Text-to-Text Transfer Transformer (Raffel et al., Google)","significance": "Unified all NLP tasks into a single text generation format using an encoder-decoder architecture pretrained on the massive C4 dataset."  },
			  {"year": "2020","event": "GPT-3: Language Models are Few-Shot Learners (Brown et al., OpenAI)","significance": "Triggered the prompting revolution by showing that a 175B parameter model adapts to new tasks completely in-context without any gradient updates."  },
			  {"year": "2020","event": "SuperGLUE (Wang et al.)","significance": "Introduced harder language understanding tasks with minimal training data after BERT-style architectures rapidly surpassed the original GLUE benchmark."  },
			  {"year": "2021","event": "Switch Transformers: Scaling to Trillion Parameters (Fedus et al., Google)","significance": "Scaled language models to 1.6 trillion parameters using a sparse Mixture-of-Experts routing technique to maximize capacity without increasing FLOPs."  },
			  {"year": "2022","event": "PaLM: Scaling Language Modeling with Pathways (Chowdhery et al., Google)","significance": "Deployed a 540B dense parameter model across 6,144 TPU chips, revealing sharp, non-linear capability jumps on multi-step reasoning tasks."  },
			  {"year": "2022","event": "Chinchilla: Training Compute-Optimal Large Language Models (Hoffmann et al., DeepMind)","significance": "Overturned parameter-first scaling strategies by proving data tokens and model size must be scaled equally to build compute-optimal models."  },
			  {"year": "2022","event": "InstructGPT / ChatGPT (Ouyang et al., OpenAI)","significance": "Introduced RLHF alignment at scale, enabling a 1.3B model to beat a 175B model by shifting metrics from automatic token matching to human preference."  },
			  {"year": "2022","event": "BIG-bench: Beyond the Imitation Game (Srivastava et al.)","significance": "Created a multi-disciplinary collaborative evaluation suite consisting of over 200 tasks to map emergent capabilities and strict limitations in LLMs."  }
        ],
        
        techniques: [
            "Transformer Architecture: Multi-head self-attention, position encoding, feed-forward layers; encoder-only (BERT), decoder-only (GPT), encoder-decoder (T5)",
			"Masked Language Modeling (MLM): Predict randomly masked tokens from bidirectional context (BERT, RoBERTa)",
			"Autoregressive Language Modeling: Predict next token from left-to-right context (GPT family)",
			"Span Corruption (T5): Mask random contiguous spans; predict entire span text",
			"Fine-Tuning: Add task-specific head; update all parameters on labeled data",
			"In-Context Learning (ICL): Provide task description + few examples in prompt; no parameter updates",
			"Prompt Engineering: Design input prompts to elicit desired behavior from pretrained models",
			"Chain-of-Thought Prompting: Prompt model to generate intermediate reasoning steps before final answer",
			"Reinforcement Learning from Human Feedback (RLHF):	SFT → RM training → PPO optimization against learned reward model",
			"Scaling Laws:	Power-law relationships between model size, data, compute, and performance",
			"Mixture of Experts (MoE): Sparse activation: route each token to subset of experts; constant inference cost",
			"Transfer Learning / Domain Adaptation:	Pretrain on general corpus; fine-tune on target domain/task data",
			"Parameter-Efficient Fine-Tuning: Adapters, LoRA, prefix tuning—update small subset of parameters"
        ],
        
        pros: [
			"<strong>Universal Architecture:</strong> A single foundation model handles diverse tasks, eliminating the need for custom, task-specific networks.",
			"<strong>State-of-the-Art Performance:</strong> Dominated all major NLP benchmarks, driving model capabilities close to human parity.",
			"<strong>Few-Shot Learning:</strong> Adapts to entirely new tasks purely through in-context text prompts without needing gradient updates.",
			"<strong>Deep Bidirectional Context:</strong> Incorporates surrounding sentence context from both directions to solve word polysemy.",
			"<strong>Transfer Efficiency:</strong> Amortizes massive initial training costs by supporting hundreds of cheap downstream adjustments.",
			"<strong>Emergent Capabilities:</strong> Unlocks unexpected reasoning, coding, and mathematical skills spontaneously at massive scales.",
			"<strong>Alignment via RLHF:</strong> Uses human preference feedback to make outputs dramatically more helpful, harmless, and intentional.",
			"<strong>Scaling Predictability:</strong> Employs precise compute-optimal mathematical laws to perfectly forecast training needs beforehand."
        ],
        
        cons: [
            "<strong>Computational Inequality:</strong> Multi-million dollar training costs lock advancement inside a few elite, well-funded organizations.",
			"<strong>Environmental Impact:</strong> Generates a massive carbon footprint and consumes huge amounts of power during long training runs.",
			"<strong>Bias Amplification:</strong> Inherits, reproduces, and actively amplifies internet-sourced societal, racial, and gender stereotypes.",
			"<strong>Static Knowledge:</strong> Suffers from strict training data cutoffs, leading to rapid factual obsolescence without retraining.",
			"<strong>Catastrophic Forgetting:</strong> Overwrites broader generalized language rules when heavily tuned on specific narrow tasks.",
			"<strong>Evaluation Challenges:</strong> High leaderboard scores often fail to reflect practical real-world utility or common-sense reasoning.",
			"<strong>Alignment Problem:</strong> Inherently optimizes for text likelihood over safety, requiring expensive human data to prevent toxicity.",
			"<strong>Hallucination:</strong> Regularly produces highly confident, plausible-sounding text that is completely false or nonsensical.",
			"<strong>Interpretability Gap:</strong> Operates as a massive black box, restricting safe deployment in high-stakes legal or medical fields.",
			"<strong>Prompt Brittleness:</strong> Yields erratic performance based purely on minor formatting tweaks, wording, or example ordering."
        ],
        
        educationalNote: "The GLUE benchmark introduced a competitive leaderboard culture that transformed NLP from a technical field into a social phenomenon, accelerating progress while incentivizing metric gaming. Studying this era requires contrasting the architectural trade-offs between BERT's bidirectional understanding and GPT's left-to-right generation, while utilizing Chinchilla’s scaling laws to prove that data volume matters more than raw parameter size. Finally, it highlights that real-world impact relies heavily on deployment and alignment, as seen when ChatGPT’s chat interface turned existing InstructGPT technology into a massive UX breakthrough."
    },
    
    era6: {
        title: "2023–Present: Agentic AI, Reasoning & Multimodal Systems",
        tagline: "From Prediction to Action",
        period: "2023–Present",
        evaluationPhilosophy: "Interactive environment performance (SWE-bench, WebArena); reasoning benchmarks (GSM8K, MATH); tool use accuracy; multimodal understanding",
        hardwareContext: "H100 GPUs, TPU v4/v5, inference optimization (vLLM, TensorRT-LLM), mixture-of-experts serving",
        coreParadigm: "LLMs as agents: reasoning, tool use, planning, and autonomous action in multi-step tasks",
        keyShift: "From static dataset evaluation to dynamic environment interaction; from text-only to multimodal reasoning",
        representativeTask: "Autonomous Coding (SWE-bench), Web Navigation (WebArena), Mathematical Reasoning, Multimodal QA",
        
        milestones: [
            {"year": "2022","event": "Chain-of-Thought Prompting (Wei et al.)","significance": "Demonstrated that prompting LLMs to generate intermediate reasoning steps dramatically improves multi-step math and logic performance."  },
			{"year": "2023","event": "GPT-4 (OpenAI)","significance": "First large multimodal (text+vision) model displaying advanced domain reasoning, professional exam mastery, and predictable capability scaling."  },
			{"year": "2020/2023","event": "Retrieval-Augmented Generation (RAG) (Lewis et al.)","significance": "Combined parametric model weights with external non-parametric retrieval indexes to reduce hallucinations and dynamically update model knowledge."  },
			{"year": "2023","event": "LLaMA / LLaMA 2 (Meta)","significance": "Democratized frontier AI by openly releasing powerful model weights, catalyzing a massive global open-source LLM ecosystem."  },
			{"year": "2023","event": "ToolFormer (Schick et al., Meta AI)","significance": "Proved that language models can teach themselves to call external APIs in a self-supervised manner to accurately use calculators, calendars, and search engines."  },
			{"year": "2023","event": "SWE-bench (Jimenez et al.)","significance": "Established a rigorous software engineering benchmark based on real GitHub issues, revealing a massive 'agentic gap' between models and humans."  },
			{"year": "2023","event": "WebArena (Zhou et al.)","significance": "Created a reproducible, Docker-hosted web environment to evaluate autonomous agents performing human-like e-commerce and site navigation tasks."  },
			{"year": "2023","event": "Mind2Web (Deng et al.)","significance": "Introduced the first massive dataset explicitly designed for tracking and testing generalist web agent navigation across diverse online domains."  },
			{"year": "2022/2023","event": "ReAct: Reasoning + Acting (Yao et al.)","significance": "Introduced an agent architecture that interleaves thought generation and text-based actions to dynamically build and adjust execution plans."  },
			{"year": "2023","event": "Reflexion: Self-Reflective Agents (Shinn et al.)","significance": "Endowed agents with linguistic self-reflection capabilities, allowing them to fix their own mistakes via dynamic memory without parameter updates."  },
			{"year": "2022/2023","event": "Constitutional AI (Bai et al., Anthropic)","significance": "Pioneered a scalable alternative to RLHF where an AI self-corrects and aligns its outputs using a structured set of constitutional rules."  },
			{"year": "2024","event": "Claude 3 / Gemini / GPT-4o","significance": "Marked the transition to unified, native omnimodal architectures that process text, image, audio, and real-time video simultaneously."  },
		    {"year": "2024","event": "Mixtral 8x22B (Mistral AI)","significance": "Demonstrated that open-source, sparse Mixture-of-Experts (SMoE) architectures can match or exceed massive proprietary dense networks."  },
		    {"year": "2024","event": "MMMU: Massive Multi-discipline Multimodal Understanding (Yue et al.)","significance": "Established an advanced college-level multi-discipline benchmark to evaluate complex visual reasoning in expert-level multimodal models."  },
		    {"year": "2024","event": "Agentic RAG & Advanced Tool Use","significance": "Evolved static document lookup into dynamic agentic loops utilizing self-correction, tool routing, and collaborative multi-agent code execution."  }
		],
        
        techniques: [
            "Chain-of-Thought (CoT) Prompting: Prompt model to generate intermediate reasoning steps before final answer",
			"Retrieval-Augmented Generation (RAG):	Combine parametric memory with non-parametric retrieval; dense passage retrieval + generation",
			"ReAct: Reasoning + Acting:	Interleave verbal reasoning traces with executable actions in dynamic environments",
			"Self-Reflection / Reflexion:	Agent critiques its own reasoning and actions; maintains dynamic memory of past mistakes",
			"Tool Use / Function Calling:	Models learn to invoke external APIs (calculator, search, code execution) with correct arguments",
			"ToolFormer-style Self-Supervised Learning:	Self-supervised API call learning via perplexity-based filtering",
			"Multimodal Encoders:	CLIP, vision transformers, audio encoders integrated with LLM backbones",
			"Constitutional AI / RLAIF:	Self-supervised alignment via AI-generated critiques and preference models",
			"Mixture of Experts (MoE):	Sparse activation: route tokens to subsets of experts; constant inference cost",
			"Parameter-Efficient Fine-Tuning:	QLoRA, DoRA, adapters—update small parameter subsets for task adaptation",
			"Speculative Decoding:	Draft model predicts tokens; target model verifies; accelerates inference",
			"Agent Architectures:	Planning, memory (short/long-term), tool use, reflection modules",
			"Long-Context Modeling:	1M+ token context windows (Gemini 1.5, Claude 3); retrieval-augmented generation"
        ],
        
        pros: [
            "<strong>Autonomous Capability:</strong> Executes complex, multi-step actions like coding and navigation with minimal human oversight.",
			"<strong>Tool Augmentation:</strong> Seamlessly invokes external calculators, search engines, and APIs to combine parametric and static knowledge.",
			"<strong>Grounded Generation:</strong> Uses source citation via RAG to directly reduce hallucinations and bypass training cutoffs.",
			"<strong>Multimodal Integration:</strong> Processes text, audio, images, and video natively in a single system for real-time interaction.",
			"<strong>Reasoning Emergence:</strong> Employs chain-of-thought and ReAct prompts to break down and solve multi-step problems.",
			"<strong>Open Ecosystem:</strong> Democratizes access to frontier models via open-weight releases like LLaMA and Mixtral.",
			"<strong>Self-Improvement:</strong> Refines outputs iteratively through automated self-critique without requiring new human data labels."
        ],
        
        cons: [
            "<strong>Hallucination Persists:</strong> Continues to fabricate plausible-sounding falsehoods, especially if retrieval sources are unreliable.",
			"<strong>Tool Failure Cascades:</strong> Suffers from compound errors where a single bad API call derails the entire agent trajectory.",
			"<strong>Evaluation Crisis:</strong> Lacks effective, reproducible metrics for open-ended or interactive environment tasks.",
			"<strong>Safety Challenges:</strong> Risks real-world harm when granting autonomous models the power to execute code or send messages.",
			"<strong>Alignment Complexity:</strong> Opens new vulnerabilities like prompt injection embedded directly within external tool outputs.",
			"<strong>Computational Concentration:</strong> Restricts frontier AI development to a tiny group of ultra-wealthy corporations.",
			"<strong>Benchmark Gaming:</strong> Overfits to evaluation environments by memorizing solutions rather than executing true reasoning.",
			"<strong>Long-Horizon Planning:</strong> Struggles to navigate complex hierarchical dependencies over dozens of sequential actions.",
			"<strong>Context Window Limitations:</strong> Suffers from approximation and retrieval errors when parsing massive codebases or long videos.",
			"<strong>Multimodal Reasoning Gaps:</strong> Fails at high-level visual logic, fine-grained details, and spatial relationship mapping."
        ],
        
        educationalNote: "This current NLP frontier shifts the evaluation paradigm from static datasets to interactive environments like SWE-bench, highlighting a massive \"agentic gap\" where models still lag far behind human capability in real codebases. Studying this era requires contrasting accessible open-weight alternatives with closed APIs, while recognizing that many agentic breakthroughs represent product engineering rather than architectural novelty. Ultimately, it emphasizes the profound impact of native multimodal integration and a philosophical pivot toward principle-based Constitutional AI over expensive human feedback loops."
    }
};

function openModal(eraId) {
    const modalBody = document.getElementById("modal-body");
    const modal = document.getElementById("modal");
    const era = eras[eraId];
    
    if (!era) return;
    
    // Build HTML content with educational structure
    let content = `
        <div class="modal-header">
            <span class="era-period">${era.period}</span>
            <h2>${era.title}</h2>
            <p class="modal-tagline">${era.tagline}</p>
        </div>
        
        <div class="modal-section paradigm-box">
            <h3>🎯 Core Paradigm Shift</h3>
            <p><strong>${era.coreParadigm}</strong></p>
            <p class="key-shift"><strong>Key Shift:</strong> ${era.keyShift}</p>
        </div>
        
        <div class="modal-grid">
            <div class="modal-col">
                <h3>💻 Hardware & Software Context</h3>
                <p>${era.hardwareContext}</p>
            </div>
            <div class="modal-col">
                <h3>📊 Evaluation Philosophy</h3>
                <p>${era.evaluationPhilosophy}</p>
            </div>
        </div>
        
        <div class="modal-section">
            <h3>⭐ Representative Task</h3>
            <p class="rep-task">${era.representativeTask}</p>
        </div>
        
        <div class="modal-section milestones-section">
            <h3>📅 Key Milestones & Benchmarks</h3>
            <div class="milestones-list">
    `;
    
    era.milestones.forEach(m => {
        content += `
            <div class="milestone-item">
                <span class="milestone-year">${m.year}</span>
                <div class="milestone-content">
                    <strong>${m.event}</strong>
                    <p>${m.significance}</p>
                </div>
            </div>
        `;
    });
    
    content += `
            </div>
        </div>
        
        <div class="modal-section techniques-section">
            <h3>🔧 Core Techniques</h3>
            <ul class="techniques-list">
                ${era.techniques.map(t => `<li>${t}</li>`).join('')}
            </ul>
        </div>
        
        <div class="modal-grid pros-cons">
            <div class="modal-col pros">
                <h3>✅ Advantages</h3>
                <ul>
                    ${era.pros.map(p => `<li>${p}</li>`).join('')}
                </ul>
            </div>
            <div class="modal-col cons">
                <h3>❌ Limitations</h3>
                <ul>
                    ${era.cons.map(c => `<li>${c}</li>`).join('')}
                </ul>
            </div>
        </div>
        
        <div class="modal-section educational-highlight">
            <h3>🎓 Key Summary:</h3>
            <div class="edu-note-box">
                <p>${era.educationalNote}</p>
            </div>
        </div>
    `;
    
    modalBody.innerHTML = content;
    modal.style.display = "block";
    document.body.style.overflow = "hidden";
    
    // Update active nav node
    document.querySelectorAll('.era-node').forEach(node => {
        node.classList.remove('active');
        if (node.dataset.era === eraId) node.classList.add('active');
    });
}

function closeModal() {
    document.getElementById("modal").style.display = "none";
    document.body.style.overflow = "auto";
}

// Event listeners
window.onclick = function(event) {
    const modal = document.getElementById("modal");
    if (event.target === modal) closeModal();
};

document.addEventListener('keydown', function(event) {
    if (event.key === "Escape") closeModal();
});

// Navigation click handlers
document.querySelectorAll('.era-node').forEach(node => {
    node.addEventListener('click', () => {
        openModal(node.dataset.era);
    });
});

// Keyboard navigation between eras
document.addEventListener('keydown', function(event) {
    if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
        const modal = document.getElementById("modal");
        if (modal.style.display === "block") {
            const erasList = ['era1', 'era2', 'era3', 'era4', 'era5', 'era6'];
            const current = document.querySelector('.era-node.active');
            if (current) {
                let idx = erasList.indexOf(current.dataset.era);
                if (event.key === "ArrowRight" && idx < 5) idx++;
                if (event.key === "ArrowLeft" && idx > 0) idx--;
                openModal(erasList[idx]);
            }
        }
    }
});