Gleb Vinarskis
commited on
Commit
·
1c7044c
1
Parent(s):
1881d6c
restructured config
Browse files- config.json +30 -11
- impresso_langident_wrapper.py +5 -2
config.json
CHANGED
@@ -1,12 +1,31 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
"
|
4 |
-
"
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
-
}
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Maslionok/pipeline1",
|
3 |
+
"architectures": [
|
4 |
+
"BertForTokenClassification"
|
5 |
+
],
|
6 |
+
"custom_pipelines": {
|
7 |
+
"language-detection": {
|
8 |
+
"impl": "impresso_langident_wrapper.Pipeline_One",
|
9 |
+
"pt": ["AutoModel"],
|
10 |
+
"tf": []
|
11 |
+
}
|
12 |
+
},
|
13 |
+
"id2label": {
|
14 |
+
"0": "English",
|
15 |
+
"1": "German",
|
16 |
+
"2": "French"
|
17 |
+
},
|
18 |
+
"label2id": {
|
19 |
+
"English": 0,
|
20 |
+
"German": 1,
|
21 |
+
"French": 2
|
22 |
+
},
|
23 |
+
"model_type": "bert",
|
24 |
+
"vocab_size": 2000000,
|
25 |
+
"embedding_dim": 300,
|
26 |
+
"hash_count": 4,
|
27 |
+
"minn": 3,
|
28 |
+
"maxn": 6,
|
29 |
+
"bucket": 2000000,
|
30 |
+
"num_labels": 40
|
31 |
}
|
|
impresso_langident_wrapper.py
CHANGED
@@ -17,10 +17,13 @@ class Pipeline_One(Pipeline):
|
|
17 |
|
18 |
def postprocess(self, outputs, **kwargs):
|
19 |
return outputs
|
20 |
-
|
21 |
|
22 |
-
|
|
|
|
|
23 |
PIPELINE_REGISTRY.register_pipeline(
|
24 |
"language-detection",
|
25 |
pipeline_class=Pipeline_One,
|
|
|
|
|
26 |
)
|
|
|
17 |
|
18 |
def postprocess(self, outputs, **kwargs):
|
19 |
return outputs
|
|
|
20 |
|
21 |
+
|
22 |
+
from transformers import AutoModelForSequenceClassification, TFAutoModelForSequenceClassification
|
23 |
+
|
24 |
PIPELINE_REGISTRY.register_pipeline(
|
25 |
"language-detection",
|
26 |
pipeline_class=Pipeline_One,
|
27 |
+
pt_model=AutoModelForSequenceClassification,
|
28 |
+
tf_model=TFAutoModelForSequenceClassification,
|
29 |
)
|