Spaces:
Running
Running
..
Browse files
app.py
CHANGED
@@ -32,9 +32,36 @@ bert_model_name = "bert-base-uncased"
|
|
32 |
bert_tokenizer = AutoTokenizer.from_pretrained(bert_model_name)
|
33 |
bert_model = BertForSequenceClassification.from_pretrained(bert_model_name, num_labels=3).to(device)
|
34 |
|
35 |
-
#
|
36 |
-
darija_topic_labels = [
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
def transcribe_audio(audio):
|
40 |
"""Convert audio to text, translate it, and classify topics in both Darija and English."""
|
|
|
32 |
bert_tokenizer = AutoTokenizer.from_pretrained(bert_model_name)
|
33 |
bert_model = BertForSequenceClassification.from_pretrained(bert_model_name, num_labels=3).to(device)
|
34 |
|
35 |
+
# Libellés en Darija (Arabe et Latin)
|
36 |
+
darija_topic_labels = [
|
37 |
+
"مشكيل ف الشبكة (Mochkil f réseau)", # Problème de réseau
|
38 |
+
"مشكيل ف الانترنت (Mochkil f internet)", # Problème d'Internet
|
39 |
+
"مشكيل ف الفاتورة (Mochkil f l'factura)", # Problème de facturation et paiement
|
40 |
+
"مشكيل ف التعبئة (Mochkil f l'recharge)", # Problème de recharge et forfaits
|
41 |
+
"مشكيل ف التطبيق (Mochkil f l'application)", # Problème avec l’application (Orange et Moi...)
|
42 |
+
"مشكيل ف بطاقة SIM (Mochkil f carte SIM)", # Problème avec la carte SIM
|
43 |
+
"مساعدة تقنية (Mosa3ada technique)", # Assistance technique
|
44 |
+
"العروض والتخفيضات (Offres w promotions)", # Offres et promotions
|
45 |
+
"طلب معلومات (Talab l'ma3loumat)", # Demande d'information
|
46 |
+
"شكاية (Chikaya)", # Réclamation
|
47 |
+
"حاجة أخرى (Chi haja okhra)" # Autre
|
48 |
+
]
|
49 |
+
|
50 |
+
# Libellés en Anglais
|
51 |
+
english_topic_labels = [
|
52 |
+
"Network Issue",
|
53 |
+
"Internet Issue",
|
54 |
+
"Billing & Payment Issue",
|
55 |
+
"Recharge & Plans",
|
56 |
+
"App Issue",
|
57 |
+
"SIM Card Issue",
|
58 |
+
"Technical Support",
|
59 |
+
"Offers & Promotions",
|
60 |
+
"General Inquiry",
|
61 |
+
"Complaint",
|
62 |
+
"Other"
|
63 |
+
]
|
64 |
+
|
65 |
|
66 |
def transcribe_audio(audio):
|
67 |
"""Convert audio to text, translate it, and classify topics in both Darija and English."""
|