05/05/22 - 15h30

master
ChérifBALDE 2022-05-05 15:51:03 +02:00 committed by cherif
parent 975921a9a6
commit d4c58eaebb
3 changed files with 38 additions and 20 deletions

View File

@ -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

1 index mots occurence moyenne id_formation source_field
2 0 0 fondamentau regle 1 0.33 0.08 8866 title objectif
3 1 1 publique 1 0.33 0.08 8866 title objectif
4 2 2 comptabilite constante 1 0.33 0.08 8866 title objectif
5 3 3 impose 1 0.08 8866 objectif
6 4 4 maitriser 1 0.08 8866 objectif
7 5 5 evolution 1 0.08 8866 objectif
8 6 6 comptabilite 1 0.08 8866 objectif
9 7 7 appliquer 1 0.08 8866 objectif
10 8 8 principe 1 0.08 8866 objectif
11 9 9 objectif 1 0.08 8866 objectif
12 10 10 reglementation 1 0.08 8866 objectif
13 11 11 formation 1 0.08 8866 objectif

View File

@ -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

View File

@ -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
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