Still adjusting scaping
Browse files
app.py
CHANGED
@@ -551,11 +551,12 @@ def add_references_to_summary(summary, source_df, reference_column, url_column=N
|
|
551 |
if not sentence.strip():
|
552 |
continue
|
553 |
|
|
|
554 |
user_prompt = f"""
|
555 |
Sentence: {sentence.strip()}
|
556 |
|
557 |
Source texts:
|
558 |
-
{
|
559 |
|
560 |
Which source ID(s) did this sentence most likely come from? Return only the ID(s) separated by commas, or "unknown".
|
561 |
"""
|
|
|
551 |
if not sentence.strip():
|
552 |
continue
|
553 |
|
554 |
+
source_texts_formatted = '\n'.join([f"ID: {ref_id}, Text: {text[:500]}..." for ref_id, text in zip(reference_ids, source_texts)])
|
555 |
user_prompt = f"""
|
556 |
Sentence: {sentence.strip()}
|
557 |
|
558 |
Source texts:
|
559 |
+
{source_texts_formatted}
|
560 |
|
561 |
Which source ID(s) did this sentence most likely come from? Return only the ID(s) separated by commas, or "unknown".
|
562 |
"""
|