Text Classification
Transformers
Safetensors
French
camembert
discourse relation
discourse connective
nlp
Eval Results (legacy)
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
Upload README.md
Browse files
README.md
CHANGED
|
@@ -52,4 +52,35 @@ model-index:
|
|
| 52 |
type: recall
|
| 53 |
value: 0.62
|
| 54 |
|
| 55 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
type: recall
|
| 53 |
value: 0.62
|
| 54 |
|
| 55 |
+
---
|
| 56 |
+
# Model description
|
| 57 |
+
|
| 58 |
+
*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.
|
| 59 |
+
|
| 60 |
+
- *Training data*: French newspapers and Wikiconflit comments, automatically annotated in connectives
|
| 61 |
+
|
| 62 |
+
- *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.
|
| 63 |
+
|
| 64 |
+
- *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.
|
| 65 |
+
|
| 66 |
+
- *Predictions*: Relex predicts among 19 discourse relations (SDRT) .
|
| 67 |
+
|
| 68 |
+
- *Example*:
|
| 69 |
+
- *Input*: [MARKER] Peu avant de [/MARKER] mourir, Mio a promis à son mari qu'elle reviendrait à la saison des pluies.
|
| 70 |
+
- *Prediction*: Narration
|
| 71 |
+
|
| 72 |
+
# Usage
|
| 73 |
+
|
| 74 |
+
You can use this model directly with a Hugging Face pipeline:
|
| 75 |
+
|
| 76 |
+
```python
|
| 77 |
+
from transformers import pipeline
|
| 78 |
+
|
| 79 |
+
pipe = pipeline("text-classification", model="FatouSow/Relex")
|
| 80 |
+
|
| 81 |
+
text ="[MARKER] Peu avant de [/MARKER] mourir, Mio a promis à son mari qu'elle reviendrait à la saison des pluies."
|
| 82 |
+
|
| 83 |
+
result = pipe(text)
|
| 84 |
+
print(result)
|
| 85 |
+
```
|
| 86 |
+
|