File size: 3,317 Bytes
e60c070 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
"""define some usefull prompts"""
trans_prompt = """
Please translate the word into chinese: {} """
query_prompt = """
Please translate the word into chinese \
and give english example sentence and sentence meaning in Chinese:
{} """
learn_prompt = """
Please give an english sentence contains these words: {} \
and give sentence meaning in Chinese.
"""
wash_prompt = """
Please help me to remove the duplicate words and meaningless words from
the words list: {} and return the result.
For example:
User: apple, red, green, yellow, red, blll><, :*&
Your return: apple, red, green, yellow
"""
#*******************************************************
#************** user prompts ***************************
#*******************************************************
user_message_mapper = """
Please classify the following categories and return the name of the category. If your think user's requirement does not belong to the following categories, return the number 0.
Here are four examples:
User: I want to know the meaning of the word "apple"
"""
#*******************************************************
#************** system prompts *************************
#*******************************************************
# Using few shots learning to map the user's requirement to a command
system_message_mapper = """
You will receive the user's requirement. \
Please classify the user's requirement into the following categories \
and return the name of the category.
If your think user's requirement does not belong to the \
following categories, return the number 0.
Here are four examples:
User: I want to know the meaning of the word "apple"
Your return: :query apple
User: I want to add the word "apple" to my dictionary
Your return: :add apple
User: I want to remove the word "apple" from my dictionary
Your return: :remove apple
User: I want to learn the word "apple" based words in my dictionary now
Your return: :learn
User: I already learnt the meaning of the word "apple"
Your return: :remove apple
User: I want to know the rest words in my dictionary
Your return: :show
Here are the meaning of four categories for you to reference:
:query word means user want to study the meaning of word
:add word means user want to add word into his dictionary
:remove word means user want to remove word from his dictionary
:learn word means user want to learn words in his dictionary related to the word
:show means user want to show all words in his dictionary
"""
# using few shots learning to select the important words in a sentence
system_message_select = """
You will receive the english sentence from user, please select the words in the sentence that you think
is important for the user to understand the meaning of the sentence.
If the sentence does not contain any english words, please just return number 0.
For example:
User: The apple is red, and it's green.
Your return: apple, red
""" |