Duplicate from nlptown/flaubert_small_cased_sentiment
Browse filesCo-authored-by: NLP Town <nlptown@users.noreply.huggingface.co>
- .gitattributes +27 -0
- README.md +35 -0
- config.json +95 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
19 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fr
|
4 |
+
datasets:
|
5 |
+
- amazon_reviews_multi
|
6 |
+
license: mit
|
7 |
+
---
|
8 |
+
|
9 |
+
# flaubert_small_cased_sentiment
|
10 |
+
|
11 |
+
This is a `flaubert_small_cased` model finetuned for sentiment analysis on product reviews in French. It predicts the sentiment of the review, from `very_negative` (1 star) to `very_positive` (5 stars).
|
12 |
+
|
13 |
+
This model is intended for direct use as a sentiment analysis model for French product reviews, or for further finetuning on related sentiment analysis tasks.
|
14 |
+
|
15 |
+
## Training data
|
16 |
+
|
17 |
+
The training data consists of the French portion of `amazon_reviews_multi`, supplemented with another 140,000 similar reviews.
|
18 |
+
|
19 |
+
## Accuracy
|
20 |
+
|
21 |
+
The finetuned model was evaluated on the French test set of `amazon_reviews_multi`.
|
22 |
+
|
23 |
+
- Accuracy (exact) is the exact match on the number of stars.
|
24 |
+
- Accuracy (off-by-1) is the percentage of reviews where the number of stars the model predicts differs by a maximum of 1 from the number given by the human reviewer.
|
25 |
+
|
26 |
+
|
27 |
+
| Language | Accuracy (exact) | Accuracy (off-by-1) |
|
28 |
+
| -------- | ---------------------- | ------------------- |
|
29 |
+
| French | 61.56% | 95.66%
|
30 |
+
|
31 |
+
## Contact
|
32 |
+
|
33 |
+
[NLP Town](https://www.nlp.town) offers a suite of sentiment models for a wide range of languages, including an improved multilingual model through [RapidAPI](https://rapidapi.com/nlp-town-nlp-town-default/api/multilingual-sentiment-analysis2/).
|
34 |
+
|
35 |
+
Feel free to contact us for questions, feedback and/or requests for similar models.
|
config.json
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/tmp/sentiment-french-l/checkpoint-38000/",
|
3 |
+
"amp": 1,
|
4 |
+
"architectures": [
|
5 |
+
"FlaubertForSequenceClassification"
|
6 |
+
],
|
7 |
+
"asm": false,
|
8 |
+
"attention_dropout": 0.1,
|
9 |
+
"bos_index": 0,
|
10 |
+
"bos_token_id": 0,
|
11 |
+
"bptt": 512,
|
12 |
+
"causal": false,
|
13 |
+
"clip_grad_norm": 5,
|
14 |
+
"dropout": 0.1,
|
15 |
+
"emb_dim": 512,
|
16 |
+
"embed_init_std": 0.02209708691207961,
|
17 |
+
"encoder_only": true,
|
18 |
+
"end_n_top": 5,
|
19 |
+
"eos_index": 1,
|
20 |
+
"fp16": true,
|
21 |
+
"gelu_activation": true,
|
22 |
+
"group_by_size": true,
|
23 |
+
"id2label": {
|
24 |
+
"0": "very_negative",
|
25 |
+
"1": "negative",
|
26 |
+
"2": "mixed",
|
27 |
+
"3": "positive",
|
28 |
+
"4": "very_positive"
|
29 |
+
},
|
30 |
+
"id2lang": {
|
31 |
+
"0": "fr"
|
32 |
+
},
|
33 |
+
"init_std": 0.02,
|
34 |
+
"is_encoder": true,
|
35 |
+
"label2id": {
|
36 |
+
"very_negative": 0,
|
37 |
+
"negative": 1,
|
38 |
+
"mixed": 2,
|
39 |
+
"positive": 3,
|
40 |
+
"very_positive": 4
|
41 |
+
},
|
42 |
+
"lang2id": {
|
43 |
+
"fr": 0
|
44 |
+
},
|
45 |
+
"lang_id": 0,
|
46 |
+
"langs": [
|
47 |
+
"fr"
|
48 |
+
],
|
49 |
+
"layer_norm_eps": 1e-06,
|
50 |
+
"layerdrop": 0.2,
|
51 |
+
"lg_sampling_factor": -1,
|
52 |
+
"lgs": "fr",
|
53 |
+
"mask_index": 5,
|
54 |
+
"mask_token_id": 0,
|
55 |
+
"max_batch_size": 0,
|
56 |
+
"max_position_embeddings": 512,
|
57 |
+
"max_vocab": -1,
|
58 |
+
"mlm_steps": [
|
59 |
+
[
|
60 |
+
"fr",
|
61 |
+
null
|
62 |
+
]
|
63 |
+
],
|
64 |
+
"model_type": "flaubert",
|
65 |
+
"n_heads": 8,
|
66 |
+
"n_langs": 1,
|
67 |
+
"n_layers": 6,
|
68 |
+
"pad_index": 2,
|
69 |
+
"pad_token_id": 2,
|
70 |
+
"pre_norm": true,
|
71 |
+
"problem_type": "single_label_classification",
|
72 |
+
"sample_alpha": 0,
|
73 |
+
"share_inout_emb": true,
|
74 |
+
"sinusoidal_embeddings": false,
|
75 |
+
"start_n_top": 5,
|
76 |
+
"summary_activation": null,
|
77 |
+
"summary_first_dropout": 0.1,
|
78 |
+
"summary_proj_to_labels": true,
|
79 |
+
"summary_type": "first",
|
80 |
+
"summary_use_proj": true,
|
81 |
+
"tokens_per_batch": -1,
|
82 |
+
"torch_dtype": "float32",
|
83 |
+
"transformers_version": "4.17.0",
|
84 |
+
"unk_index": 3,
|
85 |
+
"use_lang_emb": true,
|
86 |
+
"vocab_size": 68729,
|
87 |
+
"word_blank": 0,
|
88 |
+
"word_dropout": 0,
|
89 |
+
"word_keep": 0.1,
|
90 |
+
"word_mask": 0.8,
|
91 |
+
"word_mask_keep_rand": "0.8,0.1,0.1",
|
92 |
+
"word_pred": 0.15,
|
93 |
+
"word_rand": 0.1,
|
94 |
+
"word_shuffle": 0
|
95 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a632419c5caf21b0b7c0d2c7d92cc67414ffb373eafeb73279fccbfab167de8
|
3 |
+
size 217511669
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "</s>", "mask_token": "<special1>", "additional_special_tokens": ["<special0>", "<special1>", "<special2>", "<special3>", "<special4>", "<special5>", "<special6>", "<special7>", "<special8>", "<special9>"]}
|
tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:13eb40139ca17d77706b33396d9fd50753c73ef407fd809946fdb0734d7b5555
|
3 |
+
size 217598768
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"unk_token": "<unk>", "bos_token": "<s>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "</s>", "mask_token": "<special1>", "additional_special_tokens": ["<special0>", "<special1>", "<special2>", "<special3>", "<special4>", "<special5>", "<special6>", "<special7>", "<special8>", "<special9>"], "lang2id": null, "id2lang": null, "do_lowercase_and_remove_accent": true, "do_lowercase": false, "do_lower_case": false, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "flaubert/flaubert_small_cased", "tokenizer_class": "FlaubertTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|