Upload prompt template grounding_nli_json_alt.yaml
Browse files- grounding_nli_json_alt.yaml +59 -23
grounding_nli_json_alt.yaml
CHANGED
|
@@ -1,27 +1,63 @@
|
|
| 1 |
prompt:
|
| 2 |
-
template:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
**Input
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|