From d4c58eaebb6bb21b80c53071a507e2be98fa3d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ch=C3=A9rifBALDE?= Date: Thu, 5 May 2022 15:51:03 +0200 Subject: [PATCH] 05/05/22 - 15h30 --- data_indexees.csv | 15 ++++++++++++--- ela_index_bdd_classes.py | 26 +++++++++++++------------- ela_output_test_file_pandas_2.txt | 17 +++++++++++++---- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/data_indexees.csv b/data_indexees.csv index c5972e9..c50338c 100644 --- a/data_indexees.csv +++ b/data_indexees.csv @@ -1,4 +1,13 @@ ,index,mots,occurence,moyenne,id_formation,source_field -0,0,fondamentau,1,0.33,8866,title -1,1,publique,1,0.33,8866,title -2,2,comptabilite,1,0.33,8866,title +0,0,regle,1,0.08,8866,objectif +1,1,publique,1,0.08,8866,objectif +2,2,constante,1,0.08,8866,objectif +3,3,impose,1,0.08,8866,objectif +4,4,maitriser,1,0.08,8866,objectif +5,5,evolution,1,0.08,8866,objectif +6,6,comptabilite,1,0.08,8866,objectif +7,7,appliquer,1,0.08,8866,objectif +8,8,principe,1,0.08,8866,objectif +9,9,objectif,1,0.08,8866,objectif +10,10,reglementation,1,0.08,8866,objectif +11,11,formation,1,0.08,8866,objectif diff --git a/ela_index_bdd_classes.py b/ela_index_bdd_classes.py index e1436b3..f2808b9 100644 --- a/ela_index_bdd_classes.py +++ b/ela_index_bdd_classes.py @@ -594,23 +594,23 @@ def mysy_recherche_levenshtein(tab_mot): for x in coll_name.find({'mots': v}): cmp_levenshtein = int(mycommon.levenshtein(mot, str(x['mots']))) + print(" check ### ="+str(x['mots'])) + if( len(mot) <= 5 and cmp_levenshtein <= 1): + if( str(x['mots']) not in training_mots): + training_mots.append( str(x['mots']) ) - if( len(mot) <= 5 and cmp_levenshtein <= 1): - if( str(x['mots']) not in training_mots): - training_mots.append( str(x['mots']) ) + elif( len(mot) <= 10 and cmp_levenshtein <= 2): + if( str(x['mots']) not in training_mots): + training_mots.append( str(x['mots']) ) - elif( len(mot) <= 10 and cmp_levenshtein <= 2): - if( str(x['mots']) not in training_mots): - training_mots.append( str(x['mots']) ) + elif ( cmp_levenshtein <= 3): + if (str(x['mots']) not in training_mots): + training_mots.append(str(x['mots'])) - elif ( cmp_levenshtein <= 3): - if (str(x['mots']) not in training_mots): - training_mots.append(str(x['mots'])) - - elif (cmp_levenshtein > 3): - print(" KOO cmp_levenshtein : " + mot + " CMP " + str(x['mots']) + " = " + str(cmp_levenshtein) + - " ==> id_formation" + str(x['id_formation']) + " ==> occurrence = " + str(x['occurence'])) + elif (cmp_levenshtein > 3): + print(" KOO cmp_levenshtein : " + mot + " CMP " + str(x['mots']) + " = " + str(cmp_levenshtein) + + " ==> id_formation" + str(x['id_formation']) + " ==> occurrence = " + str(x['occurence'])) return True, training_mots diff --git a/ela_output_test_file_pandas_2.txt b/ela_output_test_file_pandas_2.txt index 518052a..19f73ae 100644 --- a/ela_output_test_file_pandas_2.txt +++ b/ela_output_test_file_pandas_2.txt @@ -1,4 +1,13 @@ - mots occurence moyenne id_formation source_field -0 fondamentau 1 0.33 8866 title -1 publique 1 0.33 8866 title -2 comptabilite 1 0.33 8866 title \ No newline at end of file + mots occurence moyenne id_formation source_field +0 regle 1 0.08 8866 objectif +1 publique 1 0.08 8866 objectif +2 constante 1 0.08 8866 objectif +3 impose 1 0.08 8866 objectif +4 maitriser 1 0.08 8866 objectif +5 evolution 1 0.08 8866 objectif +6 comptabilite 1 0.08 8866 objectif +7 appliquer 1 0.08 8866 objectif +8 principe 1 0.08 8866 objectif +9 objectif 1 0.08 8866 objectif +10 reglementation 1 0.08 8866 objectif +11 formation 1 0.08 8866 objectif \ No newline at end of file