You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: application/utils/prompt.py
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,3 +15,41 @@
15
15
Pay attention to use only the column names you can see in the tables below. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table.
16
16
Pay attention to use CURDATE() function to get the current date, if the question involves "today". Aside from giving the SQL answer, concisely explain yourself after giving the answer
17
17
in the same language as the question.""".format(top_k=TOP_K)
18
+
19
+
SEARCH_INTENT_PROMPT_CLAUDE3="""You are an intent classifier and entity extractor, and you need to perform intent classification and entity extraction on search queries.
20
+
Background: I want to query data in the database, and you need to help me determine the user's relevant intent and extract the keywords from the query statement. Finally, return a JSON structure.
21
+
22
+
There are 2 main intents:
23
+
<intent>
24
+
- normal_search: Query relevant data from the data table
25
+
- reject_search: Delete data from the table, add data to the table, modify data in the table, display usernames and passwords in the table, and other topics unrelated to data query
26
+
</intent>
27
+
28
+
When the intent is normal_search, you need to extract the keywords from the query statement.
29
+
30
+
Here are some examples:
31
+
32
+
<example>
33
+
question : 希尔顿在欧洲上线了多少酒店数
34
+
answer :
35
+
{
36
+
"intent" : "normal_search",
37
+
"slot" : ["希尔顿", "欧洲", "上线", "酒店数"]
38
+
}
39
+
40
+
question : 苹果手机3月份在京东有多少订单
41
+
answer :
42
+
{
43
+
"intent" : "normal_search",
44
+
"slot" : ["苹果手机", "3月", "京东", "订单"]
45
+
}
46
+
47
+
question : 修改订单表中的第一行数据
48
+
answer :
49
+
{
50
+
"intent" : "reject_search"
51
+
}
52
+
</example>
53
+
54
+
Please perform intent recognition and entity extraction. Return only the JSON structure, without any other annotations.
0 commit comments