Instructions to use ai4data/gliner2_datause with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use ai4data/gliner2_datause with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("ai4data/gliner2_datause") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| pipeline_tag: token-classification | |
| tags: | |
| - ner | |
| - gliner2 | |
| - data-use | |
| # gliner2_datause_extended | |
| Fine-tune of `fastino/gliner2-large-v1` (GLiNER2) for data-use mention extraction | |
| (dataset / survey / census / registry mentions in economics research papers). | |
| ## Labels | |
| - `NAMED_DATA` — a proper name, title, or acronym of a specific data source | |
| - `DESCRIPTIVE_DATA` — a source described in words but not named | |
| - `VAGUE_DATA` — generic data wording with no identifiable source | |
| ## Training | |
| - base model: `fastino/gliner2-large-v1` | |
| - dataset: `rafmacalaba/data-use-mentions-extended` (gliner2 config) | |
| - epochs: 5 | |
| - encoder LR: 1e-05 | |
| - task LR: 0.0005 | |
| - batch size: 8 | |
| - precision: bf16 | |
| ## Evaluation (holdout, label-agnostic) | |
| | thr | tp | fp | fn | precision | recall | f0.5 | f1 | | |
| | --- | --- | --- | --- | --- | --- | --- | --- | | |
| | 0.10 | 12163 | 5439 | 404 | 0.6910 | 0.9679 | 0.7329 | 0.8063 | | |
| | 0.20 | 11976 | 4277 | 591 | 0.7368 | 0.9530 | 0.7719 | 0.8311 | | |
| | 0.30 | 11788 | 3535 | 779 | 0.7693 | 0.9380 | 0.7980 | 0.8453 | | |
| | 0.40 | 11618 | 2942 | 949 | 0.7979 | 0.9245 | 0.8204 | 0.8566 | | |
| | 0.50 | 11383 | 2478 | 1184 | 0.8212 | 0.9058 | 0.8368 | 0.8614 | | |
| | 0.60 | 11068 | 2008 | 1499 | 0.8464 | 0.8807 | 0.8531 | 0.8632 | | |
| | 0.70 | 10487 | 1535 | 2080 | 0.8723 | 0.8345 | 0.8645 | 0.8530 | | |
| **Best F0.5**: 0.8645 (thr=0.7) | |
| **Best F1**: 0.8632 (thr=0.6) | |
| <!-- NER_COMPARISON_START --> | |
| ## NER holdout comparison | |
| device: NVIDIA H100 NVL | |
| ### rafmacalaba/data-use-mentions-extended (n=9249) | |
| | model | backend | best F0.5 | thr | best F1 | thr | wall-clock (s) | texts/s | | |
| | --- | --- | --- | --- | --- | --- | --- | --- | | |
| | `rafmacalaba/gliner_datause_extended` | gliner | 0.8506 | 0.6 | 0.8549 | 0.5 | 202.7 | 45.6 | | |
| | `ai4data/gliner2_datause` | gliner2 | 0.8634 | 0.7 | 0.8624 | 0.6 | 180.8 | 51.1 | | |
| F0.5 by threshold (sweet spots side-by-side): | |
| | thr | `rafmacalaba/gliner_datause_extended` | `ai4data/gliner2_datause` | | |
| | --- | --- | --- | | |
| | 0.1 | 0.6476 | 0.7321 | | |
| | 0.2 | 0.7121 | 0.7712 | | |
| | 0.3 | 0.7505 | 0.7979 | | |
| | 0.4 | 0.7858 | 0.8201 | | |
| | 0.5 | 0.8224 | 0.8363 | | |
| | 0.6 | 0.8506 | 0.8523 | | |
| | 0.7 | 0.8422 | 0.8634 | | |
| <!-- NER_COMPARISON_END --> | |