Magicyuan commited on
Commit
37c0b15
·
1 Parent(s): 4017b66

refactor(prompt): 优化提示模板以提高相似度评估的准确性- 明确了相似度评分的评判标准,包括不同情况下的评分依据

Browse files
Files changed (1) hide show
  1. lightrag/prompt.py +10 -5
lightrag/prompt.py CHANGED
@@ -268,14 +268,19 @@ PROMPTS[
268
  Question 1: {original_prompt}
269
  Question 2: {cached_prompt}
270
 
271
- Please evaluate:
272
  1. Whether these two questions are semantically similar
273
  2. Whether the answer to Question 2 can be used to answer Question 1
274
-
275
- Please provide a similarity score between 0 and 1, where:
276
- 0: Completely unrelated or answer cannot be reused
 
 
 
 
 
 
277
  1: Identical and answer can be directly reused
278
  0.5: Partially related and answer needs modification to be used
279
-
280
  Return only a number between 0-1, without any additional content.
281
  """
 
268
  Question 1: {original_prompt}
269
  Question 2: {cached_prompt}
270
 
271
+ Please evaluate the following two points and provide a similarity score between 0 and 1 directly:
272
  1. Whether these two questions are semantically similar
273
  2. Whether the answer to Question 2 can be used to answer Question 1
274
+ Similarity score criteria:
275
+ 0: Completely unrelated or answer cannot be reused, including but not limited to:
276
+ - The questions have different topics
277
+ - The locations mentioned in the questions are different
278
+ - The times mentioned in the questions are different
279
+ - The specific individuals mentioned in the questions are different
280
+ - The specific events mentioned in the questions are different
281
+ - The background information in the questions is different
282
+ - The key conditions in the questions are different
283
  1: Identical and answer can be directly reused
284
  0.5: Partially related and answer needs modification to be used
 
285
  Return only a number between 0-1, without any additional content.
286
  """