Downloads · 30 days
18
5% of all-time downloads
chillies/distilbert-course-review-classification
distilbert-course-review-classification is a text classification model from chillies. Use it when you need a label for a piece of text. It is set up for transformers.
[](https://huggingface.co/username/distilbert-course-review-classification)
Downloads · 30 days
18
5% of all-time downloads
All-time downloads
340
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
distilbert-course-review-classification is a fine-tuned version of DistilBERT, specifically trained for sentiment analysis of online course reviews. This model categorizes reviews into the following classes:
To use this model, you will need to install the following dependencies:
pip install transformers
pip install torch # or tensorflow depending on your preference
Here is how you can load and use the model in your code:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("username/distilbert-course-review-classification")
model = AutoModelForSequenceClassification.from_pretrained("username/distilbert-course-review-classification")
# Example usage
review = "The course content is great, but I would like more examples."
inputs = tokenizer(review, return_tensors="pt", padding=True, truncation=True)
outputs = model(**inputs)
# Assuming the model outputs logits
predicted_class = outputs.logits.argmax(dim=-1).item()
class_labels = [
'Improvement Suggestions', 'Questions', 'Confusion', 'Support Request',
'Discussion', 'Course Comparison', 'Related Course Suggestions',
'Negative', 'Positive'
]
print(f"Predicted class: {class_labels[predicted_class]}")
Provide example code for performing inference with your model:
# Example inference
review = "I found the course material very confusing and hard to follow."
inputs = tokenizer(review, return_tensors="pt", padding=True, truncation=True)
outputs = model(**inputs)
# Assuming the model outputs logits
predicted_class = outputs.logits.argmax(dim=-1).item()
class_labels = [
'Improvement Suggestions', 'Questions', 'Confusion', 'Support Request',
'Discussion', 'Course Comparison', 'Related Course Suggestions',
'Negative', 'Positive'
]
print(f"Predicted class: {class_labels[predicted_class]}")
If your model can be trained further, provide instructions for training:
# Example training code
from transformers import Trainer, TrainingArguments
training_args = TrainingArguments(
output_dir="./results",
evaluation_strategy="epoch",
per_device_train_batch_size=8,
per_device_eval_batch_size=8,
num_train_epochs=3,
weight_decay=0.01,
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
)
trainer.train()
The model was fine-tuned on a dataset of online course reviews, labeled with the following sentiment categories:
The model was fine-tuned using a standard training approach, optimizing for accurate sentiment classification. Training was conducted on [describe hardware, e.g., GPUs, TPUs] over [number of epochs] epochs with [any relevant hyperparameters].
The model was evaluated using the following metrics:
The performance of distilbert-course-review-classification was benchmarked against other sentiment analysis models, demonstrating superior accuracy and relevance in classifying online course reviews.
While distilbert-course-review-classification is highly effective, it may have limitations in the following areas:
We welcome contributions! Please see our contributing guidelines for more information on how to contribute to this project.
This model is licensed under the MIT License.
We would like to thank the contributors and the creators of the datasets used for training this model.
### Tips for Completing the Template
1. **Replace placeholders** (like `username`, `training data`, `evaluation metrics`) with your actual data.
2. **Include any additional information** specific to your model or training process.
3. **Keep the document updated** as the model evolves or more information becomes available.