liam168 commited on
Commit
952591d
1 Parent(s): a1e66a0

feat:A model trained on the emotional corpus of Chinese dialogue, 2 categories.

Browse files
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: zh
3
+ widget:
4
+ - text: "我喜欢下雨。"
5
+ - text: "我讨厌他。"
6
+ ---
7
+
8
+ # liam168/c2-roberta-base-finetuned-dianping-chinese
9
+
10
+ ## Model description
11
+
12
+ 用中文对话情绪语料训练的模型,2分类:乐观和悲观。
13
+
14
+ ## Overview
15
+
16
+ - **Language model**: BertForSequenceClassification
17
+ - **Model size**: 410M
18
+ - **Language**: Chinese
19
+
20
+ ## Example
21
+
22
+ ```python
23
+ >>> from transformers import AutoModelForSequenceClassification , AutoTokenizer, pipeline
24
+
25
+ >>> model_name = "liam168/c2-roberta-base-finetuned-dianping-chinese"
26
+ >>> class_num = 2
27
+ >>> ts_texts = ["我喜欢下雨。", "我讨厌他."]
28
+ >>> model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=class_num)
29
+ >>> tokenizer = AutoTokenizer.from_pretrained(model_name)
30
+ >>> classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
31
+ >>> classifier(ts_texts[0])
32
+ >>> classifier(ts_texts[1])
33
+
34
+ [{'label': 'positive', 'score': 0.9973447918891907}]
35
+ [{'label': 'negative', 'score': 0.9972558617591858}]
36
+
37
+ ```
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "liam168/c2-roberta-base-finetuned-dianping-chinese",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "negative",
13
+ "1": "positive"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "label2id": {
18
+ "negative": 0,
19
+ "positive": 1
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
+ "torch_dtype": "float32",
30
+ "transformers_version": "4.9.0.dev0",
31
+ "type_vocab_size": 2,
32
+ "use_cache": true,
33
+ "vocab_size": 21128
34
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c6278fcb09fd6234e2e24f26ebcd7e0fb01fee305d0851d6862550c85d60242
3
+ size 409160877
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "do_basic_tokenize": true, "never_split": null, "special_tokens_map_file": null, "name_or_path": "liam168/c2-roberta-base-finetuned-dianping-chinese", "tokenizer_class": "BertTokenizer"}
vocab.txt ADDED
The diff for this file is too large to render. See raw diff