|
--- |
|
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 |