Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 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 |
-
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 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 |
+
```
|