Lbasara commited on
Commit
dfe37e1
·
verified ·
1 Parent(s): 1d856b6

Changement seuils proximax

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -12,6 +12,9 @@ from vicinity import Vicinity, Backend, Metric
12
  from sklearn.decomposition import TruncatedSVD
13
 
14
 
 
 
 
15
  gcantons=gpd.read_file("cantons-normandie.geojson").rename(columns={"nom": "canton"})
16
  si=gcantons.sindex
17
  def assigne_canton(row):
@@ -67,7 +70,7 @@ vicf = Vicinity.from_vectors_and_items(
67
  )
68
 
69
  query=pn.widgets.TextInput(name="Rechercher une compétence")
70
- proximax=0.68
71
 
72
 
73
  score=pn.indicators.Number(name="Score d'adéquation", value=2, visible=False,
@@ -89,7 +92,7 @@ def carte(col):
89
  score.visible=False
90
  else:
91
  test_emb=model.encode(req)
92
- selcol = [nom for (nom, dist) in vice.query(test_emb, k=200)[0] if dist<proximax]
93
  dfselcol=dfcomp[dfcomp["Compétence"].isin(selcol)]
94
  dfg=dfselcol.groupby("canton")
95
  dfa=dfg.agg(total= ("Compétence", lambda x: len(x)),
@@ -98,7 +101,7 @@ def carte(col):
98
  m=gdet.explore(column="total", tooltip=["canton", "compétence", "total"],
99
  cmap="viridis", vmax=10, tiles="CartoDB positron")
100
 
101
- res_form = [nom for (nom, dist) in vicf.query(test_emb, k=50)[0] if dist<proximax]
102
  dft=pd.DataFrame(res_form, columns=[certcol]).merge(dfform).drop_duplicates(subset=["latitude", "longitude"])
103
 
104
  for irow, row in dft.iterrows():
 
12
  from sklearn.decomposition import TruncatedSVD
13
 
14
 
15
+ proximax_emploi=0.65
16
+ proximax_formation=0.68
17
+
18
  gcantons=gpd.read_file("cantons-normandie.geojson").rename(columns={"nom": "canton"})
19
  si=gcantons.sindex
20
  def assigne_canton(row):
 
70
  )
71
 
72
  query=pn.widgets.TextInput(name="Rechercher une compétence")
73
+
74
 
75
 
76
  score=pn.indicators.Number(name="Score d'adéquation", value=2, visible=False,
 
92
  score.visible=False
93
  else:
94
  test_emb=model.encode(req)
95
+ selcol = [nom for (nom, dist) in vice.query(test_emb, k=200)[0] if dist<proximax_emploi]
96
  dfselcol=dfcomp[dfcomp["Compétence"].isin(selcol)]
97
  dfg=dfselcol.groupby("canton")
98
  dfa=dfg.agg(total= ("Compétence", lambda x: len(x)),
 
101
  m=gdet.explore(column="total", tooltip=["canton", "compétence", "total"],
102
  cmap="viridis", vmax=10, tiles="CartoDB positron")
103
 
104
+ res_form = [nom for (nom, dist) in vicf.query(test_emb, k=50)[0] if dist<proximax_formation]
105
  dft=pd.DataFrame(res_form, columns=[certcol]).merge(dfform).drop_duplicates(subset=["latitude", "longitude"])
106
 
107
  for irow, row in dft.iterrows():