Views
No views yet
bert-base-multilingual-cased) for intent classification of language-switching requests.englishitaliangermanspanishfrenchother (generic sentences not related to language switching)not_allowed (unsupported languages)not_allowed and other provide robustness for real-world inputspipeline API:1from transformers import pipeline
2
3# Replace with the actual model repo
4model_name = "software-si/change-language-intent"
5
6classifier = pipeline(
7 task="text-classification",
8 model=model_name,
9 tokenizer=model_name,
10 return_all_scores=True
11)
12
13texts = [
14 "Vorrei parlare in italiano",
15 "Can we switch to English?",
16 "Nein, bitte auf Deutsch"
17]
18
19results = classifier(texts)
20
21for text, res in zip(texts, results):
22 print(f"\nInput: {text}")
23 for r in res:
24 print(f" {r['label']}: {r['score']:.4f}")