christian-phu
commited on
Commit
•
ed2df6c
1
Parent(s):
b23eed7
First commit
Browse files- README.md +48 -0
- config.json +35 -0
- optimizer.pt +3 -0
- pytorch_model.bin +3 -0
- rng_state.pth +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +7 -0
- tokenizer_config.json +21 -0
- trainer_state.json +118 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
tags:
|
4 |
+
- generated_from_trainer
|
5 |
+
model-index:
|
6 |
+
- name: bert-finetuned-japanese-sentiment
|
7 |
+
results: []
|
8 |
+
---
|
9 |
+
|
10 |
+
# bert-finetuned-japanese-sentiment
|
11 |
+
|
12 |
+
This model is a fine-tuned version of [cl-tohoku/bert-base-japanese-v2](https://huggingface.co/cl-tohoku/bert-base-japanese-v2) on product amazon reviews japanese dataset.
|
13 |
+
|
14 |
+
## Model description
|
15 |
+
|
16 |
+
Model Train for amazon reviews Japanese sentence sentiments.
|
17 |
+
|
18 |
+
Sentiment analysis is a common task in natural language processing. It consists of classifying the polarity of a given text at the sentence or document level. For instance, the sentence "The food is good" has a positive sentiment, while the sentence "The food is bad" has a negative sentiment.
|
19 |
+
|
20 |
+
In this model, we fine-tuned a BERT model on a Japanese sentiment analysis dataset. The dataset contains 20,000 sentences extracted from Amazon reviews. Each sentence is labeled as positive, neutral, or negative. The model was trained for 5 epochs with a batch size of 16.
|
21 |
+
|
22 |
+
## Training and evaluation data
|
23 |
+
|
24 |
+
- Epochs: 6
|
25 |
+
- Training Loss: 0.087600
|
26 |
+
- Validation Loss: 1.028876
|
27 |
+
- Accuracy: 0.813202
|
28 |
+
- Precision: 0.712440
|
29 |
+
- Recall: 0.756031
|
30 |
+
- F1: 0.728455
|
31 |
+
|
32 |
+
### Training hyperparameters
|
33 |
+
|
34 |
+
The following hyperparameters were used during training:
|
35 |
+
|
36 |
+
- learning_rate: 2e-05
|
37 |
+
- train_batch_size: 16
|
38 |
+
- eval_batch_size: 16
|
39 |
+
- seed: 0
|
40 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
41 |
+
- lr_scheduler_type: linear
|
42 |
+
- num_epochs: 6
|
43 |
+
|
44 |
+
### Framework versions
|
45 |
+
|
46 |
+
- Transformers 4.27.4
|
47 |
+
- Pytorch 2.0.0+cu118
|
48 |
+
- Tokenizers 0.13.2
|
config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "./bert-finetuned-japanese-sentiment/checkpoint-4404",
|
3 |
+
"architectures": ["BertForSequenceClassification"],
|
4 |
+
"attention_probs_dropout_prob": 0.1,
|
5 |
+
"classifier_dropout": null,
|
6 |
+
"hidden_act": "gelu",
|
7 |
+
"hidden_dropout_prob": 0.1,
|
8 |
+
"hidden_size": 768,
|
9 |
+
"id2label": {
|
10 |
+
"0": "negative",
|
11 |
+
"1": "neutral",
|
12 |
+
"2": "positive"
|
13 |
+
},
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 3072,
|
16 |
+
"label2id": {
|
17 |
+
"negative": 0,
|
18 |
+
"neutral": 1,
|
19 |
+
"positive": 2
|
20 |
+
},
|
21 |
+
"layer_norm_eps": 1e-12,
|
22 |
+
"max_position_embeddings": 512,
|
23 |
+
"model_type": "bert",
|
24 |
+
"num_attention_heads": 12,
|
25 |
+
"num_hidden_layers": 12,
|
26 |
+
"pad_token_id": 0,
|
27 |
+
"position_embedding_type": "absolute",
|
28 |
+
"problem_type": "single_label_classification",
|
29 |
+
"tokenizer_class": "BertJapaneseTokenizer",
|
30 |
+
"torch_dtype": "float32",
|
31 |
+
"transformers_version": "4.27.4",
|
32 |
+
"type_vocab_size": 2,
|
33 |
+
"use_cache": true,
|
34 |
+
"vocab_size": 32768
|
35 |
+
}
|
optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf042046750453f140b5317bf6cb23075a07921517ac501e811b48a48dacc816
|
3 |
+
size 889793669
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fad0b66493a21d1441c1787401e5a9e7a79c72146b74fbf08b3f545bbc4c9e5f
|
3 |
+
size 444910709
|
rng_state.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e69b56de0287f4d88be75fca668f1b029d445f3b42118020e7d9ee96ec2378a
|
3 |
+
size 14511
|
scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b3c322d2567b6c72aeeb0cb69573b15e2f3f59cbef5d004b969261a3432d18cb
|
3 |
+
size 627
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer_config.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"do_lower_case": false,
|
4 |
+
"do_subword_tokenize": true,
|
5 |
+
"do_word_tokenize": true,
|
6 |
+
"jumanpp_kwargs": null,
|
7 |
+
"mask_token": "[MASK]",
|
8 |
+
"mecab_kwargs": {
|
9 |
+
"mecab_dic": "unidic_lite"
|
10 |
+
},
|
11 |
+
"model_max_length": 1000000000000000019884624838656,
|
12 |
+
"never_split": null,
|
13 |
+
"pad_token": "[PAD]",
|
14 |
+
"sep_token": "[SEP]",
|
15 |
+
"special_tokens_map_file": null,
|
16 |
+
"subword_tokenizer_type": "wordpiece",
|
17 |
+
"sudachi_kwargs": null,
|
18 |
+
"tokenizer_class": "BertJapaneseTokenizer",
|
19 |
+
"unk_token": "[UNK]",
|
20 |
+
"word_tokenizer_type": "mecab"
|
21 |
+
}
|
trainer_state.json
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": 0.5450584888458252,
|
3 |
+
"best_model_checkpoint": "bert-finetuned-japanese-sentiment/checkpoint-474",
|
4 |
+
"epoch": 6.0,
|
5 |
+
"global_step": 2844,
|
6 |
+
"is_hyper_param_search": false,
|
7 |
+
"is_local_process_zero": true,
|
8 |
+
"is_world_process_zero": true,
|
9 |
+
"log_history": [
|
10 |
+
{
|
11 |
+
"epoch": 1.0,
|
12 |
+
"eval_accuracy": 0.8157940210817349,
|
13 |
+
"eval_f1": 0.7272032479349645,
|
14 |
+
"eval_loss": 0.5450584888458252,
|
15 |
+
"eval_precision": 0.7101173006557553,
|
16 |
+
"eval_recall": 0.7530568561281469,
|
17 |
+
"eval_runtime": 84.5162,
|
18 |
+
"eval_samples_per_second": 68.472,
|
19 |
+
"eval_steps_per_second": 2.142,
|
20 |
+
"step": 474
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"epoch": 1.05,
|
24 |
+
"learning_rate": 1.789029535864979e-05,
|
25 |
+
"loss": 0.3251,
|
26 |
+
"step": 500
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"epoch": 2.0,
|
30 |
+
"eval_accuracy": 0.8261620874373596,
|
31 |
+
"eval_f1": 0.7413523368662124,
|
32 |
+
"eval_loss": 0.5779568552970886,
|
33 |
+
"eval_precision": 0.7270594811474224,
|
34 |
+
"eval_recall": 0.7636775589314819,
|
35 |
+
"eval_runtime": 84.8717,
|
36 |
+
"eval_samples_per_second": 68.185,
|
37 |
+
"eval_steps_per_second": 2.133,
|
38 |
+
"step": 948
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 2.11,
|
42 |
+
"learning_rate": 1.578059071729958e-05,
|
43 |
+
"loss": 0.2209,
|
44 |
+
"step": 1000
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"epoch": 3.0,
|
48 |
+
"eval_accuracy": 0.8156212199758078,
|
49 |
+
"eval_f1": 0.7283195708625394,
|
50 |
+
"eval_loss": 0.6474512219429016,
|
51 |
+
"eval_precision": 0.7140241339852836,
|
52 |
+
"eval_recall": 0.7508970192749587,
|
53 |
+
"eval_runtime": 84.4623,
|
54 |
+
"eval_samples_per_second": 68.516,
|
55 |
+
"eval_steps_per_second": 2.143,
|
56 |
+
"step": 1422
|
57 |
+
},
|
58 |
+
{
|
59 |
+
"epoch": 3.16,
|
60 |
+
"learning_rate": 1.3670886075949368e-05,
|
61 |
+
"loss": 0.1636,
|
62 |
+
"step": 1500
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"epoch": 4.0,
|
66 |
+
"eval_accuracy": 0.8107827890098497,
|
67 |
+
"eval_f1": 0.7287062118529598,
|
68 |
+
"eval_loss": 0.8141492605209351,
|
69 |
+
"eval_precision": 0.7155878847825652,
|
70 |
+
"eval_recall": 0.7576050434353393,
|
71 |
+
"eval_runtime": 84.7752,
|
72 |
+
"eval_samples_per_second": 68.263,
|
73 |
+
"eval_steps_per_second": 2.135,
|
74 |
+
"step": 1896
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"epoch": 4.22,
|
78 |
+
"learning_rate": 1.1561181434599158e-05,
|
79 |
+
"loss": 0.114,
|
80 |
+
"step": 2000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 5.0,
|
84 |
+
"eval_accuracy": 0.8123379989631934,
|
85 |
+
"eval_f1": 0.7293509360093955,
|
86 |
+
"eval_loss": 0.9643709063529968,
|
87 |
+
"eval_precision": 0.7212611749404146,
|
88 |
+
"eval_recall": 0.7546179503626446,
|
89 |
+
"eval_runtime": 84.2684,
|
90 |
+
"eval_samples_per_second": 68.673,
|
91 |
+
"eval_steps_per_second": 2.148,
|
92 |
+
"step": 2370
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"epoch": 5.27,
|
96 |
+
"learning_rate": 9.451476793248946e-06,
|
97 |
+
"loss": 0.0876,
|
98 |
+
"step": 2500
|
99 |
+
},
|
100 |
+
{
|
101 |
+
"epoch": 6.0,
|
102 |
+
"eval_accuracy": 0.8132020044928288,
|
103 |
+
"eval_f1": 0.7284553808496855,
|
104 |
+
"eval_loss": 1.028875708580017,
|
105 |
+
"eval_precision": 0.7124400203988301,
|
106 |
+
"eval_recall": 0.7560308594078071,
|
107 |
+
"eval_runtime": 84.9239,
|
108 |
+
"eval_samples_per_second": 68.143,
|
109 |
+
"eval_steps_per_second": 2.131,
|
110 |
+
"step": 2844
|
111 |
+
}
|
112 |
+
],
|
113 |
+
"max_steps": 4740,
|
114 |
+
"num_train_epochs": 10,
|
115 |
+
"total_flos": 1.074326001547428e+16,
|
116 |
+
"trial_name": null,
|
117 |
+
"trial_params": null
|
118 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f3068e345d163d29e1041105fe8f5d676c41a1ede098f9b1074d73330e4cf25
|
3 |
+
size 3707
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|