|
|
--- |
|
|
language: en |
|
|
tags: |
|
|
- zero-shot-classification |
|
|
- wikidata |
|
|
- knowledge-graph |
|
|
license: mit |
|
|
datasets: |
|
|
- wikidata |
|
|
- wikipedia |
|
|
--- |
|
|
|
|
|
# Zero-Shot Wikidata Classifier |
|
|
|
|
|
This model performs **zero-shot text classification** by dynamically integrating knowledge from Wikidata. It classifies text into custom categories without requiring training data. |
|
|
|
|
|
## How It Works |
|
|
1. **Input**: Receives any text input |
|
|
2. **Knowledge Expansion**: Queries Wikidata for related concepts |
|
|
3. **Classification**: Uses Wikipedia-trained BART model to match text to concepts |
|
|
4. **Output**: Returns ranked categories with confidence scores |
|
|
|
|
|
## Capabilities |
|
|
- 🧠 **Dynamic Classification**: Adapts to new categories via Wikidata |
|
|
- ⚡ **Zero-Shot Learning**: No training required |
|
|
- 🔍 **Knowledge Integration**: Leverages Wikipedia's semantic relationships |
|
|
- 🌐 **Multilingual Support**: Works with 100+ languages (see multilingual section) |
|
|
|
|
|
## Usage |
|
|
```python |
|
|
from transformers import pipeline |
|
|
from wikidata import get_wikidata_labels |
|
|
|
|
|
classifier = pipeline("zero-shot-classification", |
|
|
model="your-username/zero-shot-wikidata-classifier") |
|
|
|
|
|
# Classify with Wikidata expansion |
|
|
labels = get_wikidata_labels("renewable energy") |
|
|
result = classifier("Perovskite solar cells achieve 30% efficiency", |
|
|
candidate_labels=labels) |