Upload model
Browse files- README.md +36 -0
- added_tokens.json +4 -0
- config.json +249 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +15 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
license: apache-2.0
|
4 |
+
library_name: span-marker
|
5 |
+
tags:
|
6 |
+
- span-marker
|
7 |
+
- token-classification
|
8 |
+
- ner
|
9 |
+
- named-entity-recognition
|
10 |
+
pipeline_tag: token-classification
|
11 |
+
---
|
12 |
+
|
13 |
+
# SpanMarker for Named Entity Recognition
|
14 |
+
|
15 |
+
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. In particular, this SpanMarker model uses [roberta-large](https://huggingface.co/roberta-large) as the underlying encoder.
|
16 |
+
|
17 |
+
## Usage
|
18 |
+
|
19 |
+
To use this model for inference, first install the `span_marker` library:
|
20 |
+
|
21 |
+
```bash
|
22 |
+
pip install span_marker
|
23 |
+
```
|
24 |
+
|
25 |
+
You can then run inference with this model like so:
|
26 |
+
|
27 |
+
```python
|
28 |
+
from span_marker import SpanMarkerModel
|
29 |
+
|
30 |
+
# Download from the 🤗 Hub
|
31 |
+
model = SpanMarkerModel.from_pretrained("span_marker_model_name")
|
32 |
+
# Run inference
|
33 |
+
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
34 |
+
```
|
35 |
+
|
36 |
+
See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models\\rl-ontonotes-256-128-10-no-context-0\\checkpoint-final",
|
3 |
+
"architectures": [
|
4 |
+
"SpanMarkerModel"
|
5 |
+
],
|
6 |
+
"encoder": {
|
7 |
+
"_name_or_path": "roberta-large",
|
8 |
+
"add_cross_attention": false,
|
9 |
+
"architectures": [
|
10 |
+
"RobertaForMaskedLM"
|
11 |
+
],
|
12 |
+
"attention_probs_dropout_prob": 0.1,
|
13 |
+
"bad_words_ids": null,
|
14 |
+
"begin_suppress_tokens": null,
|
15 |
+
"bos_token_id": 0,
|
16 |
+
"chunk_size_feed_forward": 0,
|
17 |
+
"classifier_dropout": null,
|
18 |
+
"cross_attention_hidden_size": null,
|
19 |
+
"decoder_start_token_id": null,
|
20 |
+
"diversity_penalty": 0.0,
|
21 |
+
"do_sample": false,
|
22 |
+
"early_stopping": false,
|
23 |
+
"encoder_no_repeat_ngram_size": 0,
|
24 |
+
"eos_token_id": 2,
|
25 |
+
"exponential_decay_length_penalty": null,
|
26 |
+
"finetuning_task": null,
|
27 |
+
"forced_bos_token_id": null,
|
28 |
+
"forced_eos_token_id": null,
|
29 |
+
"hidden_act": "gelu",
|
30 |
+
"hidden_dropout_prob": 0.1,
|
31 |
+
"hidden_size": 1024,
|
32 |
+
"id2label": {
|
33 |
+
"0": "O",
|
34 |
+
"1": "B-CARDINAL",
|
35 |
+
"2": "B-DATE",
|
36 |
+
"3": "I-DATE",
|
37 |
+
"4": "B-PERSON",
|
38 |
+
"5": "I-PERSON",
|
39 |
+
"6": "B-NORP",
|
40 |
+
"7": "B-GPE",
|
41 |
+
"8": "I-GPE",
|
42 |
+
"9": "B-LAW",
|
43 |
+
"10": "I-LAW",
|
44 |
+
"11": "B-ORG",
|
45 |
+
"12": "I-ORG",
|
46 |
+
"13": "B-PERCENT",
|
47 |
+
"14": "I-PERCENT",
|
48 |
+
"15": "B-ORDINAL",
|
49 |
+
"16": "B-MONEY",
|
50 |
+
"17": "I-MONEY",
|
51 |
+
"18": "B-WORK_OF_ART",
|
52 |
+
"19": "I-WORK_OF_ART",
|
53 |
+
"20": "B-FAC",
|
54 |
+
"21": "B-TIME",
|
55 |
+
"22": "I-CARDINAL",
|
56 |
+
"23": "B-LOC",
|
57 |
+
"24": "B-QUANTITY",
|
58 |
+
"25": "I-QUANTITY",
|
59 |
+
"26": "I-NORP",
|
60 |
+
"27": "I-LOC",
|
61 |
+
"28": "B-PRODUCT",
|
62 |
+
"29": "I-TIME",
|
63 |
+
"30": "B-EVENT",
|
64 |
+
"31": "I-EVENT",
|
65 |
+
"32": "I-FAC",
|
66 |
+
"33": "B-LANGUAGE",
|
67 |
+
"34": "I-PRODUCT",
|
68 |
+
"35": "I-ORDINAL",
|
69 |
+
"36": "I-LANGUAGE"
|
70 |
+
},
|
71 |
+
"initializer_range": 0.02,
|
72 |
+
"intermediate_size": 4096,
|
73 |
+
"is_decoder": false,
|
74 |
+
"is_encoder_decoder": false,
|
75 |
+
"label2id": {
|
76 |
+
"B-CARDINAL": 1,
|
77 |
+
"B-DATE": 2,
|
78 |
+
"B-EVENT": 30,
|
79 |
+
"B-FAC": 20,
|
80 |
+
"B-GPE": 7,
|
81 |
+
"B-LANGUAGE": 33,
|
82 |
+
"B-LAW": 9,
|
83 |
+
"B-LOC": 23,
|
84 |
+
"B-MONEY": 16,
|
85 |
+
"B-NORP": 6,
|
86 |
+
"B-ORDINAL": 15,
|
87 |
+
"B-ORG": 11,
|
88 |
+
"B-PERCENT": 13,
|
89 |
+
"B-PERSON": 4,
|
90 |
+
"B-PRODUCT": 28,
|
91 |
+
"B-QUANTITY": 24,
|
92 |
+
"B-TIME": 21,
|
93 |
+
"B-WORK_OF_ART": 18,
|
94 |
+
"I-CARDINAL": 22,
|
95 |
+
"I-DATE": 3,
|
96 |
+
"I-EVENT": 31,
|
97 |
+
"I-FAC": 32,
|
98 |
+
"I-GPE": 8,
|
99 |
+
"I-LANGUAGE": 36,
|
100 |
+
"I-LAW": 10,
|
101 |
+
"I-LOC": 27,
|
102 |
+
"I-MONEY": 17,
|
103 |
+
"I-NORP": 26,
|
104 |
+
"I-ORDINAL": 35,
|
105 |
+
"I-ORG": 12,
|
106 |
+
"I-PERCENT": 14,
|
107 |
+
"I-PERSON": 5,
|
108 |
+
"I-PRODUCT": 34,
|
109 |
+
"I-QUANTITY": 25,
|
110 |
+
"I-TIME": 29,
|
111 |
+
"I-WORK_OF_ART": 19,
|
112 |
+
"O": 0
|
113 |
+
},
|
114 |
+
"layer_norm_eps": 1e-05,
|
115 |
+
"length_penalty": 1.0,
|
116 |
+
"max_length": 20,
|
117 |
+
"max_position_embeddings": 514,
|
118 |
+
"min_length": 0,
|
119 |
+
"model_type": "roberta",
|
120 |
+
"no_repeat_ngram_size": 0,
|
121 |
+
"num_attention_heads": 16,
|
122 |
+
"num_beam_groups": 1,
|
123 |
+
"num_beams": 1,
|
124 |
+
"num_hidden_layers": 24,
|
125 |
+
"num_return_sequences": 1,
|
126 |
+
"output_attentions": false,
|
127 |
+
"output_hidden_states": false,
|
128 |
+
"output_scores": false,
|
129 |
+
"pad_token_id": 1,
|
130 |
+
"position_embedding_type": "absolute",
|
131 |
+
"prefix": null,
|
132 |
+
"problem_type": null,
|
133 |
+
"pruned_heads": {},
|
134 |
+
"remove_invalid_values": false,
|
135 |
+
"repetition_penalty": 1.0,
|
136 |
+
"return_dict": true,
|
137 |
+
"return_dict_in_generate": false,
|
138 |
+
"sep_token_id": null,
|
139 |
+
"suppress_tokens": null,
|
140 |
+
"task_specific_params": null,
|
141 |
+
"temperature": 1.0,
|
142 |
+
"tf_legacy_loss": false,
|
143 |
+
"tie_encoder_decoder": false,
|
144 |
+
"tie_word_embeddings": true,
|
145 |
+
"tokenizer_class": null,
|
146 |
+
"top_k": 50,
|
147 |
+
"top_p": 1.0,
|
148 |
+
"torch_dtype": null,
|
149 |
+
"torchscript": false,
|
150 |
+
"transformers_version": "4.28.1",
|
151 |
+
"type_vocab_size": 1,
|
152 |
+
"typical_p": 1.0,
|
153 |
+
"use_bfloat16": false,
|
154 |
+
"use_cache": true,
|
155 |
+
"vocab_size": 50267
|
156 |
+
},
|
157 |
+
"entity_max_length": 10,
|
158 |
+
"id2label": {
|
159 |
+
"0": "O",
|
160 |
+
"1": "CARDINAL",
|
161 |
+
"2": "DATE",
|
162 |
+
"3": "EVENT",
|
163 |
+
"4": "FAC",
|
164 |
+
"5": "GPE",
|
165 |
+
"6": "LANGUAGE",
|
166 |
+
"7": "LAW",
|
167 |
+
"8": "LOC",
|
168 |
+
"9": "MONEY",
|
169 |
+
"10": "NORP",
|
170 |
+
"11": "ORDINAL",
|
171 |
+
"12": "ORG",
|
172 |
+
"13": "PERCENT",
|
173 |
+
"14": "PERSON",
|
174 |
+
"15": "PRODUCT",
|
175 |
+
"16": "QUANTITY",
|
176 |
+
"17": "TIME",
|
177 |
+
"18": "WORK_OF_ART"
|
178 |
+
},
|
179 |
+
"id2reduced_id": {
|
180 |
+
"0": 0,
|
181 |
+
"1": 1,
|
182 |
+
"2": 2,
|
183 |
+
"3": 2,
|
184 |
+
"4": 14,
|
185 |
+
"5": 14,
|
186 |
+
"6": 10,
|
187 |
+
"7": 5,
|
188 |
+
"8": 5,
|
189 |
+
"9": 7,
|
190 |
+
"10": 7,
|
191 |
+
"11": 12,
|
192 |
+
"12": 12,
|
193 |
+
"13": 13,
|
194 |
+
"14": 13,
|
195 |
+
"15": 11,
|
196 |
+
"16": 9,
|
197 |
+
"17": 9,
|
198 |
+
"18": 18,
|
199 |
+
"19": 18,
|
200 |
+
"20": 4,
|
201 |
+
"21": 17,
|
202 |
+
"22": 1,
|
203 |
+
"23": 8,
|
204 |
+
"24": 16,
|
205 |
+
"25": 16,
|
206 |
+
"26": 10,
|
207 |
+
"27": 8,
|
208 |
+
"28": 15,
|
209 |
+
"29": 17,
|
210 |
+
"30": 3,
|
211 |
+
"31": 3,
|
212 |
+
"32": 4,
|
213 |
+
"33": 6,
|
214 |
+
"34": 15,
|
215 |
+
"35": 11,
|
216 |
+
"36": 6
|
217 |
+
},
|
218 |
+
"label2id": {
|
219 |
+
"CARDINAL": 1,
|
220 |
+
"DATE": 2,
|
221 |
+
"EVENT": 3,
|
222 |
+
"FAC": 4,
|
223 |
+
"GPE": 5,
|
224 |
+
"LANGUAGE": 6,
|
225 |
+
"LAW": 7,
|
226 |
+
"LOC": 8,
|
227 |
+
"MONEY": 9,
|
228 |
+
"NORP": 10,
|
229 |
+
"O": 0,
|
230 |
+
"ORDINAL": 11,
|
231 |
+
"ORG": 12,
|
232 |
+
"PERCENT": 13,
|
233 |
+
"PERSON": 14,
|
234 |
+
"PRODUCT": 15,
|
235 |
+
"QUANTITY": 16,
|
236 |
+
"TIME": 17,
|
237 |
+
"WORK_OF_ART": 18
|
238 |
+
},
|
239 |
+
"marker_max_length": 128,
|
240 |
+
"max_next_context": null,
|
241 |
+
"max_prev_context": null,
|
242 |
+
"model_max_length": 256,
|
243 |
+
"model_max_length_default": 512,
|
244 |
+
"model_type": "span-marker",
|
245 |
+
"span_marker_version": "1.0.1",
|
246 |
+
"torch_dtype": "float32",
|
247 |
+
"transformers_version": "4.28.1",
|
248 |
+
"vocab_size": 50267
|
249 |
+
}
|
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:9e21bbb663b7a7153b89f1a90fb0b65d689fed0c33c43c1dc50f78c051a8cf71
|
3 |
+
size 1421737397
|
special_tokens_map.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": {
|
6 |
+
"content": "<mask>",
|
7 |
+
"lstrip": true,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"pad_token": "<pad>",
|
13 |
+
"sep_token": "</s>",
|
14 |
+
"unk_token": "<unk>"
|
15 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": true,
|
3 |
+
"bos_token": "<s>",
|
4 |
+
"clean_up_tokenization_spaces": true,
|
5 |
+
"cls_token": "<s>",
|
6 |
+
"eos_token": "</s>",
|
7 |
+
"errors": "replace",
|
8 |
+
"mask_token": "<mask>",
|
9 |
+
"model_max_length": 512,
|
10 |
+
"pad_token": "<pad>",
|
11 |
+
"sep_token": "</s>",
|
12 |
+
"tokenizer_class": "RobertaTokenizer",
|
13 |
+
"trim_offsets": true,
|
14 |
+
"unk_token": "<unk>"
|
15 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|