Downloads · 30 days
6
12% of all-time downloads
dilexsan/bertweet_base_sentimental_onnx
bertweet_base_sentimental_onnx is a text classification model from dilexsan. Use it when you need a label for a piece of text. It is set up for transformers.
from transformers import pipeline, AutoTokenizer from optimum.onnxruntime import ORTModelForSequenceClassification
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
52
Public
Repo size
540 MB
Likes
0
Public
Click a slice to open those files.
.onnx540 MB · 100%
From the Hugging Face model README
from transformers import pipeline, AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
model_id = "dilexsan/bertweet_base_sentimental_onnx"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForSequenceClassification.from_pretrained(model_id)
sentiment_analyzer = pipeline(
"text-classification",
model=model,
tokenizer=tokenizer
)
text = "I am so happy with this service, it was great!"
result = sentiment_analyzer(text)
print(result)