File size: 1,680 Bytes
3df82af 9b89db9 3df82af 853f4b2 e21a76b b74fba4 74fa959 e21a76b 50bd490 ccc24c9 fcef86e e21a76b fcef86e e21a76b 793c042 e21a76b 3df82af |
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
---
license: apache-2.0
language:
- it
- fr
- de
- es
- en
base_model:
- google-bert/bert-base-multilingual-cased
pipeline_tag: text-classification
library_name: transformers
---
# π Multilingual Intent Classifier β Language Switching
This model is a fine-tuned multilingual BERT (`bert-base-multilingual-cased`) for intent **classification** of **language-switching** requests.
It recognizes when a user wants to change the conversation language and supports 5 language:
- `english`
- `italian`
- `german`
- `spanish`
- `french`
## It recognizes even other class of text like:
- `other` (generic sentences not related to language switching)
- `not_allowed` (unsupported languages)
## π Training Data
- ~6,000 training examples
- Short conversational sentences (e.g. "Can we switch to English?", "Vorrei parlare in italiano", "Nein, bitte auf Deutsch"), and pieaces of conversation steps
- Languages covered: English, Italian, German, Spanish, French
- `not_allowed` and `other` provide robustness for real-world inputs
---
## π Usage with π€ Transformers
You can use the model directly with the `pipeline` API:
```python
from transformers import pipeline
# Replace with the actual model repo
model_name = "software-si/change-language-intent"
classifier = pipeline(
task="text-classification",
model=model_name,
tokenizer=model_name,
return_all_scores=True
)
texts = [
"Vorrei parlare in italiano",
"Can we switch to English?",
"Nein, bitte auf Deutsch"
]
results = classifier(texts)
for text, res in zip(texts, results):
print(f"\nInput: {text}")
for r in res:
print(f" {r['label']}: {r['score']:.4f}") |