agentlans/en-translations-quality-v3
Viewer • Updated • 963k • 18
How to use agentlans/multilingual-e5-small-quality-v3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="agentlans/multilingual-e5-small-quality-v3") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("agentlans/multilingual-e5-small-quality-v3")
model = AutoModelForSequenceClassification.from_pretrained("agentlans/multilingual-e5-small-quality-v3")This model rates the quality of non-English text for AI learning. Input a text string, and it outputs a numeric quality score reflecting overall informativeness and usefulness.
On the evaluation set, it achieved:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "agentlans/multilingual-e5-small-quality-v3"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name).to("cuda" if torch.cuda.is_available() else "cpu")
# Higher scores indicate higher text quality.
# The sign of the score has no particular meaning.
# For example, a negative score doesn't necessarily mean that the text is low quality.
def quality(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True).to(model.device)
with torch.no_grad():
score = model(**inputs).logits.squeeze().cpu().item()
return score
print(quality("Your text here."))
quality-v3 models, this model is only trained on short non-English sentences.The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Mse | Combined Score | Input Tokens Seen |
|---|---|---|---|---|---|---|
| 0.0725 | 1.0 | 108381 | 0.0727 | 0.0727 | 0.0727 | 110981376 |
| 0.0603 | 2.0 | 216762 | 0.0675 | 0.0675 | 0.0675 | 221962752 |
| 0.0559 | 3.0 | 325143 | 0.0703 | 0.0703 | 0.0703 | 332944128 |
| 0.0387 | 4.0 | 433524 | 0.0675 | 0.0675 | 0.0675 | 443925504 |
| 0.0325 | 5.0 | 541905 | 0.0704 | 0.0704 | 0.0704 | 554906880 |
| 0.0276 | 6.0 | 650286 | 0.0672 | 0.0672 | 0.0672 | 665888256 |
| 0.025 | 7.0 | 758667 | 0.0641 | 0.0641 | 0.0641 | 776869632 |
| 0.0182 | 8.0 | 867048 | 0.0676 | 0.0676 | 0.0676 | 887851008 |
| 0.0154 | 9.0 | 975429 | 0.0647 | 0.0647 | 0.0647 | 998832384 |
| 0.0133 | 10.0 | 1083810 | 0.0643 | 0.0643 | 0.0643 | 1109813760 |
Base model
intfloat/multilingual-e5-small