Downloads · 30 days
21
1% of all-time downloads
mazancourt/politics-sentence-classifier
politics-sentence-classifier is a text classification model from mazancourt. Use it when you need a label for a piece of text. It is set up for transformers.
This model aims at predicting the nature of a sentence in a French political sentence. The predictions fall in three categories: - problem: the sentence describes a problem (usually to be tackled by the speaker), for…
Downloads · 30 days
21
1% of all-time downloads
All-time downloads
2.1K
Public
Parameters
111M
886 MB on disk
Likes
5
Public
Click a slice to open those files.
.bin443 MB · 50%
How the weights are stored.
F32111M · 100%
From the Hugging Face model README
This model aims at predicting the nature of a sentence in a French political sentence. The predictions fall in three categories:
problem: the sentence describes a problem (usually to be tackled by the speaker), for example il y a dans ce pays une fracture (J. Chirac)solution: the sentences describes a solution (typically part of a political programme), for example: J’ai supprimé les droits de succession parce que je crois au travail et parce que je crois à la famille. (N. Sarkozy)other: the sentence does not belong to any of these categories, for example: vive la République, vive la FranceThis model was trained using AutoNLP based on sentences extracted from a mix of political tweets and speeches.
You can use cURL to access this model:
$ curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "Il y a dans ce pays une fracture"}' https://api-inference.huggingface.co/models/mazancourt/politics-sentence-classifier
Or Python API:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("mazancourt/autonlp-politics-sentence-classifier-23105051", use_auth_token=True)
tokenizer = AutoTokenizer.from_pretrained("mazancourt/politics-sentence-classifier", use_auth_token=True)
inputs = tokenizer("Il y a dans ce pays une fracture", return_tensors="pt")
outputs = model(**inputs)
# Category can be "problem", "solution" or "other"
category = outputs[0]["label"]
score = outputs[0]["score"]