at2507 commited on
Commit
ed4c499
1 Parent(s): 04becaa

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -98,15 +98,17 @@ def generate_results(input):
98
  df_output = pd.read_json(dataframe_output(cosine_sum_by_name))
99
  print(df_output)
100
  # df_output = dataframe_output(cosine_sum_by_name)
 
 
101
  print("JSON created...")
102
  subset = df_output.head(10) # Select the first 10 rows
103
 
104
- return subset
105
 
106
  iface = gr.Interface(
107
  fn=generate_results,
108
  inputs=gr.inputs.Textbox(label="What kind of mentor are you looking for?"),
109
- outputs=gr.outputs.Dataframe(type="pandas"),
110
  title="SharpestMinds Mentor Recommender Semantic Search App",
111
  description="Converts a string query into an embedding, and then compares the aggregate cosine similarity by mentor.",
112
  )
 
98
  df_output = pd.read_json(dataframe_output(cosine_sum_by_name))
99
  print(df_output)
100
  # df_output = dataframe_output(cosine_sum_by_name)
101
+ top_10 = top_10[['name','id', 'tokenized_sentences', 'cos_sim' ]]
102
+ sentence_output = pd.read_json(dataframe_output(top_10))
103
  print("JSON created...")
104
  subset = df_output.head(10) # Select the first 10 rows
105
 
106
+ return subset, sentence_output
107
 
108
  iface = gr.Interface(
109
  fn=generate_results,
110
  inputs=gr.inputs.Textbox(label="What kind of mentor are you looking for?"),
111
+ outputs=[gr.outputs.Dataframe(type="pandas"), gr.outputs.Dataframe(type="pandas")],
112
  title="SharpestMinds Mentor Recommender Semantic Search App",
113
  description="Converts a string query into an embedding, and then compares the aggregate cosine similarity by mentor.",
114
  )