Instructions to use FatouSow/Relex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FatouSow/Relex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="FatouSow/Relex")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("FatouSow/Relex") model = AutoModelForSequenceClassification.from_pretrained("FatouSow/Relex", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model description
Relex is a fine-tuned CamemBERT model trained to classify the relation expressed by a connective in context. Given a connective tagged by the tokens [MARKER] and [/MARKER], Relex predicts the relation of this connective.
Training data: French newspapers and Wikiconflit comments, automatically annotated in connectives
Special tokens: Connectives are wrapped between [MARKER] and [/MARKER] tokens in the training data. These tags signal to the model which word it should focus its attention on for the relation mapping.
Context Window: The special tokens must appear within the first 256 tokens of the input. Because these signals are the anchor for the classification, ensuring they are not truncated is crucial for accurate predictions.
Predictions: Relex predicts among 19 discourse relations (SDRT) .
Example:
Input: [MARKER] Peu avant de [/MARKER] mourir, Mio a promis à son mari qu'elle reviendrait à la saison des pluies.
Prediction: Narration
Usage
You can use this model directly with a Hugging Face pipeline:
from transformers import pipeline
pipe = pipeline("text-classification", model="FatouSow/Relex")
text ="[MARKER] Peu avant de [/MARKER] mourir, Mio a promis à son mari qu'elle reviendrait à la saison des pluies."
result = pipe(text)
print(result)
- Downloads last month
- 4
Model tree for FatouSow/Relex
Base model
almanach/camembert-baseEvaluation results
- Label Namesself-reportedalternation,background,commentary,concession,condition,consequence,continuation,contrast,detachment,evidence,explanation,explanation*,flashback,goal,narration,parallel,result,result*,summary
- macro-F1self-reported0.590
- Accuracyself-reported0.630
- Precisionself-reported0.620
- Recallself-reported0.620