Update app.py
Browse files
app.py
CHANGED
@@ -55,20 +55,75 @@ Pour moi, une bonne IA éducative ne doit pas chercher à enseigner. Cette tâch
|
|
55 |
is_first_interaction = True
|
56 |
|
57 |
def determine_response_type(message):
|
|
|
58 |
short_response_keywords = [
|
59 |
-
"salut", "
|
60 |
-
"
|
61 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
]
|
|
|
|
|
63 |
long_response_keywords = [
|
64 |
-
"présente", "
|
65 |
-
"
|
66 |
-
"
|
67 |
-
"
|
68 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
]
|
70 |
-
|
71 |
message_lower = message.lower()
|
|
|
72 |
if any(keyword in message_lower for keyword in short_response_keywords):
|
73 |
return "short"
|
74 |
elif any(keyword in message_lower for keyword in long_response_keywords):
|
@@ -298,7 +353,7 @@ def generate_statistics():
|
|
298 |
return f"Nombre total d'interactions : {total_interactions}", fig_likes, fig_evolution, history
|
299 |
|
300 |
with gr.Blocks() as demo:
|
301 |
-
gr.Markdown("# 🌟 Virtuellement Lucas
|
302 |
|
303 |
gr.Markdown("""
|
304 |
## ⚠️ Attention ! ⚠️
|
|
|
55 |
is_first_interaction = True
|
56 |
|
57 |
def determine_response_type(message):
|
58 |
+
# Liste améliorée de mots-clés pour les réponses courtes
|
59 |
short_response_keywords = [
|
60 |
+
"salut", "Salut", "SALUT",
|
61 |
+
"bonjour", "Bonjour", "BONJOUR",
|
62 |
+
"ça va", "ca va", "Ça va", "Ca va", "ÇA VA", "CA VA",
|
63 |
+
"comment tu vas", "Comment tu vas", "COMMENT TU VAS",
|
64 |
+
"comment vas tu", "Comment vas tu", "COMMENT VAS TU",
|
65 |
+
"comment vas-tu", "Comment vas-tu", "COMMENT VAS-TU",
|
66 |
+
"quoi de neuf", "Quoi de neuf", "QUOI DE NEUF",
|
67 |
+
"coucou", "Coucou", "COUCOU",
|
68 |
+
"hello", "Hello", "HELLO",
|
69 |
+
"hi", "Hi", "HI",
|
70 |
+
"tu fais quoi", "Tu fais quoi", "TU FAIS QUOI",
|
71 |
+
"?!", "?!?", "!?",
|
72 |
+
"bye", "Bye", "BYE",
|
73 |
+
"au revoir", "Au revoir", "AU REVOIR",
|
74 |
+
"à plus", "À plus", "A plus", "a plus", "À PLUS", "A PLUS",
|
75 |
+
"bonsoir", "Bonsoir", "BONSOIR",
|
76 |
+
"merci", "Merci", "MERCI",
|
77 |
+
"d'accord", "D'accord", "D'ACCORD",
|
78 |
+
"ok", "Ok", "OK",
|
79 |
+
"super", "Super", "SUPER",
|
80 |
+
"cool", "Cool", "COOL",
|
81 |
+
"génial", "Génial", "GENIAL",
|
82 |
+
"wow", "Wow", "WOW"
|
83 |
]
|
84 |
+
|
85 |
+
# Liste améliorée de mots-clés pour les réponses longues
|
86 |
long_response_keywords = [
|
87 |
+
"présente", "Présente", "PRÉSENTE", "presente", "Presente", "PRESENTE",
|
88 |
+
"parle moi de", "Parle moi de", "PARLE MOI DE",
|
89 |
+
"parle-moi de", "Parle-moi de", "PARLE-MOI DE",
|
90 |
+
"explique", "Explique", "EXPLIQUE",
|
91 |
+
"raconte", "Raconte", "RACONTE",
|
92 |
+
"décris", "Décris", "DÉCRIS", "decris", "Decris", "DECRIS",
|
93 |
+
"dis moi", "Dis moi", "DIS MOI",
|
94 |
+
"dis-moi", "Dis-moi", "DIS-MOI",
|
95 |
+
"détaille", "Détaille", "DÉTAILLE", "detaille", "Detaille", "DETAILLE",
|
96 |
+
"précise", "Précise", "PRÉCISE", "precise", "Precise", "PRECISE",
|
97 |
+
"vision", "Vision", "VISION",
|
98 |
+
"t'es qui", "T'es qui", "T'ES QUI",
|
99 |
+
"tu es qui", "Tu es qui", "TU ES QUI",
|
100 |
+
"t es qui", "T es qui", "T ES QUI",
|
101 |
+
"pourquoi", "Pourquoi", "POURQUOI",
|
102 |
+
"comment", "Comment", "COMMENT",
|
103 |
+
"quel est", "Quel est", "QUEL EST",
|
104 |
+
"quelle est", "Quelle est", "QUELLE EST",
|
105 |
+
"peux-tu développer", "Peux-tu développer", "PEUX-TU DÉVELOPPER",
|
106 |
+
"peux tu developper", "Peux tu developper", "PEUX TU DEVELOPPER",
|
107 |
+
"en quoi consiste", "En quoi consiste", "EN QUOI CONSISTE",
|
108 |
+
"qu'est-ce que", "Qu'est-ce que", "QU'EST-CE QUE",
|
109 |
+
"que penses-tu de", "Que penses-tu de", "QUE PENSES-TU DE",
|
110 |
+
"analyse", "Analyse", "ANALYSE",
|
111 |
+
"compare", "Compare", "COMPARE",
|
112 |
+
"élabore sur", "Élabore sur", "ÉLABORE SUR", "elabore sur", "Elabore sur", "ELABORE SUR",
|
113 |
+
"expérience", "Expérience", "EXPÉRIENCE", "experience", "Experience", "EXPERIENCE",
|
114 |
+
"expérience pro", "Expérience pro", "EXPÉRIENCE PRO",
|
115 |
+
"experience pro", "Experience pro", "EXPERIENCE PRO",
|
116 |
+
"expérience professionnelle", "Expérience professionnelle", "EXPÉRIENCE PROFESSIONNELLE",
|
117 |
+
"experience professionnelle", "Experience professionnelle", "EXPERIENCE PROFESSIONNELLE",
|
118 |
+
"parcours", "Parcours", "PARCOURS",
|
119 |
+
"formation", "Formation", "FORMATION",
|
120 |
+
"études", "Études", "ÉTUDES", "etudes", "Etudes", "ETUDES",
|
121 |
+
"compétences", "Compétences", "COMPÉTENCES", "competences", "Competences", "COMPETENCES",
|
122 |
+
"projets", "Projets", "PROJETS",
|
123 |
+
"réalisations", "Réalisations", "RÉALISATIONS", "realisations", "Realisations", "REALISATIONS"
|
124 |
]
|
|
|
125 |
message_lower = message.lower()
|
126 |
+
|
127 |
if any(keyword in message_lower for keyword in short_response_keywords):
|
128 |
return "short"
|
129 |
elif any(keyword in message_lower for keyword in long_response_keywords):
|
|
|
353 |
return f"Nombre total d'interactions : {total_interactions}", fig_likes, fig_evolution, history
|
354 |
|
355 |
with gr.Blocks() as demo:
|
356 |
+
gr.Markdown("# 🌟 Virtuellement Lucas labs 🌟")
|
357 |
|
358 |
gr.Markdown("""
|
359 |
## ⚠️ Attention ! ⚠️
|