CoolFace
Modelpublic

DanielSc4/xlmr-large-classifier-around_the_world_in_eighty_days_fr_tra1-eng

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes5downloads
Model Card

xlmr-large-classifier-aroundtheworldineightydaysfr_tra1-eng - MT/HT Classifier

This model is a fine-tuned version of `FacebookAI/xlm-roberta-large` for distinguishing between Machine Translated (MT) and Human Translated (HT) text (or HT1 and HT2 if using two different human translators).

Training data:

  • —Train: 1658, for each label: 829
  • —Validation: 184, for each label: 92
  • —Test: 240, for each label: 120

Results on the held-out test set:

  • —Accuracy: 0.9083
  • —F1-Score: 0.9120
  • —Precision: 0.8769
  • —Recall: 0.9500

label mapping

Label MT: 0

Label PE: 1 (this is the human translator)

Info

Upload date: 2025-04-30 00:00

Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("DanielSc4/xlmr-large-classifier-around_the_world_in_eighty_days_fr_tra1-eng")
model = AutoModelForSequenceClassification.from_pretrained("DanielSc4/xlmr-large-classifier-around_the_world_in_eighty_days_fr_tra1-eng")

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
inp = tokenizer('This is a test', return_tensors='pt').to(device)
model = model.to(device)

out = model(**inp)

logits = out.logits
probs = logits.softmax(dim=-1)
pred = probs.argmax(dim=-1).item()
print("Predicted class: " + str(pred)) # 0 for MT, 1 for PE