File size: 3,787 Bytes
bb28cd1
 
fe33920
 
01296cd
 
 
fe33920
 
 
 
 
01296cd
 
60390b1
1a79ebf
01296cd
e5f4de8
1a79ebf
01296cd
e5f4de8
1a79ebf
01296cd
b6c0f8f
1a79ebf
fe33920
01296cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb28cd1
fe33920
 
 
 
 
 
01296cd
fe33920
1cda6e9
 
 
 
 
fe33920
01296cd
fe33920
01296cd
fe33920
01296cd
 
 
 
fe33920
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cda6e9
 
 
 
 
 
 
fe33920
 
01296cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe33920
 
1cda6e9
fe33920
1cda6e9
1a79ebf
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
license: mit
base_model: roberta-base
tags:
  - stress
  - classification
  - glassdoor
metrics:
- accuracy
- f1
- precision
- recall
widget:
  - text: >-
      They also caused so much stress because some leaders valued optics over output.
    example_title: Stressed 1 Example
  - text: >-
      Way too much work pressure.
    example_title: Stressed 2 Example
  - text: >-
      Understaffed, lots of deck revisions, unpredictable, terrible technology.
    example_title: Stressed 3 Example
  - text: >-
      Nice environment good work life balance.
    example_title: Not Stressed 1 Example
model-index:
- name: roberta-base_topic_classification_nyt_news
  results:
    - task:
          name: Text Classification
          type: text-classification
      dataset:
          name: New_York_Times_Topics
          type: News
      metrics:
          - type: F1
            name: F1
            value: 0.97
          - type: accuracy
            name: accuracy
            value: 0.97
          - type: precision
            name: precision
            value: 0.97
          - type: recall
            name: recall
            value: 0.97
pipeline_tag: text-classification
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# roberta-base_stress_classification

This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on the glassdoor dataset based on 100000 employees' reviews.
It achieves the following results on the evaluation set:
- Loss: 0.1800
- Accuracy: 0.9647
- F1: 0.9647
- Precision: 0.9647
- Recall: 0.9647

## Training data

Training data was classified as follow:

class |Description
-|-
0 |Not Stressed
1 |Stressed

## Training procedure

### Training hyperparameters

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

### Training results

| Training Loss | Epoch | Step  | Validation Loss | Accuracy | F1     | Precision | Recall |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|:------:|:---------:|:------:|
| 0.704         | 1.0   | 8000  | 0.6933          | 0.5      | 0.3333 | 0.25      | 0.5    |
| 0.6926        | 2.0   | 16000 | 0.6980          | 0.5      | 0.3333 | 0.25      | 0.5    |
| 0.0099        | 3.0   | 24000 | 0.1800          | 0.9647   | 0.9647 | 0.9647    | 0.9647 |
| 0.2727        | 4.0   | 32000 | 0.2243          | 0.9526   | 0.9526 | 0.9527    | 0.9526 |
| 0.0618        | 5.0   | 40000 | 0.2128          | 0.9536   | 0.9536 | 0.9546    | 0.9536 |


### Model performance

-|precision|recall|f1|support
-|-|-|-|-
Not Stressed|0.96|0.97|0.97|10000
Stressed|0.97|0.96|0.97|10000
 | | | |
accuracy|||0.97|20000
macro avg|0.97|0.97|0.97|20000
weighted avg|0.97|0.97|0.97|20000


### How to use roberta-base_topic_classification_nyt_news with HuggingFace

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("dstefa/roberta-base_topic_classification_nyt_news")
model = AutoModelForSequenceClassification.from_pretrained("dstefa/roberta-base_topic_classification_nyt_news")
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)

text = "They also caused so much stress because some leaders valued optics over output."
pipe(text)

[{'label': 'Stressed', 'score': 0.9959163069725037}]

### Framework versions

- Transformers 4.32.1
- Pytorch 2.1.0+cu121
- Datasets 2.12.0
- Tokenizers 0.13.2