KoichiYasuoka commited on
Commit
1e3a463
1 Parent(s): be9dc0b

initial release

Browse files
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - "ja"
4
+ tags:
5
+ - "japanese"
6
+ - "token-classification"
7
+ - "pos"
8
+ license: "cc-by-sa-4.0"
9
+ pipeline_tag: "token-classification"
10
+ widget:
11
+ - text: "国境の長いトンネルを抜けると雪国であった。"
12
+ ---
13
+
14
+ # roberta-base-japanese-luw-upos
15
+
16
+ ## Model Description
17
+
18
+ This is a RoBERTa model pre-trained on Japanese 青空文庫 texts for POS-tagging, derived from [roberta-base-japanese-aozora](https://huggingface.co/KoichiYasuoka/roberta-base-japanese-aozora). Every long-unit-word is tagged by [UPOS](https://universaldependencies.org/u/pos/) (Universal Part-Of-Speech).
19
+
20
+ ## How to Use
21
+
22
+ ```py
23
+ from transformers import AutoTokenizer,AutoModelForTokenClassification,TokenClassificationPipeline
24
+ tokenizer=AutoTokenizer.from_pretrained("KoichiYasuoka/roberta-base-japanese-luw-upos")
25
+ model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/roberta-base-japanese-luw-upos")
26
+ pipeline=TokenClassificationPipeline(tokenizer=tokenizer,model=model,aggregation_strategy="simple")
27
+ nlp=lambda x:[(x[t["start"]:t["end"]],t["entity_group"]) for t in pipeline(x)]
28
+ print(nlp("国境の長いトンネルを抜けると雪国であった。"))
29
+ ```
30
+
config.json ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaForTokenClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 2,
7
+ "classifier_dropout": null,
8
+ "eos_token_id": 3,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "B-NOUN",
14
+ "1": "B-PART",
15
+ "2": "B-PROPN",
16
+ "3": "SYM",
17
+ "4": "B-AUX",
18
+ "5": "ADP",
19
+ "6": "B-VERB",
20
+ "7": "CCONJ",
21
+ "8": "ADJ",
22
+ "9": "I-PRON",
23
+ "10": "B-CCONJ",
24
+ "11": "B-NUM",
25
+ "12": "NUM",
26
+ "13": "I-X",
27
+ "14": "I-NUM",
28
+ "15": "I-PART",
29
+ "16": "I-SCONJ",
30
+ "17": "PROPN",
31
+ "18": "PART",
32
+ "19": "B-PRON",
33
+ "20": "B-DET",
34
+ "21": "I-SYM",
35
+ "22": "I-PROPN",
36
+ "23": "I-ADV",
37
+ "24": "I-INTJ",
38
+ "25": "B-SCONJ",
39
+ "26": "I-DET",
40
+ "27": "I-CCONJ",
41
+ "28": "I-NOUN",
42
+ "29": "PRON",
43
+ "30": "B-ADJ",
44
+ "31": "AUX",
45
+ "32": "INTJ",
46
+ "33": "ADV",
47
+ "34": "X",
48
+ "35": "PUNCT",
49
+ "36": "I-VERB",
50
+ "37": "B-SYM",
51
+ "38": "B-INTJ",
52
+ "39": "NOUN",
53
+ "40": "B-X",
54
+ "41": "I-ADP",
55
+ "42": "VERB",
56
+ "43": "I-AUX",
57
+ "44": "B-ADP",
58
+ "45": "I-ADJ",
59
+ "46": "SCONJ",
60
+ "47": "DET",
61
+ "48": "B-ADV"
62
+ },
63
+ "initializer_range": 0.02,
64
+ "intermediate_size": 3072,
65
+ "label2id": {
66
+ "ADJ": 8,
67
+ "ADP": 5,
68
+ "ADV": 33,
69
+ "AUX": 31,
70
+ "B-ADJ": 30,
71
+ "B-ADP": 44,
72
+ "B-ADV": 48,
73
+ "B-AUX": 4,
74
+ "B-CCONJ": 10,
75
+ "B-DET": 20,
76
+ "B-INTJ": 38,
77
+ "B-NOUN": 0,
78
+ "B-NUM": 11,
79
+ "B-PART": 1,
80
+ "B-PRON": 19,
81
+ "B-PROPN": 2,
82
+ "B-SCONJ": 25,
83
+ "B-SYM": 37,
84
+ "B-VERB": 6,
85
+ "B-X": 40,
86
+ "CCONJ": 7,
87
+ "DET": 47,
88
+ "I-ADJ": 45,
89
+ "I-ADP": 41,
90
+ "I-ADV": 23,
91
+ "I-AUX": 43,
92
+ "I-CCONJ": 27,
93
+ "I-DET": 26,
94
+ "I-INTJ": 24,
95
+ "I-NOUN": 28,
96
+ "I-NUM": 14,
97
+ "I-PART": 15,
98
+ "I-PRON": 9,
99
+ "I-PROPN": 22,
100
+ "I-SCONJ": 16,
101
+ "I-SYM": 21,
102
+ "I-VERB": 36,
103
+ "I-X": 13,
104
+ "INTJ": 32,
105
+ "NOUN": 39,
106
+ "NUM": 12,
107
+ "PART": 18,
108
+ "PRON": 29,
109
+ "PROPN": 17,
110
+ "PUNCT": 35,
111
+ "SCONJ": 46,
112
+ "SYM": 3,
113
+ "VERB": 42,
114
+ "X": 34
115
+ },
116
+ "layer_norm_eps": 1e-12,
117
+ "max_position_embeddings": 512,
118
+ "model_type": "roberta",
119
+ "num_attention_heads": 12,
120
+ "num_hidden_layers": 12,
121
+ "pad_token_id": 0,
122
+ "position_embedding_type": "absolute",
123
+ "tokenizer_class": "RemBertTokenizerFast",
124
+ "torch_dtype": "float32",
125
+ "transformers_version": "4.11.3",
126
+ "type_vocab_size": 2,
127
+ "use_cache": true,
128
+ "vocab_size": 250315
129
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65ea9fd989d0944f84a7ccd4f610ce88e16cc2c0ea469025da25afead653f89e
3
+ size 1111009234
sentencepiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
3
+ size 1
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true}}
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": false, "remove_space": true, "keep_accents": true, "bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "model_max_length": 512, "tokenizer_class": "RemBertTokenizer"}