Downloads · 30 days
13
3% of all-time downloads
agentlans/deberta-v3-xsmall-quality
deberta-v3-xsmall-quality is a text classification model from agentlans. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
The deberta-v3-xsmall-quality model is designed to evaluate text quality by using a composite score that combines the results from multiple classifiers. This method provides a more thorough assessment than traditional…
Downloads · 30 days
13
3% of all-time downloads
All-time downloads
423
Public
Parameters
70.8M
569 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors283 MB · 96%
From the Hugging Face model README
The deberta-v3-xsmall-quality model is designed to evaluate text quality by using a composite score that combines the results from multiple classifiers. This method provides a more thorough assessment than traditional educational metrics, making it ideal for a variety of NLP and AI applications.
Intended Uses:
Limitations:
The model was trained on the agentlans/text-quality dataset comprising 100,000 sentences sourced from five distinct datasets, with 20,000 sentences drawn from each of the following:
This diverse dataset enables the model to generalize well across different text types and domains.
90% of the rows were used for training and the remaining 10% for evaluation.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name="agentlans/deberta-v3-xsmall-quality"
# Put model on GPU or else CPU
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)
def quality(text):
"""Processes the text using the model and returns its logits.
In this case, it's interpreted as the the combined quality score for that text."""
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True).to(device)
with torch.no_grad():
logits = model(**inputs).logits.squeeze().cpu()
return logits.tolist()
# Example usage
text = [
"Congratulations! You've won a $1,000 gift card! Click here to claim your prize now!!!",
"Page 1 2 3 4 5 Next Last>>",
"Urgent: Your account has been compromised! Click this link to verify your identity and secure your account immediately!!!",
"Today marks a significant milestone in our journey towards sustainability! 🌍✨ We’re excited to announce our partnership with local organizations to plant 10,000 trees in our community this fall. Join us in making a positive impact on our environment!",
"In recent years, the impact of climate change has become increasingly evident, affecting ecosystems and human livelihoods across the globe."]
result = quality(text)
[round(x, 2) for x in result] # Estimated quality for each text [-0.89, -0.76, -0.7, 0.3, 1.64]
The following hyperparameters were utilized during training:
The model was developed using the following frameworks and libraries: