Update main.py
Browse files
main.py
CHANGED
|
@@ -309,6 +309,17 @@ def datavisualisation_chiffres_cles_emplois(url):
|
|
| 309 |
def listToString(list):
|
| 310 |
return str(list)
|
| 311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
def arrayToString(array):
|
| 313 |
arrayList = []
|
| 314 |
|
|
@@ -467,6 +478,8 @@ async def construction_NCS(competenceList, chatProfile):
|
|
| 467 |
emploisST = context.to_string(index = False)
|
| 468 |
if chatProfile == 'ROMESKILLS':
|
| 469 |
romeListArray = cl.user_session.get("codeRomeArray")
|
|
|
|
|
|
|
| 470 |
ficheClesMetier = await document_chiffres_cles_emplois("https://dataemploi.francetravail.fr/metier/chiffres-cles/NAT/FR/", romeListArray)
|
| 471 |
contentChatBot = str(emploisST).replace('[','').replace(']','').replace('{','').replace('}','') + ficheClesMetier
|
| 472 |
finals_df = context[['intitule','typeContratLibelle','experienceLibelle','competences','description','qualitesProfessionnelles','salaire','lieuTravail','formations']].copy()
|
|
@@ -730,6 +743,14 @@ async def API_France_Travail(romeListArray):
|
|
| 730 |
results_df = pd.DataFrame(results)
|
| 731 |
return results_df
|
| 732 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 733 |
@cl.step(type="tool")
|
| 734 |
async def creation_liste_code_Rome(competence, categorie):
|
| 735 |
docsearch = await connexion_vector_database()
|
|
|
|
| 309 |
def listToString(list):
|
| 310 |
return str(list)
|
| 311 |
|
| 312 |
+
def arrayOfSecteur(array):
|
| 313 |
+
df_naf = pd.read_csv("./public/secteur_naf_v01.csv")
|
| 314 |
+
df_naf = df_naf[['libelle_secteur_naf', 'code_rome']].copy()
|
| 315 |
+
df_naf = df_naf.groupby(df_naf['code_rome'], as_index=False).agg({'libelle_secteur_naf': '; '.join})
|
| 316 |
+
|
| 317 |
+
df_rome = pd.DataFrame({'code_rome': array})
|
| 318 |
+
|
| 319 |
+
df_romeNaf = pd.merge(df_rome, df_naf, on="code_rome")
|
| 320 |
+
df_secteur = df_romeNaf[['libelle_secteur_naf']].copy()
|
| 321 |
+
return df_secteur.values.tolist()
|
| 322 |
+
|
| 323 |
def arrayToString(array):
|
| 324 |
arrayList = []
|
| 325 |
|
|
|
|
| 478 |
emploisST = context.to_string(index = False)
|
| 479 |
if chatProfile == 'ROMESKILLS':
|
| 480 |
romeListArray = cl.user_session.get("codeRomeArray")
|
| 481 |
+
stringSecteur = await creation_liste_entreprises(arrayOfSecteur(romeListArray))
|
| 482 |
+
print(stringSecteur)
|
| 483 |
ficheClesMetier = await document_chiffres_cles_emplois("https://dataemploi.francetravail.fr/metier/chiffres-cles/NAT/FR/", romeListArray)
|
| 484 |
contentChatBot = str(emploisST).replace('[','').replace(']','').replace('{','').replace('}','') + ficheClesMetier
|
| 485 |
finals_df = context[['intitule','typeContratLibelle','experienceLibelle','competences','description','qualitesProfessionnelles','salaire','lieuTravail','formations']].copy()
|
|
|
|
| 743 |
results_df = pd.DataFrame(results)
|
| 744 |
return results_df
|
| 745 |
|
| 746 |
+
@cl.step(type="tool")
|
| 747 |
+
async def creation_liste_entreprises(arrayOfsecteur):
|
| 748 |
+
docsearch = await connexion_vector_database()
|
| 749 |
+
for i in range(0, len(arraySecteur)):
|
| 750 |
+
retrieve_comp = docsearch.similarity_search(arraySecteur[i][0], k=1, filter={"categorie": {"$eq": "inpiSecteur"}})
|
| 751 |
+
codeSecteur = retrieve_comp[0].metadata['codefinal']
|
| 752 |
+
return codeSecteur
|
| 753 |
+
|
| 754 |
@cl.step(type="tool")
|
| 755 |
async def creation_liste_code_Rome(competence, categorie):
|
| 756 |
docsearch = await connexion_vector_database()
|