Spaces:
Sleeping
Sleeping
liuze
commited on
Commit
·
b50e28c
1
Parent(s):
0ee12fc
add prompt
Browse files- prompts/analyze_prompt.yaml +74 -0
- prompts/optimize_prompt.yaml +67 -0
prompts/analyze_prompt.yaml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: analyze_prompt
|
2 |
+
description: 分析prompt
|
3 |
+
format: jinja2
|
4 |
+
temperature: 0.7
|
5 |
+
max_tokens: 4000
|
6 |
+
prompt: |
|
7 |
+
你是一名prompt大师,你的任务是分析下面的prompt,同时参考feedback,生成分析报告。
|
8 |
+
|
9 |
+
prompt如下:
|
10 |
+
<prompt>
|
11 |
+
{{prompt}}
|
12 |
+
</prompt>
|
13 |
+
|
14 |
+
feedback如下:
|
15 |
+
<feedback>
|
16 |
+
{{feedback}}
|
17 |
+
</feedback>
|
18 |
+
|
19 |
+
分析报告的内容包括:
|
20 |
+
<template>
|
21 |
+
1. 任务意图和应用场景
|
22 |
+
[识别prompt的意图和应用场景]
|
23 |
+
2. 任务流程
|
24 |
+
[用Mermaid分析任务的流程图,直接生成流程图即可,不用再用文字解释一遍]
|
25 |
+
3. 任务示例
|
26 |
+
[如果有示例,请分析示例,否则,跳过此步骤]
|
27 |
+
4. 任务分析
|
28 |
+
[如果是复杂任务,需要要求生成分析过程]
|
29 |
+
5. 格式要求
|
30 |
+
[如果有格式要求,请分析格式的要求,否则,跳过此步骤]
|
31 |
+
6. 参数说明
|
32 |
+
[输入参数包含{{parameters}},用xml标签包裹,jinja2格式渲染]
|
33 |
+
7. 解决反馈
|
34 |
+
[分析用户的反馈,并给出解决思路]
|
35 |
+
</template>
|
36 |
+
|
37 |
+
可以参考下面的示例:
|
38 |
+
<example>
|
39 |
+
1. Intent and Deployment Circumstance:
|
40 |
+
The prompt's intent is to classify a given sentence by identifying which Wikipedia article it likely came from, given a list of article titles. This task is probably part of a larger text classification or information retrieval system.
|
41 |
+
|
42 |
+
2. Flowchart:
|
43 |
+
```mermaid
|
44 |
+
graph TD
|
45 |
+
A[Start] --> B[Receive list of article titles]
|
46 |
+
B --> C[Receive sentence to classify]
|
47 |
+
C --> D[Analyze sentence]
|
48 |
+
D --> E[Compare sentence to each article title]
|
49 |
+
E --> F[Identify most likely article]
|
50 |
+
F --> G[Output article title]
|
51 |
+
G --> H[End]
|
52 |
+
```
|
53 |
+
|
54 |
+
3. Lessons from Examples:
|
55 |
+
No examples were provided in the original prompt. However, we can infer that:
|
56 |
+
- The input will consist of a list of Wikipedia article titles and a single sentence.
|
57 |
+
- The output should be just the title of the most relevant article, with no additional text.
|
58 |
+
|
59 |
+
4. Chain-of-Thought Reasoning:
|
60 |
+
Given the complexity of the task and the user's feedback about accuracy, it would be beneficial to include chain-of-thought reasoning. We'll use <analysis> tags for this purpose.
|
61 |
+
|
62 |
+
5. Output Format:
|
63 |
+
The original prompt specifies that the output should be "just the article title and nothing else." We'll maintain this requirement and provide a clear example in the instructions.
|
64 |
+
|
65 |
+
6. Variable Introduction:
|
66 |
+
We'll introduce two variables:
|
67 |
+
- <article_titles> for the list of Wikipedia article titles
|
68 |
+
- <sentence> for the sentence to be classified
|
69 |
+
|
70 |
+
7. Addressing User Feedback:
|
71 |
+
The user feedback "总结不够准确" translates to "The summary is not accurate enough." To address this, we'll instruct the model to carefully analyze the sentence and compare it to each article title, considering key words and themes before making a decision.
|
72 |
+
</example>
|
73 |
+
|
74 |
+
请在<report>标签中输出分析报告,不要输出其他内容,用{{language}}输出。
|
prompts/optimize_prompt.yaml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: optimize_prompt
|
2 |
+
description: 优化prompt
|
3 |
+
format: jinja2
|
4 |
+
temperature: 0.7
|
5 |
+
max_tokens: 4000
|
6 |
+
prompt: |
|
7 |
+
你是一个专业的meta prompt工程师,请基于下面的prompt分析,改进老版prompt。
|
8 |
+
|
9 |
+
prompt分析如下:
|
10 |
+
<analysis>
|
11 |
+
{{report}}
|
12 |
+
</analysis>
|
13 |
+
|
14 |
+
老版prompt如下:
|
15 |
+
<oldPrompt>
|
16 |
+
{{prompt}}
|
17 |
+
</oldPrompt>
|
18 |
+
|
19 |
+
参考上面的分析,改进老版prompt,内容包含:
|
20 |
+
<template>
|
21 |
+
[定义清晰、专业角色,描述任务的意图和应用场景]
|
22 |
+
|
23 |
+
[列出输入参数,用xml标签包裹,模型参数用"\{\{ \}\}"表示,jinja2格式渲染]
|
24 |
+
|
25 |
+
[列出任务的关键步骤、要求、定义等]
|
26 |
+
|
27 |
+
[列出对任务有帮助的分析,并在prompt中说明要置于<analysis>标签中]
|
28 |
+
|
29 |
+
[格式要求]
|
30 |
+
|
31 |
+
[引导开始,并在prompt中说明结果输出要置于<output>标签中]
|
32 |
+
</template>
|
33 |
+
|
34 |
+
按照每块的要求,直接生成内容,不要列出标题,不要遗漏老版prompt中的关键内容,例如下面的示例:
|
35 |
+
|
36 |
+
<example>
|
37 |
+
You are an intelligent text classification system specialized in matching sentences to Wikipedia article titles. Your task is to identify which Wikipedia article a given sentence most likely belongs to, based on a provided list of article titles.
|
38 |
+
|
39 |
+
First, review the following list of Wikipedia article titles:
|
40 |
+
<article_titles>
|
41 |
+
{titles}
|
42 |
+
</article_titles>
|
43 |
+
|
44 |
+
Now, consider this sentence that needs to be classified:
|
45 |
+
<sentence_to_classify>
|
46 |
+
{sentence}
|
47 |
+
</sentence_to_classify>
|
48 |
+
|
49 |
+
Your goal is to determine which article title from the provided list best matches the given sentence. Follow these steps:
|
50 |
+
|
51 |
+
1. List the key concepts from the sentence
|
52 |
+
2. Compare each key concept with the article titles
|
53 |
+
3. Rank the top 3 most relevant titles and explain why they are relevant
|
54 |
+
4. Select the most appropriate article title that best encompasses or relates to the sentence's content
|
55 |
+
|
56 |
+
Wrap your analysis in <analysis> tags. Include the following:
|
57 |
+
- List of key concepts from the sentence
|
58 |
+
- Comparison of each key concept with the article titles
|
59 |
+
- Ranking of top 3 most relevant titles with explanations
|
60 |
+
- Your final choice and reasoning
|
61 |
+
|
62 |
+
After your analysis, provide your final answer: the single most appropriate Wikipedia article title from the list.
|
63 |
+
|
64 |
+
Output only the chosen article title, without any additional text or explanation.
|
65 |
+
</example>
|
66 |
+
|
67 |
+
在<prompt>标签中输出新版prompt,不要输出其他内容,用{{language}}输出。
|