MoritzLaurer HF staff commited on
Commit
63cfe59
1 Parent(s): 65d8c96

Upload prompt template grounding_nli_json_alt.yaml

Browse files
Files changed (1) hide show
  1. grounding_nli_json_alt.yaml +59 -23
grounding_nli_json_alt.yaml CHANGED
@@ -1,27 +1,63 @@
1
  prompt:
2
- template: "You are a helpful and harmless AI assistant. You will be provided with a textual context and a model-generated
3
- response.\nYour task is to analyze the response sentence by sentence and classify each sentence according to its relationship
4
- with the provided context.\n\n**Instructions:**\n\n1. **Decompose the response into individual sentences.**\n2. **For
5
- each sentence, assign one of the following labels:**\n * **`supported`**: The sentence is entailed by the given context.\
6
- \ Provide a supporting excerpt from the context.\n * **`unsupported`**: The sentence is not entailed by the given
7
- context. Provide an excerpt that is close but does not fully support the sentence.\n * **`contradictory`**: The sentence
8
- is falsified by the given context. Provide a contradicting excerpt from the context.\n * **`no_rad`**: The sentence
9
- does not require factual attribution (e.g., opinions, greetings, questions, disclaimers). No excerpt is needed for this
10
- label.\n\n3. **For each label, provide a short rationale explaining your decision.** The rationale should be separate
11
- from the excerpt.\n\n**Input Format:**\n\nThe input will consist of two parts, clearly separated:\n\n* **Context:** The
12
- textual context used to generate the response.\n* **Response:** The model-generated response to be analyzed.\n\n**Output
13
- Format:**\n\nFor each sentence in the response, output a JSON object with the following fields:\n\n* `\"sentence\"`: The
14
- sentence being analyzed.\n* `\"label\"`: One of `supported`, `unsupported`, `contradictory`, or `no_rad`.\n* `\"rationale\"\
15
- `: A brief explanation for the assigned label.\n* `\"excerpt\"`: A relevant excerpt from the context. Only required for
16
- `supported`, `unsupported`, and `contradictory` labels.\n\nOutput each JSON object on a new line.\n\n**Example:**\n\n
17
- **Input:**\n\n```\nContext: Apples are red fruits. Bananas are yellow fruits.\n\nResponse: Apples are red. Bananas are
18
- green. Enjoy your fruit!\n```\n\n**Output:**\n\n{\"sentence\": \"Apples are red.\", \"label\": \"supported\", \"rationale\"\
19
- : \"The context explicitly states that apples are red.\", \"excerpt\": \"Apples are red fruits.\"}\n{\"sentence\": \"
20
- Bananas are green.\", \"label\": \"contradictory\", \"rationale\": \"The context states that bananas are yellow, not green.\"\
21
- , \"excerpt\": \"Bananas are yellow fruits.\"}\n{\"sentence\": \"Enjoy your fruit!\", \"label\": \"no_rad\", \"rationale\"\
22
- : \"This is a general expression and does not require factual attribution.\", \"excerpt\": null}\n\n**Now, please analyze
23
- the following context and response:**\n\n**User Query:**\n{{user_request}}\n\n**Context:**\n{{context_document}}\n\n**Response:**\n\
24
- {{response}}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  template_variables:
26
  - user_request
27
  - context_document
 
1
  prompt:
2
+ template: |-
3
+ You are a helpful and harmless AI assistant. You will be provided with a textual context and a model-generated response.
4
+ Your task is to analyze the response sentence by sentence and classify each sentence according to its relationship with the provided context.
5
+
6
+ **Instructions:**
7
+
8
+ 1. **Decompose the response into individual sentences.**
9
+ 2. **For each sentence, assign one of the following labels:**
10
+ * **`supported`**: The sentence is entailed by the given context. Provide a supporting excerpt from the context.
11
+ * **`unsupported`**: The sentence is not entailed by the given context. Provide an excerpt that is close but does not fully support the sentence.
12
+ * **`contradictory`**: The sentence is falsified by the given context. Provide a contradicting excerpt from the context.
13
+ * **`no_rad`**: The sentence does not require factual attribution (e.g., opinions, greetings, questions, disclaimers). No excerpt is needed for this label.
14
+
15
+ 3. **For each label, provide a short rationale explaining your decision.** The rationale should be separate from the excerpt.
16
+
17
+ **Input Format:**
18
+
19
+ The input will consist of two parts, clearly separated:
20
+
21
+ * **Context:** The textual context used to generate the response.
22
+ * **Response:** The model-generated response to be analyzed.
23
+
24
+ **Output Format:**
25
+
26
+ For each sentence in the response, output a JSON object with the following fields:
27
+
28
+ * `"sentence"`: The sentence being analyzed.
29
+ * `"label"`: One of `supported`, `unsupported`, `contradictory`, or `no_rad`.
30
+ * `"rationale"`: A brief explanation for the assigned label.
31
+ * `"excerpt"`: A relevant excerpt from the context. Only required for `supported`, `unsupported`, and `contradictory` labels.
32
+
33
+ Output each JSON object on a new line.
34
+
35
+ **Example:**
36
+
37
+ **Input:**
38
+
39
+ ```
40
+ Context: Apples are red fruits. Bananas are yellow fruits.
41
+
42
+ Response: Apples are red. Bananas are green. Enjoy your fruit!
43
+ ```
44
+
45
+ **Output:**
46
+
47
+ {"sentence": "Apples are red.", "label": "supported", "rationale": "The context explicitly states that apples are red.", "excerpt": "Apples are red fruits."}
48
+ {"sentence": "Bananas are green.", "label": "contradictory", "rationale": "The context states that bananas are yellow, not green.", "excerpt": "Bananas are yellow fruits."}
49
+ {"sentence": "Enjoy your fruit!", "label": "no_rad", "rationale": "This is a general expression and does not require factual attribution.", "excerpt": null}
50
+
51
+ **Now, please analyze the following context and response:**
52
+
53
+ **User Query:**
54
+ {{user_request}}
55
+
56
+ **Context:**
57
+ {{context_document}}
58
+
59
+ **Response:**
60
+ {{response}}
61
  template_variables:
62
  - user_request
63
  - context_document