Downloads · 30 days
10
28% of all-time downloads
Roksana/french_wic_xlmr
french_wic_xlmr is a machine learning model from Roksana. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers.
A Word-in-Context (WiC) encoder trained with contrastive learning on top of FacebookAI/xlm-roberta-large. It embeds a target word in its sentence context: the target span is wrapped in <t … </t markers, and two usages…
Downloads · 30 days
10
28% of all-time downloads
All-time downloads
36
Public
Parameters
560M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.2 GB · 99%
From the Hugging Face model README
A Word-in-Context (WiC) encoder trained with contrastive learning on top of
FacebookAI/xlm-roberta-large. It embeds a target word in its sentence context: the target
span is wrapped in <t> … </t> markers, and two usages are compared by cosine
similarity. A pair is predicted to share a sense when cosine similarity exceeds
the stored threshold.
The default decision threshold is 0.7097 (stored in threshold.json).
# from https://github.com/... (contrastive_encoder_training)
from word_transformer import load_model, predict_pairs
model, threshold_info = load_model("french") # local dir or hub id
pairs = [{
"sentence1": "They walked along the bank of the river.",
"sentence2": "She deposited the check at the bank.",
"start1": 22, "end1": 26, # exclusive end: sentence1[22:26] == "bank"
"start2": 21, "end2": 25,
}]
predictions, cosine_sims = predict_pairs(model, threshold_info["threshold"], pairs)
# predictions[i] == 1 -> same sense, 0 -> different sense
| base model | FacebookAI/xlm-roberta-large |
| language | French |
| paper | Multilinguality Does not Make Sense (EMNLP 2025) |
| threshold | 0.7097 |
| validation accuracy | 0.7831 |
This model uses a custom encode() (target-word embedding), so it is not
a drop-in SentenceTransformer; load it with the word_transformer.py helper
above.