Instructions to use dilexsan/bertweet_base_sentimental_onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dilexsan/bertweet_base_sentimental_onnx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="dilexsan/bertweet_base_sentimental_onnx")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("dilexsan/bertweet_base_sentimental_onnx") model = AutoModelForSequenceClassification.from_pretrained("dilexsan/bertweet_base_sentimental_onnx") - Notebooks
- Google Colab
- Kaggle
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)
- Downloads last month
- 3