KoichiYasuoka commited on
Commit
2ca21ad
1 Parent(s): cf84783

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-large-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-large-japanese-aozora](https://huggingface.co/KoichiYasuoka/roberta-large-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-large-japanese-luw-upos")
25
+ model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/roberta-large-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": 1024,
12
+ "id2label": {
13
+ "0": "ADP",
14
+ "1": "B-NOUN",
15
+ "2": "ADJ",
16
+ "3": "B-CCONJ",
17
+ "4": "DET",
18
+ "5": "I-ADJ",
19
+ "6": "B-NUM",
20
+ "7": "X",
21
+ "8": "SCONJ",
22
+ "9": "I-NUM",
23
+ "10": "NUM",
24
+ "11": "I-DET",
25
+ "12": "B-PART",
26
+ "13": "B-INTJ",
27
+ "14": "I-CCONJ",
28
+ "15": "I-VERB",
29
+ "16": "B-SCONJ",
30
+ "17": "I-PROPN",
31
+ "18": "B-PRON",
32
+ "19": "PROPN",
33
+ "20": "B-DET",
34
+ "21": "I-PRON",
35
+ "22": "B-PROPN",
36
+ "23": "B-ADP",
37
+ "24": "I-ADV",
38
+ "25": "I-INTJ",
39
+ "26": "B-AUX",
40
+ "27": "B-VERB",
41
+ "28": "B-X",
42
+ "29": "PUNCT",
43
+ "30": "I-NOUN",
44
+ "31": "I-SCONJ",
45
+ "32": "I-PART",
46
+ "33": "I-X",
47
+ "34": "PRON",
48
+ "35": "AUX",
49
+ "36": "NOUN",
50
+ "37": "VERB",
51
+ "38": "B-SYM",
52
+ "39": "ADV",
53
+ "40": "PART",
54
+ "41": "SYM",
55
+ "42": "I-AUX",
56
+ "43": "B-ADV",
57
+ "44": "I-ADP",
58
+ "45": "B-ADJ",
59
+ "46": "I-SYM",
60
+ "47": "CCONJ",
61
+ "48": "INTJ"
62
+ },
63
+ "initializer_range": 0.02,
64
+ "intermediate_size": 4096,
65
+ "label2id": {
66
+ "ADJ": 2,
67
+ "ADP": 0,
68
+ "ADV": 39,
69
+ "AUX": 35,
70
+ "B-ADJ": 45,
71
+ "B-ADP": 23,
72
+ "B-ADV": 43,
73
+ "B-AUX": 26,
74
+ "B-CCONJ": 3,
75
+ "B-DET": 20,
76
+ "B-INTJ": 13,
77
+ "B-NOUN": 1,
78
+ "B-NUM": 6,
79
+ "B-PART": 12,
80
+ "B-PRON": 18,
81
+ "B-PROPN": 22,
82
+ "B-SCONJ": 16,
83
+ "B-SYM": 38,
84
+ "B-VERB": 27,
85
+ "B-X": 28,
86
+ "CCONJ": 47,
87
+ "DET": 4,
88
+ "I-ADJ": 5,
89
+ "I-ADP": 44,
90
+ "I-ADV": 24,
91
+ "I-AUX": 42,
92
+ "I-CCONJ": 14,
93
+ "I-DET": 11,
94
+ "I-INTJ": 25,
95
+ "I-NOUN": 30,
96
+ "I-NUM": 9,
97
+ "I-PART": 32,
98
+ "I-PRON": 21,
99
+ "I-PROPN": 17,
100
+ "I-SCONJ": 31,
101
+ "I-SYM": 46,
102
+ "I-VERB": 15,
103
+ "I-X": 33,
104
+ "INTJ": 48,
105
+ "NOUN": 36,
106
+ "NUM": 10,
107
+ "PART": 40,
108
+ "PRON": 34,
109
+ "PROPN": 19,
110
+ "PUNCT": 29,
111
+ "SCONJ": 8,
112
+ "SYM": 41,
113
+ "VERB": 37,
114
+ "X": 7
115
+ },
116
+ "layer_norm_eps": 1e-12,
117
+ "max_position_embeddings": 512,
118
+ "model_type": "roberta",
119
+ "num_attention_heads": 16,
120
+ "num_hidden_layers": 24,
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:29c3f528e4556e8443c0dc0ae624d670cf0a0414894e4c1c0a5b0ad0ae21f51d
3
+ size 2237010963
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": "RemBertTokenizerFast"}