entidi2608 commited on
Commit
b6a3050
·
1 Parent(s): 135a5d5

update: prompt

Browse files
Files changed (1) hide show
  1. prompt_templete.py +26 -10
prompt_templete.py CHANGED
@@ -475,16 +475,16 @@ Your task is to analyze the user's input and chat history, then output a single,
475
  **INSTRUCTIONS:**
476
  1. **Rewrite:** Create a clear, standalone Vietnamese question based on the user's input and chat history. Use official legal terms for legal queries.
477
  2. **Classify:** Categorize the rewritten question into ONE of these types:
478
- - `legal_rag`: A specific question about Vietnamese law.
479
  - `out_of_scope_legal`: A question about non-Vietnamese law.
480
  - `chit_chat`: Greetings, thanks, feedback, or questions about the bot.
481
- - `general_knowledge`: A non-legal, general knowledge question.
482
  - `ambiguous_legal_topic`: A legal topic mentioned without a specific question.
483
 
484
  ---
485
  **EXAMPLES:**
486
 
487
- # Example 1: In-scope Legal
488
  - User Input: "xe may vuot den do bi phat bao nhieu tien"
489
  - Output:
490
  {{
@@ -516,6 +516,14 @@ Your task is to analyze the user's input and chat history, then output a single,
516
  "classification": "legal_rag",
517
  "rewritten_question": "Thủ tục ly hôn theo yêu cầu của một bên (ly hôn đơn phương) được quy định như thế nào?"
518
  }}
 
 
 
 
 
 
 
 
519
  ---
520
 
521
  **Chat History:**
@@ -557,14 +565,18 @@ Your task is to answer the QUESTION based **strictly** on the provided CONTEXT.
557
  **ANSWER GENERATION PROCESS (Internal thought process):**
558
 
559
  **1. Analysis:**
560
- - **Core Request:** [Summarize what the user wants]
561
  - **Main Subject & Action:** [Identify key entities and events]
562
 
563
  **2. Context Evaluation:**
564
- - [List relevant documents from CONTEXT and why. If none, state that.]
565
 
566
  **3. Response Plan:**
567
- - [Outline the answer structure based on selected documents.]
 
 
 
 
568
 
569
  **4. Final Answer (Use this exact format):**
570
 
@@ -572,10 +584,14 @@ Your task is to answer the QUESTION based **strictly** on the provided CONTEXT.
572
 
573
  ### [A clear, concise title for the answer in the user's language]
574
 
575
- [Present the answer here. Use bullet points for key information.]
576
- - **Quy định (Regulation):** [Content of the regulation]
577
- - **Mức phạt (Penalty):** [Details on the penalty, if any]
578
- - **Biện pháp bổ sung (Additional Measures):** [Details on supplementary penalties]
 
 
 
 
579
 
580
  ### Nguồn tham khảo (Source)
581
 
 
475
  **INSTRUCTIONS:**
476
  1. **Rewrite:** Create a clear, standalone Vietnamese question based on the user's input and chat history. Use official legal terms for legal queries.
477
  2. **Classify:** Categorize the rewritten question into ONE of these types:
478
+ - `legal_rag`: A specific question about Vietnamese law. This includes regulations, procedures, penalties, **and factual data stipulated in legal documents (e.g., administrative units, government organization, official statistics from legal texts).**
479
  - `out_of_scope_legal`: A question about non-Vietnamese law.
480
  - `chit_chat`: Greetings, thanks, feedback, or questions about the bot.
481
+ - `general_knowledge`: A non-legal, general knowledge question whose answer is NOT found in legal documents.
482
  - `ambiguous_legal_topic`: A legal topic mentioned without a specific question.
483
 
484
  ---
485
  **EXAMPLES:**
486
 
487
+ # Example 1: In-scope Legal (Penalty)
488
  - User Input: "xe may vuot den do bi phat bao nhieu tien"
489
  - Output:
490
  {{
 
516
  "classification": "legal_rag",
517
  "rewritten_question": "Thủ tục ly hôn theo yêu cầu của một bên (ly hôn đơn phương) được quy định như thế nào?"
518
  }}
519
+
520
+ # Example 5: In-scope Legal (Factual Data from Legal Document)
521
+ - User Input: "sau khi sáp nhập, việt nam có bao nhiêu tỉnh thành phố"
522
+ - Output:
523
+ {{
524
+ "classification": "legal_rag",
525
+ "rewritten_question": "Số lượng đơn vị hành chính cấp tỉnh của Việt Nam sau các đợt sáp nhập gần nhất là bao nhiêu theo quy định của pháp luật?"
526
+ }}
527
  ---
528
 
529
  **Chat History:**
 
565
  **ANSWER GENERATION PROCESS (Internal thought process):**
566
 
567
  **1. Analysis:**
568
+ - **Core Request:** [Summarize what the user wants. Is it a rule, a penalty, a procedure, a definition, or a specific fact/number?]
569
  - **Main Subject & Action:** [Identify key entities and events]
570
 
571
  **2. Context Evaluation:**
572
+ - [List relevant documents from CONTEXT and why. Note the source (e.g., Nghị định 100/2019/NĐ-CP, Nghị quyết 1211/2016/UBTVQH13). If none, state that.]
573
 
574
  **3. Response Plan:**
575
+ - [Outline the answer structure.
576
+ - If it's about a rule/penalty, I will use the structure: Regulation, Penalty, etc.
577
+ - If it's a factual question (e.g., 'how many provinces?', 'what is the area?'), I will directly state the fact/number found in the context.
578
+ - If it's a definition, I will provide the definition as written in the law.
579
+ - The plan is to present the information clearly and concisely.]
580
 
581
  **4. Final Answer (Use this exact format):**
582
 
 
584
 
585
  ### [A clear, concise title for the answer in the user's language]
586
 
587
+ [Present the answer here.
588
+ - Answer directly and clearly based on the Response Plan.
589
+ - Use paragraphs for explanations and bullet points for lists or key details.
590
+ - **If the question asks for a specific number, list, or fact (e.g., 'how many provinces?', 'what is the new area of Tuyen Quang?'), provide that information directly and concisely first.**
591
+ - For questions about rules and penalties, you can use a structure like:
592
+ - **Quy định (Regulation):** [Content of the regulation]
593
+ - **Mức phạt (Penalty):** [Details on the penalty, if any]
594
+ - **Biện pháp bổ sung (Additional Measures):** [Details on supplementary penalties]]
595
 
596
  ### Nguồn tham khảo (Source)
597