Lisibonny commited on
Commit
ef692c7
1 Parent(s): 2698828

Update resultados_consulta.py

Browse files
Files changed (1) hide show
  1. resultados_consulta.py +3 -2
resultados_consulta.py CHANGED
@@ -61,10 +61,11 @@ 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
- df_top_scores=df_top_scores[df_top_scores['scores'] > 0]
 
65
  st.write(df_top_scores)
66
 
67
- min=np.average(df_top_scores['scores'])+0.75*np.std(df_top_scores['scores'])
68
 
69
  return df_top_scores.index # Dataframe original con los scores
70
  # 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'])
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