Here's your model card based on the example you provided:
RoBERTa-Base for News Classification (FP16 Quantized)
This is a RoBERTa-Base model fine-tuned on the
AG News dataset
for text classification. It categorizes news articles into one of four classes:
World, Sports, Business, and Science/Technology
. The model has been further
quantized to FP16
for improved inference speed and reduced memory usage, making it efficient for deployment on resource-constrained environments.
from transformers import RobertaForSequenceClassification, RobertaTokenizer
import torch
# Load the model and tokenizer
model_name = "AventIQ-AI/Roberta-Base-News-Classification"# Update with your model ID
tokenizer = RobertaTokenizer.from_pretrained(model_name)
model = RobertaForSequenceClassification.from_pretrained(model_name)
# Move to GPU if available
device = torch.device("cuda"if torch.cuda.is_available() else"cpu")
model.to(device)
# Function to predict categorydefpredict(text):
inputs = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=512).to(device)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()
class_labels = {0: "World", 1: "Sports", 2: "Business", 3: "Science/Technology"}
return class_labels[predicted_class]
# Example usage
custom_text = "Stock prices are rising due to global economic recovery."
predicted_label = predict(custom_text)
print(f"Predicted Category: {predicted_label}")
fp16:
True (for reduced memory footprint and faster inference)
weight_decay:
0.01
optimizer:
AdamW
Model Performance
Metric
Score
Accuracy
94.3%
F1 Score
94.1%
Precision
94.5%
Recall
94.2%
(Update these values based on your actual evaluation results.)
Quantization Details
The model has been quantized to
FP16
to reduce its size and improve inference speed.
FP16 quantization provides a
2x reduction in memory
while maintaining similar accuracy.
Limitations & Considerations
The model is
trained on AG News
and may not generalize well to
other domains
such as medical, legal, or entertainment news.
Due to
FP16 quantization
, there might be a minor loss in precision, but inference speed is significantly improved.
The model is
not intended for real-time misinformation detection
—it only classifies text based on its most probable category.
Runs of AventIQ-AI Roberta-Base-News-Classification on huggingface.co
17
Total runs
0
24-hour runs
8
3-day runs
7
7-day runs
10
30-day runs
More Information About Roberta-Base-News-Classification huggingface.co Model
Roberta-Base-News-Classification huggingface.co
Roberta-Base-News-Classification huggingface.co is an AI model on huggingface.co that provides Roberta-Base-News-Classification's model effect (), which can be used instantly with this AventIQ-AI Roberta-Base-News-Classification model. huggingface.co supports a free trial of the Roberta-Base-News-Classification model, and also provides paid use of the Roberta-Base-News-Classification. Support call Roberta-Base-News-Classification model through api, including Node.js, Python, http.
Roberta-Base-News-Classification huggingface.co is an online trial and call api platform, which integrates Roberta-Base-News-Classification's modeling effects, including api services, and provides a free online trial of Roberta-Base-News-Classification, you can try Roberta-Base-News-Classification online for free by clicking the link below.
AventIQ-AI Roberta-Base-News-Classification online free url in huggingface.co:
Roberta-Base-News-Classification is an open source model from GitHub that offers a free installation service, and any user can find Roberta-Base-News-Classification on GitHub to install. At the same time, huggingface.co provides the effect of Roberta-Base-News-Classification install, users can directly use Roberta-Base-News-Classification installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Roberta-Base-News-Classification install url in huggingface.co: