Downloads · 30 days
167
4% of all-time downloads
ericsonwillians/distilbert-base-uncased-steam-sentiment
distilbert-base-uncased-steam-sentiment is a text classification model from ericsonwillians. 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.
This repository provides a DistilBERT-based model fine-tuned on a dataset of Steam reviews to classify reviews as Positive or Negative. It is efficient and fast, making it ideal for large-scale or real-time applications.
Downloads · 30 days
167
4% of all-time downloads
All-time downloads
4K
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
---
language: en
license: mit
datasets:
- steam_reviews
tags:
- sentiment-analysis
- text-classification
- transformers
- distilbert
- pytorch
metrics:
- accuracy
widget:
- text: "This game blew my mind! Loved every minute."
library_name: transformers
pipeline_tag: text-classification
model_name: distilbert-base-uncased-steam-sentiment
---
This repository provides a DistilBERT-based model fine-tuned on a dataset of Steam reviews to classify reviews as Positive or Negative. It is efficient and fast, making it ideal for large-scale or real-time applications.
This model is specifically trained on Steam reviews, where language can be raw and sometimes offensive. It may also work on other short text snippets like movie reviews, but please note that performance might degrade outside the gaming domain.
pip.Install with Poetry:
poetry install
poetry shell
If using pip:
pip install torch transformers rich
After placing the model and tokenizer files in the repository root, you should have:
config.jsonmodel.safetensors (or pytorch_model.bin if you used that format)special_tokens_map.jsontokenizer_config.jsontokenizer.jsonvocab.txttraining_args.bin (optional, stores training parameters)README.md (this file)We provide an inference.py script that:
Usage:
python inference.py
Example Output:
Steam Review Sentiment Inference
Welcome!
This tool uses a fine-tuned DistilBERT model to predict whether a given Steam review is *Positive* or *Negative*.
Please enter the Steam review text (This game is amazing!): This game is boring and repetitive
Loading model and tokenizer...
Running inference...
Inference Result
Predicted Sentiment: Negative
Sentiment Probabilities:
Positive: 0.1234
Negative: 0.8766
If you want to run inference programmatically (without the script):
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "./" # assuming model files are in current directory
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
review_text = "I absolutely loved this game!"
inputs = tokenizer(review_text, return_tensors="pt", truncation=True, padding="max_length", max_length=128)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)
predicted_class = torch.argmax(probs, dim=1).item()
sentiment = "Positive" if predicted_class == 1 else "Negative"
print(sentiment, probs.tolist())
This project is released under the MIT License.
If you have suggestions, want to contribute, or encounter issues, feel free to open a discussion or contact Ericson Willians ([email protected]). Your feedback is appreciated!
With this setup, you can easily integrate this sentiment analysis model into your pipelines, dashboards, or research projects. Enjoy exploring the sentiment of Steam reviews!