Views
No views yet
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 |
1from transformers import pipeline
2nlp = pipeline(task='text-classification',
3 model='nickwong64/bert-base-uncased-finance-sentiment')
4p1 = "HK stocks open lower after Fed rate comments"
5p2 = "US stocks end lower on earnings worries"
6p3 = "Muted Fed, AI hopes send Wall Street higher"
7print(nlp(p1))
8print(nlp(p2))
9print(nlp(p3))
10"""
11output:
12[{'label': 'negative', 'score': 0.9991507530212402}]
13[{'label': 'negative', 'score': 0.9997240900993347}]
14[{'label': 'neutral', 'score': 0.9834381937980652}]
15"""{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}