tomaarsen HF staff commited on
Commit
fa3f3bd
1 Parent(s): 4c3623b

Upload model

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
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 usedfor Named Entity Recognition. In particular, this SpanMarker model uses [xlm-roberta-large](https://huggingface.co/xlm-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 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 250003,
3
+ "<start>": 250002
4
+ }
config.json ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "models\\xrl-conll-128-64-6-no-context-1e-5-5\\checkpoint-final",
3
+ "architectures": [
4
+ "SpanMarkerModel"
5
+ ],
6
+ "encoder": {
7
+ "_name_or_path": "xlm-roberta-large",
8
+ "add_cross_attention": false,
9
+ "architectures": [
10
+ "XLMRobertaForMaskedLM"
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-PER",
35
+ "2": "I-PER",
36
+ "3": "B-ORG",
37
+ "4": "I-ORG",
38
+ "5": "B-LOC",
39
+ "6": "I-LOC",
40
+ "7": "B-MISC",
41
+ "8": "I-MISC"
42
+ },
43
+ "initializer_range": 0.02,
44
+ "intermediate_size": 4096,
45
+ "is_decoder": false,
46
+ "is_encoder_decoder": false,
47
+ "label2id": {
48
+ "B-LOC": 5,
49
+ "B-MISC": 7,
50
+ "B-ORG": 3,
51
+ "B-PER": 1,
52
+ "I-LOC": 6,
53
+ "I-MISC": 8,
54
+ "I-ORG": 4,
55
+ "I-PER": 2,
56
+ "O": 0
57
+ },
58
+ "layer_norm_eps": 1e-05,
59
+ "length_penalty": 1.0,
60
+ "max_length": 20,
61
+ "max_position_embeddings": 514,
62
+ "min_length": 0,
63
+ "model_type": "xlm-roberta",
64
+ "no_repeat_ngram_size": 0,
65
+ "num_attention_heads": 16,
66
+ "num_beam_groups": 1,
67
+ "num_beams": 1,
68
+ "num_hidden_layers": 24,
69
+ "num_return_sequences": 1,
70
+ "output_attentions": false,
71
+ "output_hidden_states": false,
72
+ "output_past": true,
73
+ "output_scores": false,
74
+ "pad_token_id": 1,
75
+ "position_embedding_type": "absolute",
76
+ "prefix": null,
77
+ "problem_type": null,
78
+ "pruned_heads": {},
79
+ "remove_invalid_values": false,
80
+ "repetition_penalty": 1.0,
81
+ "return_dict": true,
82
+ "return_dict_in_generate": false,
83
+ "sep_token_id": null,
84
+ "suppress_tokens": null,
85
+ "task_specific_params": null,
86
+ "temperature": 1.0,
87
+ "tf_legacy_loss": false,
88
+ "tie_encoder_decoder": false,
89
+ "tie_word_embeddings": true,
90
+ "tokenizer_class": null,
91
+ "top_k": 50,
92
+ "top_p": 1.0,
93
+ "torch_dtype": null,
94
+ "torchscript": false,
95
+ "transformers_version": "4.28.1",
96
+ "type_vocab_size": 1,
97
+ "typical_p": 1.0,
98
+ "use_bfloat16": false,
99
+ "use_cache": true,
100
+ "vocab_size": 250004
101
+ },
102
+ "entity_max_length": 6,
103
+ "id2label": {
104
+ "0": "O",
105
+ "1": "LOC",
106
+ "2": "MISC",
107
+ "3": "ORG",
108
+ "4": "PER"
109
+ },
110
+ "id2reduced_id": {
111
+ "0": 0,
112
+ "1": 4,
113
+ "2": 4,
114
+ "3": 3,
115
+ "4": 3,
116
+ "5": 1,
117
+ "6": 1,
118
+ "7": 2,
119
+ "8": 2
120
+ },
121
+ "label2id": {
122
+ "LOC": 1,
123
+ "MISC": 2,
124
+ "O": 0,
125
+ "ORG": 3,
126
+ "PER": 4
127
+ },
128
+ "marker_max_length": 64,
129
+ "max_next_context": null,
130
+ "max_prev_context": null,
131
+ "model_max_length": 128,
132
+ "model_max_length_default": 512,
133
+ "model_type": "span-marker",
134
+ "span_marker_version": "1.0.1",
135
+ "torch_dtype": "float32",
136
+ "transformers_version": "4.28.1",
137
+ "vocab_size": 250004
138
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f78a8d499e171854833399955b59a89c6793b90b1d1457f12c63aefdf3065b0
3
+ size 2239745397
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
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
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7becf84dcb8c923f94254aff98d6e2f21190c901a95f5f4ec1059aa70a1215d0
3
+ size 17083026
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "mask_token": {
8
+ "__type": "AddedToken",
9
+ "content": "<mask>",
10
+ "lstrip": true,
11
+ "normalized": true,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "model_max_length": 512,
16
+ "pad_token": "<pad>",
17
+ "sep_token": "</s>",
18
+ "tokenizer_class": "XLMRobertaTokenizer",
19
+ "unk_token": "<unk>"
20
+ }