File size: 3,865 Bytes
7d73d6c
 
 
 
 
 
e14882c
 
 
7d73d6c
 
 
e14882c
 
 
7d73d6c
 
 
 
e14882c
7d73d6c
 
 
31cdea6
 
 
 
 
 
 
 
 
 
 
 
7d73d6c
 
 
e14882c
 
 
7d73d6c
 
 
e14882c
7d73d6c
 
 
e14882c
7d73d6c
e992833
 
 
 
 
 
 
 
7d73d6c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31cdea6
7d73d6c
 
 
 
 
 
 
 
 
 
 
 
e14882c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
license: apache-2.0
tags:
- generated_from_trainer
metrics:
- accuracy
- f1
- recall
- precision
model-index:
- name: mega-base-wikitext-News_About_Gold
  results: []
language:
- en
pipeline_tag: text-classification
---

# mega-base-wikitext-News_About_Gold

This model is a fine-tuned version of [mnaylor/mega-base-wikitext](https://huggingface.co/mnaylor/mega-base-wikitext).
It achieves the following results on the evaluation set:
- Loss: 1.0031
- Accuracy: 0.5014
- F1
  - Weighted: 0.4023
  - Micro: 0.5014
  - Macro: 0.3282
- Recall
  - Weighted: 0.5014
  - Micro: 0.5014
  - Macro: 0.3835
- Precision
  - Weighted: 0.5783
  - Micro: 0.5014
  - Macro: 0.4548

## Model description

For more information on how it was created, check out the following link: https://github.com/DunnBC22/NLP_Projects/blob/main/Sentiment%20Analysis/Sentiment%20Analysis%20of%20Commodity%20News%20-%20Gold%20(Transformer%20Comparison)/News%20About%20Gold%20-%20Sentiment%20Analysis%20-%20MEGA%20with%20W%26B.ipynb

This project is part of a comparison of seven (7) transformers. Here is the README page for the comparison: https://github.com/DunnBC22/NLP_Projects/tree/main/Sentiment%20Analysis/Sentiment%20Analysis%20of%20Commodity%20News%20-%20Gold%20(Transformer%20Comparison)

## Intended uses & limitations

This model is intended to demonstrate my ability to solve a complex problem using technology.

## Training and evaluation data

Dataset Source: https://www.kaggle.com/datasets/ankurzing/sentiment-analysis-in-commodity-market-gold

_Input Word Length:_

![Length of Input Text (in Words)](https://github.com/DunnBC22/NLP_Projects/raw/main/Sentiment%20Analysis/Sentiment%20Analysis%20of%20Commodity%20News%20-%20Gold%20(Transformer%20Comparison)/Images/Input%20Word%20Length.png)

_Class Distribution:_

![Length of Input Text (in Words)](https://github.com/DunnBC22/NLP_Projects/raw/main/Sentiment%20Analysis/Sentiment%20Analysis%20of%20Commodity%20News%20-%20Gold%20(Transformer%20Comparison)/Images/Class%20Distribution.png)

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 5

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy | Weighted F1 | Micro F1 | Macro F1 | Weighted Recall | Micro Recall | Macro Recall | Weighted Precision | Micro Precision | Macro Precision |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:-----------:|:--------:|:--------:|:---------------:|:------------:|:------------:|:------------------:|:---------------:|:---------------:|
| 1.2255        | 1.0   | 133  | 1.1365          | 0.4134   | 0.2437      | 0.4134   | 0.1487   | 0.4134          | 0.4134       | 0.2507       | 0.2652             | 0.4134          | 0.2285          |
| 1.1337        | 2.0   | 266  | 1.0851          | 0.4532   | 0.3257      | 0.4532   | 0.2539   | 0.4532          | 0.4532       | 0.3161       | 0.3015             | 0.4532          | 0.2705          |
| 1.0847        | 3.0   | 399  | 1.0384          | 0.4759   | 0.3591      | 0.4759   | 0.2915   | 0.4759          | 0.4759       | 0.3520       | 0.6352             | 0.4759          | 0.4942          |
| 1.05          | 4.0   | 532  | 1.0112          | 0.4962   | 0.3917      | 0.4962   | 0.3206   | 0.4962          | 0.4962       | 0.3783       | 0.5846             | 0.4962          | 0.4596          |
| 1.0309        | 5.0   | 665  | 1.0031          | 0.5014   | 0.4023      | 0.5014   | 0.3282   | 0.5014          | 0.5014       | 0.3835       | 0.5783             | 0.5014          | 0.4548          |

### Framework versions

- Transformers 4.28.1
- Pytorch 2.0.0
- Datasets 2.11.0
- Tokenizers 0.13.3