Multilabel classifier on french sentences with labels "figuratif" and "concret". You can use it with flair-library:
from flair.models import TextClassifier
from flair.data import Sentence
# Load the classifier model
classifier = TextClassifier.load('paraly_camembert_large_multilabel.pt')
# Define the prediction function
def predict(input_text):
sentence = Sentence(input_text)
classifier.predict(sentence)
# Extract the label and confidence into a dictionary format
labels = {label.value: label.score for label in sentence.labels}
return labels
Results:
- F-score (micro) 0.9349
- F-score (macro) 0.9352
- Accuracy 0.8831
By class:
precision recall f1-score support
figuratif 0.9340 0.9340 0.9340 106
concret 0.9672 0.9077 0.9365 65
micro avg 0.9461 0.9240 0.9349 171
macro avg 0.9506 0.9208 0.9352 171
weighted avg 0.9466 0.9240 0.9349 171
samples avg 0.9578 0.9448 0.9437 171
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support