Downloads · 30 days
25.5K
4% of all-time downloads
Voicelab/herbert-base-cased-sentiment
herbert-base-cased-sentiment is a text classification model from Voicelab. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-4.0.
<img src="https://public.3.basecamp.com/p/rs5XqmAuF1iEuW6U7nMHcZeY/upload/download/VL-NLP-short.png" alt="logo voicelab nlp" style="width:300px;"/
Downloads · 30 days
25.5K
4% of all-time downloads
All-time downloads
654K
Public
Parameters
124M
996 MB on disk
Likes
8
Public
Click a slice to open those files.
.bin498 MB · 50%
How the weights are stored.
F32124M · 100%
From the Hugging Face model README
import numpy as np
from transformers import AutoTokenizer, AutoModelForSequenceClassification
id2label = {0: "negative", 1: "neutral", 2: "positive"}
tokenizer = AutoTokenizer.from_pretrained("Voicelab/herbert-base-cased-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("Voicelab/herbert-base-cased-sentiment")
input = ["Ale fajnie, spadł dzisiaj śnieg! Ulepimy dziś bałwana?"]
encoding = tokenizer(
input,
add_special_tokens=True,
return_token_type_ids=True,
truncation=True,
padding='max_length',
return_attention_mask=True,
return_tensors='pt',
)
output = model(**encoding).logits.to("cpu").detach().numpy()
prediction = id2label[np.argmax(output)]
print(input, "--->", prediction)
Predicted output:
['Ale fajnie, spadł dzisiaj śnieg! Ulepimy dziś bałwana?'] ---> positive