Validation 27/03/22 - 21h21
parent
f97f9e2a6f
commit
5035c1c26d
13017
Log/log_file.log
13017
Log/log_file.log
File diff suppressed because it is too large
Load Diff
11
class_mgt.py
11
class_mgt.py
|
@ -887,27 +887,16 @@ def get_class(diction):
|
|||
'''
|
||||
Statistique : Insertion du recherche - resultat '''
|
||||
ret_val_tmp = coll_search_result.insert_one(mydict_combined)
|
||||
if (ret_val_tmp is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de mettre à jour la table des resultat"
|
||||
" d'une recherche de formation. Voir _id = ")
|
||||
|
||||
if (ret_val_tmp is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de mettre à jour la table des resultat"
|
||||
" d'une recherche de formation. Voir _id = ")
|
||||
return False, "Impossible de faire un affichage detaillé "
|
||||
|
||||
|
||||
|
||||
|
||||
mycommon.myprint(str(retVal))
|
||||
user = retVal
|
||||
RetObject.append(JSONEncoder().encode(user))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,42 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,renforc,1,0.11,8866,default
|
||||
1,1,comptabilit,1,0.11,8866,default
|
||||
2,2,fondamental,1,0.11,8866,default
|
||||
3,3,semain,2,0.22,8866,default
|
||||
4,4,programm,1,0.11,8866,default
|
||||
5,5,def,1,0.11,8866,default
|
||||
6,6,7,1,0.11,8866,default
|
||||
7,7,publiqu,1,0.11,8866,default
|
||||
0,0,"
|
||||
|
||||
",1,0.02,mysy_ytubes_04,default
|
||||
1,1,analys,1,0.02,mysy_ytubes_04,default
|
||||
2,2,bt,1,0.02,mysy_ytubes_04,default
|
||||
3,3,licenc,1,0.02,mysy_ytubes_04,default
|
||||
4,4,charg,1,0.02,mysy_ytubes_04,default
|
||||
5,5,notion,1,0.02,mysy_ytubes_04,default
|
||||
6,6,cout,3,0.05,mysy_ytubes_04,default
|
||||
7,7,analyt,1,0.02,mysy_ytubes_04,default
|
||||
8,8,ge,3,0.05,mysy_ytubes_04,default
|
||||
9,9,gratuit,1,0.02,mysy_ytubes_04,default
|
||||
10,10,depart,1,0.02,mysy_ytubes_04,default
|
||||
11,11,iut,1,0.02,mysy_ytubes_04,default
|
||||
12,12,comptabilit,6,0.1,mysy_ytubes_04,default
|
||||
13,13,different,1,0.02,mysy_ytubes_04,default
|
||||
14,14,niveau,1,0.02,mysy_ytubes_04,default
|
||||
15,15,prix,1,0.02,mysy_ytubes_04,default
|
||||
16,16,professeur,1,0.02,mysy_ytubes_04,default
|
||||
17,17,sorbon,1,0.02,mysy_ytubes_04,default
|
||||
18,18,introduct,1,0.02,mysy_ytubes_04,default
|
||||
19,19,nord,1,0.02,mysy_ytubes_04,default
|
||||
20,20,cour,3,0.05,mysy_ytubes_04,default
|
||||
21,21,incorpore,1,0.02,mysy_ytubes_04,default
|
||||
22,22,lign,1,0.02,mysy_ytubes_04,default
|
||||
23,23,universit,1,0.02,mysy_ytubes_04,default
|
||||
24,24,stmg,1,0.02,mysy_ytubes_04,default
|
||||
25,25,villetan,1,0.02,mysy_ytubes_04,default
|
||||
26,26,dcg,1,0.02,mysy_ytubes_04,default
|
||||
27,27,marg,1,0.02,mysy_ytubes_04,default
|
||||
28,28,general,1,0.02,mysy_ytubes_04,default
|
||||
29,29,paris,1,0.02,mysy_ytubes_04,default
|
||||
30,30,corinn,1,0.02,mysy_ytubes_04,default
|
||||
31,31,debut,1,0.02,mysy_ytubes_04,default
|
||||
32,32,calcul,1,0.02,mysy_ytubes_04,default
|
||||
33,33,1,2,0.03,mysy_ytubes_04,default
|
||||
34,34,gestion,4,0.07,mysy_ytubes_04,default
|
||||
35,35,"
|
||||
",8,0.13,mysy_ytubes_04,default
|
||||
36,36,zambotto,1,0.02,mysy_ytubes_04,default
|
||||
37,37,resultat,1,0.02,mysy_ytubes_04,default
|
||||
|
|
|
|
@ -423,6 +423,17 @@ def ela_recherche_tokens(sentence):
|
|||
tab_tokens = ls.Ela_Tokenize(sentence)
|
||||
tab_tokens2 = ls.Ela_remove_stop_words(tab_tokens)
|
||||
tab_tokens3 = ls.Ela_remove_pronoun(tab_tokens2)
|
||||
'''
|
||||
note : 26/03 : Faire evolution la fonction ici pour
|
||||
gerer les mots qui ne doivent pas etre racinisé comme le cas du mot "Responsive"
|
||||
|
||||
De manière plus globale, il faudrait exclure certains mot de la racinisation.
|
||||
|
||||
'''
|
||||
print(" VERIF : "+str(tab_tokens3))
|
||||
for mot in tab_tokens3:
|
||||
mycommon.check_word_in_fr_dict(str(mot))
|
||||
|
||||
tab_tokens4 = ls.Ela_stemmize(tab_tokens3)
|
||||
tab_tokens4.sort()
|
||||
|
||||
|
@ -437,7 +448,7 @@ def ela_recherche_tokens(sentence):
|
|||
|
||||
|
||||
for token in tab_tokens4:
|
||||
print(token)
|
||||
print(" #### Le tooken recherché est : "+str(token))
|
||||
for doc in collection.find({"mots":token, "source_field":"default"}):
|
||||
#print(" Trouvé dans le cours N° "+str(doc["id_formation"]))
|
||||
if str(doc["id_formation"]) not in tab_training_id :
|
||||
|
@ -490,7 +501,7 @@ def ela_recherche_tokens_source_field(sentence, source_fied=""):
|
|||
|
||||
|
||||
for token in tab_tokens4:
|
||||
print(token)
|
||||
print(" #### Token rechercher dans l'index est : "+str(token))
|
||||
for doc in collection.find({"mots":token, "source_field":source_fied}):
|
||||
#print(" Trouvé dans le cours N° "+str(doc["id_formation"]))
|
||||
if str(doc["id_formation"]) not in tab_training_id :
|
||||
|
|
|
@ -1,9 +1,39 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 renforc 1 0.11 8866 default
|
||||
1 comptabilit 1 0.11 8866 default
|
||||
2 fondamental 1 0.11 8866 default
|
||||
3 semain 2 0.22 8866 default
|
||||
4 programm 1 0.11 8866 default
|
||||
5 def 1 0.11 8866 default
|
||||
6 7 1 0.11 8866 default
|
||||
7 publiqu 1 0.11 8866 default
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 \n\n 1 0.02 mysy_ytubes_04 default
|
||||
1 analys 1 0.02 mysy_ytubes_04 default
|
||||
2 bt 1 0.02 mysy_ytubes_04 default
|
||||
3 licenc 1 0.02 mysy_ytubes_04 default
|
||||
4 charg 1 0.02 mysy_ytubes_04 default
|
||||
5 notion 1 0.02 mysy_ytubes_04 default
|
||||
6 cout 3 0.05 mysy_ytubes_04 default
|
||||
7 analyt 1 0.02 mysy_ytubes_04 default
|
||||
8 ge 3 0.05 mysy_ytubes_04 default
|
||||
9 gratuit 1 0.02 mysy_ytubes_04 default
|
||||
10 depart 1 0.02 mysy_ytubes_04 default
|
||||
11 iut 1 0.02 mysy_ytubes_04 default
|
||||
12 comptabilit 6 0.1 mysy_ytubes_04 default
|
||||
13 different 1 0.02 mysy_ytubes_04 default
|
||||
14 niveau 1 0.02 mysy_ytubes_04 default
|
||||
15 prix 1 0.02 mysy_ytubes_04 default
|
||||
16 professeur 1 0.02 mysy_ytubes_04 default
|
||||
17 sorbon 1 0.02 mysy_ytubes_04 default
|
||||
18 introduct 1 0.02 mysy_ytubes_04 default
|
||||
19 nord 1 0.02 mysy_ytubes_04 default
|
||||
20 cour 3 0.05 mysy_ytubes_04 default
|
||||
21 incorpore 1 0.02 mysy_ytubes_04 default
|
||||
22 lign 1 0.02 mysy_ytubes_04 default
|
||||
23 universit 1 0.02 mysy_ytubes_04 default
|
||||
24 stmg 1 0.02 mysy_ytubes_04 default
|
||||
25 villetan 1 0.02 mysy_ytubes_04 default
|
||||
26 dcg 1 0.02 mysy_ytubes_04 default
|
||||
27 marg 1 0.02 mysy_ytubes_04 default
|
||||
28 general 1 0.02 mysy_ytubes_04 default
|
||||
29 paris 1 0.02 mysy_ytubes_04 default
|
||||
30 corinn 1 0.02 mysy_ytubes_04 default
|
||||
31 debut 1 0.02 mysy_ytubes_04 default
|
||||
32 calcul 1 0.02 mysy_ytubes_04 default
|
||||
33 1 2 0.03 mysy_ytubes_04 default
|
||||
34 gestion 4 0.07 mysy_ytubes_04 default
|
||||
35 \n 8 0.13 mysy_ytubes_04 default
|
||||
36 zambotto 1 0.02 mysy_ytubes_04 default
|
||||
37 resultat 1 0.02 mysy_ytubes_04 default
|
|
@ -277,3 +277,37 @@ def tryInt(val):
|
|||
return myfloat
|
||||
except ValueError:
|
||||
return 0
|
||||
|
||||
|
||||
'''
|
||||
Cette fonction verifie si un mot est dans le dictionnaire français - une table interne
|
||||
si non, le mot est enregistré dans une table pour traitement utérieur
|
||||
'''
|
||||
|
||||
|
||||
def check_word_in_fr_dict(mot=None):
|
||||
try:
|
||||
print("#### analuse du mot "+str(mot))
|
||||
col_name = dbname["list_mots_fr"]
|
||||
col_name_not_fr = dbname["list_mots_not_fr"]
|
||||
mydata = {}
|
||||
val_tmp = col_name.count_documents({'mot': str(mot)})
|
||||
|
||||
if (val_tmp <= 0):
|
||||
myprint(" Le mot '" + mot + "' n'existe pas dans le dictionnaire")
|
||||
mydata['mot'] = mot
|
||||
mydata['treated'] = int("0")
|
||||
mydata['update_date'] = datetime.now()
|
||||
ret_val_tmp = col_name_not_fr.insert_one(mydata)
|
||||
|
||||
if (ret_val_tmp is False):
|
||||
print(" Impossible d'enregistrer le '" + mot + "'")
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
return True
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False
|
Loading…
Reference in New Issue