emanuelaboros
commited on
Commit
•
f7e5427
1
Parent(s):
5dbef48
Initial commit of the trained NER model with code
Browse files- config.json +4 -0
- configuration.py +45 -0
config.json
CHANGED
@@ -4,6 +4,10 @@
|
|
4 |
"ExtendedMultitaskModelForTokenClassification"
|
5 |
],
|
6 |
"attention_probs_dropout_prob": 0.1,
|
|
|
|
|
|
|
|
|
7 |
"classifier_dropout": null,
|
8 |
"custom_pipelines": {
|
9 |
"generic-ner": {
|
|
|
4 |
"ExtendedMultitaskModelForTokenClassification"
|
5 |
],
|
6 |
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "configuration.ImpressoConfig",
|
9 |
+
"AutoModelForTokenClassification": "models.ExtendedMultitaskModelForTokenClassification"
|
10 |
+
},
|
11 |
"classifier_dropout": null,
|
12 |
"custom_pipelines": {
|
13 |
"generic-ner": {
|
configuration.py
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PretrainedConfig
|
2 |
+
|
3 |
+
|
4 |
+
class ImpressoConfig(PretrainedConfig):
|
5 |
+
model_type = "extended_multitask"
|
6 |
+
|
7 |
+
def __init__(
|
8 |
+
self,
|
9 |
+
vocab_size=30522,
|
10 |
+
hidden_size=768,
|
11 |
+
num_hidden_layers=12,
|
12 |
+
num_attention_heads=12,
|
13 |
+
intermediate_size=3072,
|
14 |
+
hidden_act="gelu",
|
15 |
+
hidden_dropout_prob=0.1,
|
16 |
+
attention_probs_dropout_prob=0.1,
|
17 |
+
max_position_embeddings=512,
|
18 |
+
type_vocab_size=2,
|
19 |
+
initializer_range=0.02,
|
20 |
+
layer_norm_eps=1e-12,
|
21 |
+
pad_token_id=0,
|
22 |
+
position_embedding_type="absolute",
|
23 |
+
use_cache=True,
|
24 |
+
classifier_dropout=None,
|
25 |
+
pretrained_config=None,
|
26 |
+
**kwargs,
|
27 |
+
):
|
28 |
+
super().__init__(pad_token_id=pad_token_id, **kwargs)
|
29 |
+
|
30 |
+
self.vocab_size = vocab_size
|
31 |
+
self.hidden_size = hidden_size
|
32 |
+
self.num_hidden_layers = num_hidden_layers
|
33 |
+
self.num_attention_heads = num_attention_heads
|
34 |
+
self.hidden_act = hidden_act
|
35 |
+
self.intermediate_size = intermediate_size
|
36 |
+
self.hidden_dropout_prob = hidden_dropout_prob
|
37 |
+
self.attention_probs_dropout_prob = attention_probs_dropout_prob
|
38 |
+
self.max_position_embeddings = max_position_embeddings
|
39 |
+
self.type_vocab_size = type_vocab_size
|
40 |
+
self.initializer_range = initializer_range
|
41 |
+
self.layer_norm_eps = layer_norm_eps
|
42 |
+
self.position_embedding_type = position_embedding_type
|
43 |
+
self.use_cache = use_cache
|
44 |
+
self.classifier_dropout = classifier_dropout
|
45 |
+
self.pretrained_config = pretrained_config
|