Views
No views yet
PERSONORGGPEEVENTDATE1Raw Documents
2 │
3 ▼
4Text Extraction / Preprocessing
5 │
6 ▼
7GLiNER2 NER
8 │
9 ├── PERSON
10 ├── ORG
11 ├── GPE
12 ├── EVENT
13 └── DATE
14 │
15 ▼
16Entity Normalization / Deduplication
17 │
18 ▼
19Relation Extraction
20 │
21 ▼
22Knowledge Graph
23 │
24 ├── Entity Nodes
25 └── Relationship Edges| Entity | Description | Example |
|---|---|---|
PERSON | Names of individual people including politicians, business leaders, and officials. | Donald Trump |
ORG | Organizations, companies, governments, political parties, NGOs, and institutions. | NATO |
GPE | Geopolitical entities such as countries, states, provinces, cities, and territories. | Iran, Washington |
EVENT | Named or identifiable real-world events including geopolitical, military, and historical events. | 2024 Paris Olympics |
DATE | Temporal expressions including dates, months, years, date ranges, and relative dates. | August 14, 2026 |
PERSON, ORG, GPE, and DATE. It contains very few EVENTs.EVENT class. Few-NERD provides a massive pool of events, which we filter and randomly downsample to balance against the OntoNotes labels.combined_output.jsonl)EVENTs. We drop corrupted labels from this dataset (like broken PERSON/ORG extractions) and keep only the gold-standard EVENTs to inject strong domain knowledge into the model.PERSON and ORG labels because they were corrupted. If we feed a sentence containing a person's name to the model but don't label it as PERSON, the model learns a False Negative (i.e., it learns that the name is not a person).valid_labels based on the source dataset:EVENT.PERSON or ORG on the Custom dataset, we completely bypass the False Negative penalty.EVENT class to dominate the loss function, destroying the model's ability to recognize dates or organizations.TARGET_BUDGET (e.g., 18,000 entities per class).1Base Model: fastino/gliner2-base-v1
2Epochs: 8
3Batch size: 18
4Gradient accumulation: 2
5Encoder learning rate: 1e-5
6Task learning rate: 5e-4
7LoRA Rank (r): 8 (Configurable to 16/32)
8LoRA Alpha: 16.0 (Configurable to 32.0/64.0)patience=3) and validation are evaluated at every epoch.President Donald Trump met NATO officials in Washington on August 14, 2026 during the Iran conflict.
1PERSON → Donald Trump
2ORG → NATO
3GPE → Washington
4DATE → August 14, 2026
5EVENT → Iran conflict1[Donald Trump] ──(met)──▶ [NATO] ──(located in)──▶ [Washington]
2 │
3 (occurred during)
4 │
5 ▼
6 [Iran conflict]11. Load OntoNotes 5, Few-NERD, and Custom JSONL
2 │
3 ▼
42. Normalize all formats to Character-Level Spans
5 │
6 ▼
73. Validate and drop overlapping/whitespace spans
8 │
9 ▼
104. Global text deduplication (preventing data leakage)
11 │
12 ▼
135. Class Balancing (Downsample Few-NERD to Target Budget)
14 │
15 ▼
166. GroupShuffleSplit (Train / Val / Test)
17 │
18 ▼
197. Convert to GLiNER2 InputExample format
20 │
21 ▼
228. Fine-tune unified GLiNER2 with LoRA
23 │
24 ▼
259. Strict Span + Label Evaluation & Error Analysis
26 │
27 ▼
2810. Save Model & Adapters(entity start, entity end, entity label)Missed Entities (False Negatives)Spurious Entities (False Positives)Wrong Labelspip install -q "gliner2[local]" datasets scikit-learn matplotlib seaborn pandas tqdm huggingface_hubcombined_output.jsonl/best_model locally or push it directly to the Hugging Face hub.