Instructions to use ai4data/datause-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ai4data/datause-classifier with PEFT:
Task type is invalid.
- Transformers
How to use ai4data/datause-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ai4data/datause-classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ai4data/datause-classifier", dtype="auto") - GLiNER
How to use ai4data/datause-classifier with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("ai4data/datause-classifier") - Notebooks
- Google Colab
- Kaggle
| base_model: fastino/gliner2-large-v1 | |
| library_name: peft | |
| tags: | |
| - base_model:adapter:fastino/gliner2-large-v1 | |
| - lora | |
| - transformers | |
| - text-classification | |
| - gliner | |
| # Dataset Mention Classification Model | |
| This is a fine-tuned sequence classification model for identifying the presence of dataset mentions in text. It is built as a LoRA adapter on top of the [fastino/gliner2-large-v1](https://huggingface.co/fastino/gliner2-large-v1) base model. | |
| It serves as the default pre-filtering stage (page-relevance classifier) in the `ai4data` dataset extraction pipeline, helping skip pages/documents that do not contain dataset references before performing detailed entity and relation extraction. | |
| ## Model Details | |
| - **Base Model:** `fastino/gliner2-large-v1` | |
| - **Adapter Type:** PEFT / LoRA | |
| - **Task:** Sequence Classification | |
| - **Task Name:** `has_data_mention` | |
| - **Labels:** `["has_mention", "no_mention"]` | |
| ## How to Use | |
| You can load and use this model directly via `gliner2` and the `PeftModel` interface: | |
| ```python | |
| from gliner2 import GLiNER2 | |
| from peft import PeftModel | |
| # Load base model and apply adapter | |
| base_model = GLiNER2.from_pretrained("fastino/gliner2-large-v1") | |
| model = PeftModel.from_pretrained(base_model, "ai4data/datause-classifier") | |
| model.eval() | |
| # Define classification tasks | |
| TASKS = {"has_data_mention": ["has_mention", "no_mention"]} | |
| text_with_data = "This paper uses microdata from the 2018 Nigeria General Household Survey." | |
| text_no_data = "The project will strengthen institutional capacity and governance frameworks." | |
| # Run inference | |
| res1 = model.classify_text(text_with_data, TASKS, threshold=0.0, include_confidence=True) | |
| print(res1) | |
| # Output: {'has_data_mention': {'label': 'has_mention', 'confidence': 1.0}} | |
| res2 = model.classify_text(text_no_data, TASKS, threshold=0.0, include_confidence=True) | |
| print(res2) | |
| # Output: {'has_data_mention': {'label': 'no_mention', 'confidence': 0.998}} | |
| ``` | |