Downloads · 30 days
34.4K
5% of all-time downloads
yiyanghkust/finbert-tone-chinese
finbert-tone-chinese is a text classification model from yiyanghkust. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This is a fine-tuned version of FinBERT, based on bert-base-chinese, on a private dataset (around ~8k analyst report sentences) for sentiment analysis.
Downloads · 30 days
34.4K
5% of all-time downloads
All-time downloads
652K
Public
Parameters
102M
409 MB on disk
Likes
64
Public
Click a slice to open those files.
.safetensors409 MB · 100%
From the Hugging Face model README
This is a fine-tuned version of FinBERT, based on bert-base-chinese, on a private dataset (around ~8k analyst report sentences) for sentiment analysis.
from transformers import TextClassificationPipeline
from transformers import AutoModelForSequenceClassification, TrainingArguments, Trainer
from transformers import BertTokenizerFast
model_path="./fin_sentiment_bert_zh/"
new_model = AutoModelForSequenceClassification.from_pretrained(model_path,output_attentions=True)
tokenizer = BertTokenizerFast.from_pretrained(model_path)
PipelineInterface = TextClassificationPipeline(model=new_model, tokenizer=tokenizer, return_all_scores=True)
label = PipelineInterface("此外宁德时代上半年实现出口约2GWh,同比增加200%+。")
print(label)
[[{'label': 'LABEL_0', 'score': 0.0007030126871541142}, {'label': 'LABEL_1', 'score': 0.9989339709281921}, {'label': 'LABEL_2', 'score': 0.000363016442861408}]]