Spaces:
Build error
Build error
Update resultados_consulta.py
Browse files- resultados_consulta.py +1 -4
resultados_consulta.py
CHANGED
@@ -61,11 +61,8 @@ def retrieve_index(data,cosine_scores, document_index, topn=10):
|
|
61 |
data = data.set_index(document_index)
|
62 |
data['scores'] = cosine_scores
|
63 |
df_top_scores=data.reset_index().sort_values('scores',ascending=False).head(topn)
|
64 |
-
cutoff=np.average(df_top_scores['scores'])+0.75*np.std(df_top_scores['scores'])
|
65 |
df_top_scores=df_top_scores[df_top_scores['scores'] > cutoff]
|
66 |
-
st.write(df_top_scores)
|
67 |
-
|
68 |
-
|
69 |
|
70 |
return df_top_scores.index # Dataframe original con los scores
|
71 |
# del coseno en una columna nueva
|
|
|
61 |
data = data.set_index(document_index)
|
62 |
data['scores'] = cosine_scores
|
63 |
df_top_scores=data.reset_index().sort_values('scores',ascending=False).head(topn)
|
64 |
+
cutoff=np.average(df_top_scores['scores'])+0.75*np.std(df_top_scores['scores']) # Se usa una formula sugerida en la literatura como score de corte
|
65 |
df_top_scores=df_top_scores[df_top_scores['scores'] > cutoff]
|
|
|
|
|
|
|
66 |
|
67 |
return df_top_scores.index # Dataframe original con los scores
|
68 |
# del coseno en una columna nueva
|