From a09e1ba190c155d64ebcbfd98498621068e111de Mon Sep 17 00:00:00 2001 From: Magic_yuan <317617749@qq.com> Date: Wed, 11 Dec 2024 12:57:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor(prompt):=20=E4=BC=98=E5=8C=96=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=A8=A1=E6=9D=BF=E4=BB=A5=E6=8F=90=E9=AB=98=E7=9B=B8?= =?UTF-8?q?=E4=BC=BC=E5=BA=A6=E8=AF=84=E4=BC=B0=E7=9A=84=E5=87=86=E7=A1=AE?= =?UTF-8?q?=E6=80=A7-=20=E6=98=8E=E7=A1=AE=E4=BA=86=E7=9B=B8=E4=BC=BC?= =?UTF-8?q?=E5=BA=A6=E8=AF=84=E5=88=86=E7=9A=84=E8=AF=84=E5=88=A4=E6=A0=87?= =?UTF-8?q?=E5=87=86=EF=BC=8C=E5=8C=85=E6=8B=AC=E4=B8=8D=E5=90=8C=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E7=9A=84=E8=AF=84=E5=88=86=E4=BE=9D=E6=8D=AE?= =?UTF-8?q?=20-=20=E7=AE=80=E5=8C=96=E4=BA=86=E8=AF=84=E5=88=86=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=EF=BC=8C=E8=A6=81=E6=B1=82=E7=9B=B4=E6=8E=A5=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E5=AD=97=20-=20=E6=9C=9F=E6=9C=9B=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E8=BF=99=E4=BA=9B=E6=94=B9=E5=8A=A8=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E8=AF=84=E4=BC=B0=E7=9A=84=E5=87=86=E7=A1=AE=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lightrag/prompt.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lightrag/prompt.py b/lightrag/prompt.py index d5674f15..9d9e6034 100644 --- a/lightrag/prompt.py +++ b/lightrag/prompt.py @@ -268,14 +268,19 @@ PROMPTS[ Question 1: {original_prompt} Question 2: {cached_prompt} -Please evaluate: +Please evaluate the following two points and provide a similarity score between 0 and 1 directly: 1. Whether these two questions are semantically similar 2. Whether the answer to Question 2 can be used to answer Question 1 - -Please provide a similarity score between 0 and 1, where: -0: Completely unrelated or answer cannot be reused +Similarity score criteria: +0: Completely unrelated or answer cannot be reused, including but not limited to: + - The questions have different topics + - The locations mentioned in the questions are different + - The times mentioned in the questions are different + - The specific individuals mentioned in the questions are different + - The specific events mentioned in the questions are different + - The background information in the questions is different + - The key conditions in the questions are different 1: Identical and answer can be directly reused 0.5: Partially related and answer needs modification to be used - Return only a number between 0-1, without any additional content. """