Update app.py
Browse files
app.py
CHANGED
@@ -58,8 +58,8 @@ def retrieve_thoughts(query, n):
|
|
58 |
# tier_2 = df[(df['score'] < 0.95) * (df["score"] > 0.7)]
|
59 |
|
60 |
|
61 |
-
chunks_1 = tier_1.groupby(['title', 'url'
|
62 |
-
tier_1_adjusted = tier_1.groupby(['title', 'url'
|
63 |
tier_1_adjusted['ref'] = range(1, len(tier_1_adjusted) + 1 )
|
64 |
tier_1_adjusted['content'] = chunks_1
|
65 |
|
|
|
58 |
# tier_2 = df[(df['score'] < 0.95) * (df["score"] > 0.7)]
|
59 |
|
60 |
|
61 |
+
chunks_1 = tier_1.groupby(['title', 'url']).apply(lambda x: "\n...\n".join(x.sort_values('id')['page_content'].values)).values
|
62 |
+
tier_1_adjusted = tier_1.groupby(['title', 'url').first().reset_index()[['title', 'url', 'score']]
|
63 |
tier_1_adjusted['ref'] = range(1, len(tier_1_adjusted) + 1 )
|
64 |
tier_1_adjusted['content'] = chunks_1
|
65 |
|