abdullahmeda commited on
Commit
6017324
1 Parent(s): b545cde
Files changed (2) hide show
  1. app.py +2 -1
  2. cw2.py +0 -2
app.py CHANGED
@@ -124,7 +124,8 @@ with gr.Blocks(css="""
124
  req_5_submit = gr.Button(value="Submit", elem_id="submit_button")
125
  with gr.Column(scale=1):
126
  also_likes_df = gr.Dataframe(value=also_like(globals()[f"data_{selected_dataset_5.value}"], t5_doc_uuid.value, t5_visitor_uuid.value,
127
- t5_sorting.value == 'Ascending'))
 
128
 
129
  gr.Markdown("""
130
  For the above “also like” functionality, this section generates a graph that displays the relationship between the input document and all documents that have been found as “also like” documents (and only these documents)
 
124
  req_5_submit = gr.Button(value="Submit", elem_id="submit_button")
125
  with gr.Column(scale=1):
126
  also_likes_df = gr.Dataframe(value=also_like(globals()[f"data_{selected_dataset_5.value}"], t5_doc_uuid.value, t5_visitor_uuid.value,
127
+ t5_sorting.value == 'Ascending'),
128
+ headers=["Document UUID", "Count"])
129
 
130
  gr.Markdown("""
131
  For the above “also like” functionality, this section generates a graph that displays the relationship between the input document and all documents that have been found as “also like” documents (and only these documents)
cw2.py CHANGED
@@ -100,10 +100,8 @@ def also_like(data, doc_uuid, visitor_uuid, ascending, req_5=True):
100
  return pd.DataFrame(y)
101
  try:
102
  if ascending:
103
- print("Not Here")
104
  return pd.DataFrame(y).groupby(1).count().nsmallest(10, [0]).reset_index().tail(-1)
105
  else:
106
- print("Here")
107
  return pd.DataFrame(y).groupby(1).count().nlargest(10, [0]).reset_index().tail(-1)
108
  except KeyError:
109
  print("Exception thrown")
 
100
  return pd.DataFrame(y)
101
  try:
102
  if ascending:
 
103
  return pd.DataFrame(y).groupby(1).count().nsmallest(10, [0]).reset_index().tail(-1)
104
  else:
 
105
  return pd.DataFrame(y).groupby(1).count().nlargest(10, [0]).reset_index().tail(-1)
106
  except KeyError:
107
  print("Exception thrown")