Instructions to use FiinGroup/phobert-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FiinGroup/phobert-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="FiinGroup/phobert-finetuned")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("FiinGroup/phobert-finetuned") model = AutoModelForSequenceClassification.from_pretrained("FiinGroup/phobert-finetuned", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("FiinGroup/phobert-finetuned")
model = AutoModelForSequenceClassification.from_pretrained("FiinGroup/phobert-finetuned", device_map="auto")Quick Links
FiinGroup-phobert-based for financial news sentiment analysis
This is a PhoBert-base model fine-tuned on ~ 15,000 Vietnamese financial news from Jan 2020 to Dec 2024.
Labels: 0 -> Negative, 1 -> Neutral, 2 -> Positive
Accuracy: 0.903
Example Pipeline
Please don't forget to install transformers library if you have not done it before
!pip install transformers
from transformers import pipeline
model_path = "FiinGroup/phobert-finetuned"
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentence = "Covid cases are increasing fast!"
sentiment_task(sentence)
Output
[{'label': 'LABEL_0', 'score': 0.7535950541496277}]
Author
LeeMinTuan - BI team
- Downloads last month
- 8
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="FiinGroup/phobert-finetuned")