Update djezzy.py
Browse files
djezzy.py
CHANGED
@@ -66,11 +66,11 @@ def pip(question):
|
|
66 |
bi_grammes_lower=[mot.lower() for mot in bi_grammes]
|
67 |
# Trouver les mots de la question qui sont dans le tableau
|
68 |
mots_trouves1 = [mots_a_verifier_lower[mot] for mot in mots_a_verifier_lower if mot in bi_grammes_lower]
|
69 |
-
|
70 |
-
|
71 |
# Afficher les mots trouvés
|
72 |
|
73 |
-
|
74 |
if not mots_trouves:
|
75 |
|
76 |
similarities = [cosine_similarity(doc.reshape(1,-1), query_embedding_array.reshape(1,-1)) for doc in docs_embeddings]
|
|
|
66 |
bi_grammes_lower=[mot.lower() for mot in bi_grammes]
|
67 |
# Trouver les mots de la question qui sont dans le tableau
|
68 |
mots_trouves1 = [mots_a_verifier_lower[mot] for mot in mots_a_verifier_lower if mot in bi_grammes_lower]
|
69 |
+
if not mots_trouves1:
|
70 |
+
mots_trouves1 = [mots_a_verifier_lower[mot] for mot in mots_a_verifier_lower if mot in mots_question_lower ]
|
71 |
# Afficher les mots trouvés
|
72 |
|
73 |
+
mots_trouves=mots_trouves1
|
74 |
if not mots_trouves:
|
75 |
|
76 |
similarities = [cosine_similarity(doc.reshape(1,-1), query_embedding_array.reshape(1,-1)) for doc in docs_embeddings]
|