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
Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string
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 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:
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}}
- Downloads last month
- 37
Model tree for ai4data/datause-classifier
Base model
fastino/gliner2-large-v1