Downloads · 30 days
10
0% of all-time downloads
nickwong64/bert-base-uncased-finance-sentiment
bert-base-uncased-finance-sentiment is a text classification model from nickwong64. 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.
Bert is a Transformer Bidirectional Encoder based Architecture trained on MLM(Mask Language Modeling) objective. bert-base-uncased finetuned on the cyrilzhang/financialphrasebanksplit dataset using HuggingFace Trainer…
Downloads · 30 days
10
0% of all-time downloads
All-time downloads
3.8K
Public
Repo size
876 MB
Likes
1
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
Bert is a Transformer Bidirectional Encoder based Architecture trained on MLM(Mask Language Modeling) objective. bert-base-uncased finetuned on the cyrilzhang/financial_phrasebank_split dataset using HuggingFace Trainer with below training parameters.
learning rate 2e-5,
batch size 8,
num_train_epochs=6,
| Epoch | Training Loss | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|
| 6 | 0.034100 | 0.954745 | 0.853608 | 0.854358 |
from transformers import pipeline
nlp = pipeline(task='text-classification',
model='nickwong64/bert-base-uncased-finance-sentiment')
p1 = "HK stocks open lower after Fed rate comments"
p2 = "US stocks end lower on earnings worries"
p3 = "Muted Fed, AI hopes send Wall Street higher"
print(nlp(p1))
print(nlp(p2))
print(nlp(p3))
"""
output:
[{'label': 'negative', 'score': 0.9991507530212402}]
[{'label': 'negative', 'score': 0.9997240900993347}]
[{'label': 'neutral', 'score': 0.9834381937980652}]
"""
cyrilzhang/financial_phrasebank_split
{0: 'negative', 1: 'neutral', 2: 'positive'}
{'test_loss': 0.9547446370124817,
'test_accuracy': 0.8536082474226804,
'test_f1': 0.8543579048224414,
'test_runtime': 4.9865,
'test_samples_per_second': 97.263,
'test_steps_per_second': 12.233}