Rams901 commited on
Commit
eab08cb
1 Parent(s): 9272b3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,7 +43,7 @@ def retrieve_thoughts(query, n):
43
 
44
 
45
  chunks_1 = tier_1.groupby(['_id' ]).apply(lambda x: {f"chunk_{i}": row for i, row in enumerate(x.sort_values('id')[['id', 'score','page_content']].to_dict('records'))}).values
46
- tier_1_adjusted = tier_1.groupby(['_id']).first().reset_index()[['_id', 'title', 'url', 'score']]
47
  tier_1_adjusted['ref'] = range(1, len(tier_1_adjusted) + 1 )
48
  tier_1_adjusted['chunks'] = list(chunks_1)
49
  score = tier_1.groupby(['_id' ]).apply(lambda x: x['score'].mean()).values
@@ -73,7 +73,7 @@ def qa_retrieve(query,):
73
 
74
  tier_1 = thoughts['tier 1']
75
 
76
- reference = tier_1[['_id', 'url', 'title', 'chunks', 'score']].to_dict('records')
77
 
78
  return {'Reference': reference}
79
 
 
43
 
44
 
45
  chunks_1 = tier_1.groupby(['_id' ]).apply(lambda x: {f"chunk_{i}": row for i, row in enumerate(x.sort_values('id')[['id', 'score','page_content']].to_dict('records'))}).values
46
+ tier_1_adjusted = tier_1.groupby(['_id']).first().reset_index()[['_id', 'title', 'author','url', 'score']]
47
  tier_1_adjusted['ref'] = range(1, len(tier_1_adjusted) + 1 )
48
  tier_1_adjusted['chunks'] = list(chunks_1)
49
  score = tier_1.groupby(['_id' ]).apply(lambda x: x['score'].mean()).values
 
73
 
74
  tier_1 = thoughts['tier 1']
75
 
76
+ reference = tier_1[['_id', 'url', 'author', 'title', 'chunks', 'score']].to_dict('records')
77
 
78
  return {'Reference': reference}
79