From 0afbf391e31850a0e75c67f0265cde3b812e1cbe Mon Sep 17 00:00:00 2001 From: Patrick Bassner Date: Fri, 29 Nov 2024 14:57:18 +0100 Subject: [PATCH] Tell Iris to not use links if not available --- app/pipeline/prompts/citation_prompt.txt | 5 +++++ app/pipeline/shared/citation_pipeline.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/pipeline/prompts/citation_prompt.txt b/app/pipeline/prompts/citation_prompt.txt index f69e885c..1d785b0b 100644 --- a/app/pipeline/prompts/citation_prompt.txt +++ b/app/pipeline/prompts/citation_prompt.txt @@ -15,6 +15,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit [1]. Ded do eiusmod temp [2] Lecture 2, Unit B, page 5,25. " +Note: If there is no link available, please do not include the link in the citation. For example, if citation 1 does not have a link, it should look like this: +[1] "Lecture title", "Lecture unit title", "page number" +but if citation 2 has a link, it should look like this: +[2] "Lecture title", "Lecture unit title", "page number" + Here are the answer and the paragraphs: Answer without citations: diff --git a/app/pipeline/shared/citation_pipeline.py b/app/pipeline/shared/citation_pipeline.py index 01e96e2b..22e13360 100644 --- a/app/pipeline/shared/citation_pipeline.py +++ b/app/pipeline/shared/citation_pipeline.py @@ -57,7 +57,7 @@ def create_formatted_string(self, paragraphs): paragraph.get(LectureSchema.LECTURE_NAME.value), paragraph.get(LectureSchema.LECTURE_UNIT_NAME.value), paragraph.get(LectureSchema.PAGE_NUMBER.value), - paragraph.get(LectureSchema.LECTURE_UNIT_LINK.value), + paragraph.get(LectureSchema.LECTURE_UNIT_LINK.value) or "No link available", paragraph.get(LectureSchema.PAGE_TEXT_CONTENT.value), ) formatted_string += lct