PopFit / README.md
baunef's picture
Update README.md
08dc1f6
|
Raw History Blame Contribute Delete
1.18 kB
---
pipeline_tag: text-classification
---
# PopFit
This is a [SetFit model](https://github.com/huggingface/setfit) for German-language populism detection in news and media content. It was created as part of master thesis at the Hochschule für Politik @TUM.
The model is based on [deutsche-telekom/gbert-large-paraphrase-cosine](https://huggingface.co/deutsche-telekom/gbert-large-paraphrase-cosine) and has been trained using an efficient few-shot learning technique that involves:
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
2. Training a classification head with features from the fine-tuned Sentence Transformer.
The model generates binary classification labels with 0 as the `non-populist` and 1 as the `populist` class.
## Usage
To use this model for inference, first install the SetFit library:
```bash
python -m pip install setfit
```
You can then run inference as follows:
```python
from setfit import SetFitModel
# Download from Hub and run inference
model = SetFitModel.from_pretrained("baunef/PopFit")
# Run inference
preds = model(["i loved the spiderman movie!", "pineapple on pizza is the worst 🤮"])
```