Upload model
Browse files- README.md +37 -0
- added_tokens.json +4 -0
- config.json +123 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +14 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 [bert-base-uncased](https://huggingface.co/bert-base-uncased) as the underlying encoder.
|
16 |
+
|
17 |
+
|
18 |
+
## Usage
|
19 |
+
|
20 |
+
To use this model for inference, first install the `span_marker` library:
|
21 |
+
|
22 |
+
```bash
|
23 |
+
pip install span_marker
|
24 |
+
```
|
25 |
+
|
26 |
+
You can then run inference with this model like so:
|
27 |
+
|
28 |
+
```python
|
29 |
+
from span_marker import SpanMarkerModel
|
30 |
+
|
31 |
+
# Download from the 🤗 Hub
|
32 |
+
model = SpanMarkerModel.from_pretrained("span_marker_model_name")
|
33 |
+
# Run inference
|
34 |
+
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
35 |
+
```
|
36 |
+
|
37 |
+
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 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<end>": 30523,
|
3 |
+
"<start>": 30522
|
4 |
+
}
|
config.json
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models\\span_marker_bert_base_uncased_acronyms\\checkpoint-final",
|
3 |
+
"architectures": [
|
4 |
+
"SpanMarkerModel"
|
5 |
+
],
|
6 |
+
"encoder": {
|
7 |
+
"_name_or_path": "bert-base-uncased",
|
8 |
+
"add_cross_attention": false,
|
9 |
+
"architectures": [
|
10 |
+
"BertForMaskedLM"
|
11 |
+
],
|
12 |
+
"attention_probs_dropout_prob": 0.1,
|
13 |
+
"bad_words_ids": null,
|
14 |
+
"begin_suppress_tokens": null,
|
15 |
+
"bos_token_id": null,
|
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": null,
|
25 |
+
"exponential_decay_length_penalty": null,
|
26 |
+
"finetuning_task": null,
|
27 |
+
"forced_bos_token_id": null,
|
28 |
+
"forced_eos_token_id": null,
|
29 |
+
"gradient_checkpointing": false,
|
30 |
+
"hidden_act": "gelu",
|
31 |
+
"hidden_dropout_prob": 0.1,
|
32 |
+
"hidden_size": 768,
|
33 |
+
"id2label": {
|
34 |
+
"0": "B-long",
|
35 |
+
"1": "B-short",
|
36 |
+
"2": "I-long",
|
37 |
+
"3": "I-short",
|
38 |
+
"4": "O"
|
39 |
+
},
|
40 |
+
"initializer_range": 0.02,
|
41 |
+
"intermediate_size": 3072,
|
42 |
+
"is_decoder": false,
|
43 |
+
"is_encoder_decoder": false,
|
44 |
+
"label2id": {
|
45 |
+
"B-long": 0,
|
46 |
+
"B-short": 1,
|
47 |
+
"I-long": 2,
|
48 |
+
"I-short": 3,
|
49 |
+
"O": 4
|
50 |
+
},
|
51 |
+
"layer_norm_eps": 1e-12,
|
52 |
+
"length_penalty": 1.0,
|
53 |
+
"max_length": 20,
|
54 |
+
"max_position_embeddings": 512,
|
55 |
+
"min_length": 0,
|
56 |
+
"model_type": "bert",
|
57 |
+
"no_repeat_ngram_size": 0,
|
58 |
+
"num_attention_heads": 12,
|
59 |
+
"num_beam_groups": 1,
|
60 |
+
"num_beams": 1,
|
61 |
+
"num_hidden_layers": 12,
|
62 |
+
"num_return_sequences": 1,
|
63 |
+
"output_attentions": false,
|
64 |
+
"output_hidden_states": false,
|
65 |
+
"output_scores": false,
|
66 |
+
"pad_token_id": 0,
|
67 |
+
"position_embedding_type": "absolute",
|
68 |
+
"prefix": null,
|
69 |
+
"problem_type": null,
|
70 |
+
"pruned_heads": {},
|
71 |
+
"remove_invalid_values": false,
|
72 |
+
"repetition_penalty": 1.0,
|
73 |
+
"return_dict": true,
|
74 |
+
"return_dict_in_generate": false,
|
75 |
+
"sep_token_id": null,
|
76 |
+
"suppress_tokens": null,
|
77 |
+
"task_specific_params": null,
|
78 |
+
"temperature": 1.0,
|
79 |
+
"tf_legacy_loss": false,
|
80 |
+
"tie_encoder_decoder": false,
|
81 |
+
"tie_word_embeddings": true,
|
82 |
+
"tokenizer_class": null,
|
83 |
+
"top_k": 50,
|
84 |
+
"top_p": 1.0,
|
85 |
+
"torch_dtype": null,
|
86 |
+
"torchscript": false,
|
87 |
+
"transformers_version": "4.31.0",
|
88 |
+
"type_vocab_size": 2,
|
89 |
+
"typical_p": 1.0,
|
90 |
+
"use_bfloat16": false,
|
91 |
+
"use_cache": true,
|
92 |
+
"vocab_size": 30524
|
93 |
+
},
|
94 |
+
"entity_max_length": 8,
|
95 |
+
"id2label": {
|
96 |
+
"0": "O",
|
97 |
+
"1": "long",
|
98 |
+
"2": "short"
|
99 |
+
},
|
100 |
+
"id2reduced_id": {
|
101 |
+
"0": 1,
|
102 |
+
"1": 2,
|
103 |
+
"2": 1,
|
104 |
+
"3": 2,
|
105 |
+
"4": 0
|
106 |
+
},
|
107 |
+
"label2id": {
|
108 |
+
"O": 0,
|
109 |
+
"long": 1,
|
110 |
+
"short": 2
|
111 |
+
},
|
112 |
+
"marker_max_length": 128,
|
113 |
+
"max_next_context": null,
|
114 |
+
"max_prev_context": null,
|
115 |
+
"model_max_length": 256,
|
116 |
+
"model_max_length_default": 512,
|
117 |
+
"model_type": "span-marker",
|
118 |
+
"span_marker_version": "1.2.5.dev",
|
119 |
+
"torch_dtype": "float32",
|
120 |
+
"trained_with_document_context": false,
|
121 |
+
"transformers_version": "4.31.0",
|
122 |
+
"vocab_size": 30524
|
123 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7c5feedabdfd32df4a1dca1e8d8d8bc8fce97cc2cc7b9c975fedeb067be220fd
|
3 |
+
size 438019697
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": true,
|
3 |
+
"clean_up_tokenization_spaces": true,
|
4 |
+
"cls_token": "[CLS]",
|
5 |
+
"do_lower_case": true,
|
6 |
+
"mask_token": "[MASK]",
|
7 |
+
"model_max_length": 512,
|
8 |
+
"pad_token": "[PAD]",
|
9 |
+
"sep_token": "[SEP]",
|
10 |
+
"strip_accents": null,
|
11 |
+
"tokenize_chinese_chars": true,
|
12 |
+
"tokenizer_class": "BertTokenizer",
|
13 |
+
"unk_token": "[UNK]"
|
14 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|