Text Classification
ONNX
sentence-classification
multilingual
Jarbas commited on
Commit
8d4e772
·
verified ·
1 Parent(s): a78087f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +48 -48
README.md CHANGED
@@ -1,39 +1,39 @@
1
- ---
2
- language:
3
- - en
4
- - de
5
- - es
6
- - fr
7
- - it
8
- - nl
9
- - pt
10
- license: apache-2.0
11
- tags:
12
- - sentence-classification
13
- - text-classification
14
- - onnx
15
- - multilingual
16
- datasets:
17
- - TigreGotico/sentence-types-multilingual
18
- ---
19
 
20
- # sentence-types
21
 
22
- Multilingual sentence-type classifiers (ONNX) trained on
23
- [TigreGotico/sentence-types-multilingual](https://huggingface.co/datasets/TigreGotico/sentence-types-multilingual)
24
- (9,900 balanced samples per language, 6 classes).
25
 
26
- Used by [little_questions](https://github.com/OpenJarbas/little_questions).
27
 
28
- ## Classes
29
 
30
- `command`, `exclamation`, `polar_question`, `request`, `statement`, `wh_question`
31
 
32
- ## Models
33
 
34
- | File | Language |
35
- |------|----------|
36
- | `sentence_type_EN_0.8.0.onnx` | English |
37
  | `sentence_type_DE_0.8.0.onnx` | German |
38
  | `sentence_type_ES_0.8.0.onnx` | Spanish |
39
  | `sentence_type_FR_0.8.0.onnx` | French |
@@ -41,26 +41,26 @@
41
  | `sentence_type_NL_0.8.0.onnx` | Dutch |
42
  | `sentence_type_PT_0.8.0.onnx` | Portuguese |
43
 
44
- ## Accuracy
45
 
46
- | Language | Accuracy | Macro F1 |
47
- |----------|----------|----------|
48
- | EN | 99.2% | 99.2% |
49
- | NL | 98.8% | 98.8% |
50
- | FR | 97.1% | 97.1% |
51
- | IT | 97.0% | 97.0% |
52
- | PT | 95.4% | 95.4% |
53
- | DE | 85.6% | 84.9% |
54
- | ES | 74.6% | 72.7% |
55
 
56
- ## Inference
57
 
58
- ```python
59
- import onnxruntime as rt, numpy as np, json
60
 
61
- sess = rt.InferenceSession("sentence_type_EN_0.8.0.onnx")
62
- classes = json.loads(sess.get_modelmeta().custom_metadata_map["classes"])
63
- inp = np.array(["Who invented the telephone?"], dtype=object)
64
- label_idx, probs = sess.run(None, {"input": inp})
65
- print(classes[int(label_idx[0])]) # wh_question
66
- ```
 
1
+ ---
2
+ language:
3
+ - en
4
+ - de
5
+ - es
6
+ - fr
7
+ - it
8
+ - nl
9
+ - pt
10
+ license: apache-2.0
11
+ tags:
12
+ - sentence-classification
13
+ - text-classification
14
+ - onnx
15
+ - multilingual
16
+ datasets:
17
+ - TigreGotico/sentence-types-multilingual
18
+ ---
19
 
20
+ # sentence-types
21
 
22
+ Multilingual sentence-type classifiers (ONNX) trained on
23
+ [TigreGotico/sentence-types-multilingual](https://huggingface.co/datasets/TigreGotico/sentence-types-multilingual)
24
+ (9,900 balanced samples per language, 6 classes).
25
 
26
+ Used by [little_questions](https://github.com/OpenJarbas/little_questions).
27
 
28
+ ## Classes
29
 
30
+ `command`, `exclamation`, `polar_question`, `request`, `statement`, `wh_question`
31
 
32
+ ## Models
33
 
34
+ | File | Language |
35
+ |------|----------|
36
+ | `sentence_type_EN_0.8.0.onnx` | English |
37
  | `sentence_type_DE_0.8.0.onnx` | German |
38
  | `sentence_type_ES_0.8.0.onnx` | Spanish |
39
  | `sentence_type_FR_0.8.0.onnx` | French |
 
41
  | `sentence_type_NL_0.8.0.onnx` | Dutch |
42
  | `sentence_type_PT_0.8.0.onnx` | Portuguese |
43
 
44
+ ## Accuracy
45
 
46
+ | Language | Accuracy | Macro F1 |
47
+ |----------|----------|----------|
48
+ | EN | 99.2% | 99.2% |
49
+ | NL | 98.8% | 98.8% |
50
+ | FR | 97.1% | 97.1% |
51
+ | IT | 97.0% | 97.0% |
52
+ | PT | 95.4% | 95.4% |
53
+ | DE | 85.6% | 84.9% |
54
+ | ES | 74.6% | 72.7% |
55
 
56
+ ## Inference
57
 
58
+ ```python
59
+ import onnxruntime as rt, numpy as np, json
60
 
61
+ sess = rt.InferenceSession("sentence_type_EN_0.8.0.onnx")
62
+ classes = json.loads(sess.get_modelmeta().custom_metadata_map["classes"])
63
+ inp = np.array(["Who invented the telephone?"], dtype=object)
64
+ label_idx, probs = sess.run(None, {"input": inp})
65
+ print(classes[int(label_idx[0])]) # wh_question
66
+ ```