Instructions to use KennethTM/danish-bert-review-sentiment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KennethTM/danish-bert-review-sentiment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KennethTM/danish-bert-review-sentiment")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KennethTM/danish-bert-review-sentiment") model = AutoModelForSequenceClassification.from_pretrained("KennethTM/danish-bert-review-sentiment") - Notebooks
- Google Colab
- Kaggle
What is this?
BERT classification model for short customer reviews written in Danish.
The model uses 5 classes ranging from 1-5 stars:
- ⭐ (very poor)
- ⭐⭐ (poor)
- ⭐⭐⭐ (neutral)
- ⭐⭐⭐⭐ (good)
- ⭐⭐⭐⭐⭐ (very good)
The model is fine-tuned using the pre-trained Danish BERT model.
How to use
Test the model using the 🤗Transformers library pipeline:
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="KennethTM/danish-bert-review-sentiment")
classifier("Intet virkede og ingen hjælp at hente.")
#[{'label': '⭐', 'score': 0.4953940808773041}]
Or load it using the Auto* classes:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("KennethTM/danish-bert-review-sentiment")
tokenizer = AutoTokenizer.from_pretrained("KennethTM/danish-bert-review-sentiment")
- Downloads last month
- 7