Downloads · 30 days
9
14% of all-time downloads
guntaksa/AG-News-distilbert1
AG-News-distilbert1 is a text classification model from guntaksa. Use it when you need a label for a piece of text. It is set up for transformers.
<This model is a fine-tuned version ofdistilbert-base-uncased on the AG News dataset for 4-class topic text classification. It was tracked via Weights & Biases (W&B) as part of an MLOps assignment
Downloads · 30 days
9
14% of all-time downloads
All-time downloads
66
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
<This model is a fine-tuned version ofdistilbert-base-uncased on the AG News dataset for 4-class topic text classification.
It was tracked via Weights & Biases (W&B) as part of an MLOps assignment>
This model is a lightweight text classifier built by fine-tuning DistilBERT. It maps input articles or paragraphs to one of four designated news categories: World, Sports, Business, or Sci/Tech.
This model is intended to be used directly for classifying short-to-medium length English text fragments into one of four specific categories:
[More Information Needed]
The model will not perform optimally on languages other than English or text tasks outside the predefined AG News categories (e.g., sentiment analysis, generation, or fine-grained entities).
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model. from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch
id2label = {"0": "World", "1": "Sports", "2": "Business", "3": "Sci/Tech"}
model_name = "your-hf-username/your-model-id" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "The team won the championship match in extra innings." inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
with torch.no_grad(): logits = model(**inputs).logits predicted_class_id = logits.argmax().item()
print("Predicted Category:", id2label[str(predicted_class_id)])
[More Information Needed]
The model was trained using the dataset repository Recurrent/prepared_data_mlops2.
Train Examples: 120,000 rows
Test (Validation) Examples: 7,600 rows
Preprocessing: Inputs were tokenized and clipped to a maximum sequence length of 128 tokens. [More Information Needed]
Hyperparameters The following configuration details apply to the primary model run (run-v1):
Learning Rate: 2e-5
Train Batch Size: 16
Eval Batch Size: 32
Epochs: 3
Weight Decay: 0.01
Evaluation Strategy: Evaluated at the end of every epoch
Best Model Selection: Loaded best model weights at the end based on the highest F1 score.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Evaluation performed on the independent evaluation split yielded the following final metrics:
Final Accuracy: 93.99%
Final F1 Score: 0.9399
Final Evaluation Loss: 0.4236 [More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]