File size: 924 Bytes
16789e1
 
5a80436
 
bb24d2f
 
 
cb59bdc
 
 
 
 
f927b15
cb59bdc
 
 
 
 
bb24d2f
16789e1
5a80436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
datasets:
- imdb
widget:
- text: "I like this movie. That sounds so good!"
  example_title: "Positive"
  output:
    - label: "Positive"
      score: 0.99
    - label: "Negative"
      score: 0.01
- text: "I don't like this. It smells disgusting."
  output:
    - label: "Positive"
      score: 0.02
    - label: "Negative"
      score: 0.98
  example_title: "Negative"
---
对bert-base-uncased模型进行微调的情感分析,数据集采用IMDB。

具体参数如下:
```python
training_args = TrainingArguments(
    output_dir='./results/trainer',
    num_train_epochs=3,
    per_device_train_batch_size=8,
    per_device_eval_batch_size=8,
    warmup_steps=500,
    weight_decay=0.01,
    logging_dir='./logs',
    logging_steps=10,
    load_best_model_at_end=True,
    save_strategy='epoch',
    evaluation_strategy='epoch'
)
```

代码仓库:https://github.com/zengchen233/sentiment-classfier