CoolFace
Modelpublic

agentlans/multilingual-e5-small-quality-v3

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes8downloads
Model Card

Multilingual Text Quality Model

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.

Performance

On the evaluation set, it achieved:

  • Loss: 0.0641
  • MSE: 0.0641
  • Combined Score: 0.0641
  • Tokens processed during training: 1,109,813,760

Usage Example

python
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."))

Limitations

  • Works best on non-fiction and general-purpose texts.
  • Scores give an overall quality estimate but don’t explain why.
  • Unlike the other quality-v3 models, this model is only trained on short non-English sentences.
  • Check for biases and suitability before use.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • trainbatchsize: 8
  • evalbatchsize: 8
  • seed: 42
  • optimizer: Use adamwtorch with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • lrschedulertype: linear
  • num_epochs: 10.0

Training results

Training LossEpochStepValidation LossMseCombined ScoreInput Tokens Seen
0.07251.01083810.07270.07270.0727110981376
0.06032.02167620.06750.06750.0675221962752
0.05593.03251430.07030.07030.0703332944128
0.03874.04335240.06750.06750.0675443925504
0.03255.05419050.07040.07040.0704554906880
0.02766.06502860.06720.06720.0672665888256
0.0257.07586670.06410.06410.0641776869632
0.01828.08670480.06760.06760.0676887851008
0.01549.09754290.06470.06470.0647998832384
0.013310.010838100.06430.06430.06431109813760

Framework versions

  • Transformers 4.51.3
  • Pytorch 2.6.0+cu124
  • Datasets 3.2.0
  • Tokenizers 0.21.0