diff --git a/memory_scope/memory/worker/read/extract_time_worker.yaml b/memory_scope/memory/worker/read/extract_time_worker.yaml index fe2d519e..017caa8a 100644 --- a/memory_scope/memory/worker/read/extract_time_worker.yaml +++ b/memory_scope/memory/worker/read/extract_time_worker.yaml @@ -1,7 +1,57 @@ -extract_time_prompt: +extract_time_system: cn: | - 任务指令:从语句与语句发生的时间,推断并提取语句内容中指向的时间段。回答尽可能完整的时间段。 - 语句:{query} + 任务指令:从语句与语句发生的时间,推断并提取语句内容中指向的时间段。回答尽可能完整的时间段。回答的格式严格遵照示例中的已有格式规范。 + + +extract_time_few_shot: + cn: | + 示例1: + 句子:我记得你前年四月份去了阿联酋,阿联酋有哪些好玩的地方?迪拜和阿布扎比你更喜欢哪个?沙漠的景色壮观吗? + 时间:1992年8月20日,1992年第34周,周一,18时46分25秒。 + 回答: + - 年:1990 - 月:4 + + 示例2: + 句子:后天下午三点的会议记得参加。我在日历上仔细标注了这个重要的日子,提醒自己不要错过。会议将在公司会议室举行,这是一个讨论未来发展方向的重要机会。 + 时间:2024年6月19日,2024年第25周,周二,13时30分0秒。 + 回答: + - 年:2024 - 月:6 - 日:21 - 时:15 + + 示例3: + 句子:下个月第一个周六去杭州玩。 + 时间:2005年7月15日,2005年第28周,周六,0时0分0秒。 + 回答: + - 年:2005 - 月:8 - 周:31 - 星期几:6 + + 示例4: + 句子:上周末我们去的那个小镇真是太美了。 + 时间:1999年12月2日,1999年第48周,周二,8时40分10秒。 + 回答: + - 年:1999 - 周:47 - 星期几:6,7 + + 示例5: + 句子:再过半小时就要宣讲了,记得准备材料。 + 时间:2020年6月22日,2020年第25周,周一,9时30分0秒 + 回答: + - 年:2020 - 月:6 - 日:22 - 时:10 - 分:0 - 秒:0 + + 示例6: + 句子:10000米长跑比赛的开始时间是3分47秒前。 + 时间:1987年2月17日,1987年第7周,周三,19时54分43秒。 + 回答: + - 年:1987 - 月:2 - 日:17 - 时:19 - 分:50 - 秒:56 + + 示例7: + 句子:上个月的这个时候我们还在筹备音乐会。每天都是忙碌而充实的日子,我们为音乐会的顺利举办而努力奋斗着。彩排、布景、节目安排,每一个细节都需要精心安排和准备。 + 时间:1995年11月24日,1995年第48周,周二,17时45分0秒。 + 回答: + - 年:1995 - 月:10 - 日:24 + + + +extract_time_user_query: + cn: | + 句子:{query} 时间:{query_time_str} 回答: diff --git a/memory_scope/memory/worker/write/contra_repeat_worker.yaml b/memory_scope/memory/worker/write/contra_repeat_worker.yaml index cd31fc76..cb8422e9 100644 --- a/memory_scope/memory/worker/write/contra_repeat_worker.yaml +++ b/memory_scope/memory/worker/write/contra_repeat_worker.yaml @@ -1,11 +1,18 @@ contra_repeat_system: cn: | 对下面的{num_obs}句句子,逐一判断是否与“前面序号”的任意句子存在信息的矛盾,或者句子的主要信息被“前面序号”的任意句子中的信息包含。只判断与“前面序号”的句子的关系。 - 对每个句子都做一个判断,最后一共输出{num_obs}行判断。 + 对每个句子都做一个判断,最后一共输出{num_obs}条判断。 请一步步思考,并按如下格式输出: 思考:思考的依据和过程,30字以内。 判断:<句子序号> <矛盾,被包含,无>,一定加<> + en: | + For the following {num_obs} sentences, determine one by one if there is any contradiction with the information in any "previously numbered" sentences, or if the main information of the sentence is contained within the information of any "previously numbered" sentences. Only evaluate the relation to "previously numbered" sentences. + Make an evaluation for each sentence, resulting in a total of {num_obs} evaluations. + Please think step by step and output in the following format: + Thought: The basis and process of the thought, within 30 words. + Evaluation: , enclosed in <>. + contra_repeat_few_shot: cn: | @@ -50,8 +57,54 @@ contra_repeat_few_shot: 思考:第6句中所有信息都被前面序号中第5句的信息完全包含。 判断:<2> <被包含> + en: | + Example 1 + Sentences: + 1 {user_name} suffers from insomnia frequently and is interested in the effects of sleeping pills, suggesting a possible consideration of their use. + 2 {user_name} suffers from insomnia frequently and seeks remedies. + 3 Charles is {user_name}'s supervisor. + 4 Charles is {user_name}'s supervisor. + 5 Charles is {user_name}'s supervisor and the branch manager of a bank. + Thought: The first sentence does not have any contradictions or complete repetitions with the previously numbered sentences. + Evaluation: <1> + Thought: All information in the second sentence is completely contained within the information of the first sentence. + Evaluation: <2> + Thought: The information in the third sentence does not appear in the previously numbered sentences. + Evaluation: <3> + Thought: The fourth sentence is completely repetitive of the information in the third sentence, i.e., it is completely contained. + Evaluation: <4> + Thought: The information that Charles is {user_name}'s supervisor in the fifth sentence is contained within the information of the third sentence, but the new information that Charles is the branch manager of a bank is not, so it is not contained. + Evaluation: <5> + + Example 2 + Sentences: + 1 {user_name}'s child does not perform well academically. + 2 {user_name}'s child often skips school. + 3 {user_name}'s father's birthday is on June 2, 2024, and {user_name} plans to prepare a gift. + 4 {user_name}'s father's birthday is on May 1, 2024. + 5 {user_name} loves playing basketball with classmates. + 6 {user_name} likes playing basketball. + + Thought: The first sentence does not have any contradictions or complete repetitions with the previously numbered sentences. + Evaluation: <1> + Thought: The second sentence neither contradicts nor repeats any of the previously numbered sentences. + Evaluation: <2> + Thought: The third sentence neither contradicts nor repeats any of the previously numbered sentences. + Evaluation: <3> + Thought: The date of {user_name}'s father's birthday in the fourth sentence contradicts the information in the third sentence. + Evaluation: <4> + Thought: The fifth sentence neither contradicts nor repeats any of the previously numbered sentences. + Evaluation: <5> + Thought: All information in the sixth sentence is completely contained within the information of the fifth sentence. + Evaluation: <6> + + contra_repeat_user_query: cn: | 句子: {user_query} + + en: | + Sentences: + {user_query} diff --git a/memory_scope/memory/worker/write/get_observation_with_time_worker.yaml b/memory_scope/memory/worker/write/get_observation_with_time_worker.yaml index 7ca0d846..4f7665d1 100644 --- a/memory_scope/memory/worker/write/get_observation_with_time_worker.yaml +++ b/memory_scope/memory/worker/write/get_observation_with_time_worker.yaml @@ -8,8 +8,9 @@ get_observation_with_time_system: 每一句{user_name}句子的格式是:<序号> <对话时间> {user_name}:<句子> 对每一句句子,只提取非常明确的信息和进行非常确定的推断,不要进行任何猜测。不要提取重复的信息,如果句子中的所有信息与已经提取出的信息重复了则回答“重复“,如果没有重要信息则回答“无”。 如果{user_name}信息涉及时间,则结合对话时间推断{user_name}信息的时间信息,没有则不输出。注意区分,对于句子中包含{user_name}假设的信息或者{user_name}虚构的内容比如{user_name}创作的小说或剧本,不要提取信息。 - 对每个句子都做一次信息提取,最后一共输出{num_obs}行信息。 + 对每个句子都做一次信息提取,最后一共输出{num_obs}条信息。 请一步步思考,并一定要按如下格式依次输出,最后的结果一定要加<>: + 思考:思考的依据和过程,50字以内。 信息:<句子序号> <时间信息或“无”> <明确的重要信息或“重复”或”无“> <关键词> diff --git a/memory_scope/memory/worker/write/get_observation_worker.yaml b/memory_scope/memory/worker/write/get_observation_worker.yaml index 4b840721..38deccfd 100644 --- a/memory_scope/memory/worker/write/get_observation_worker.yaml +++ b/memory_scope/memory/worker/write/get_observation_worker.yaml @@ -2,10 +2,19 @@ get_observation_system: cn: | 任务:从下面的{num_obs}句{user_name}句子中依次提取出关于{user_name}的重要信息,与相应的关键词。最多提取{num_obs}条信息。对每一句句子,只提取非常明确的信息和进行非常确定的推断,不要进行任何猜测。 不要提取重复的信息,如果句子中的所有信息与已经提取出的信息重复了则回答“重复“,如果没有重要信息则回答“无”。注意区分,对于句子中包含{user_name}假设的信息或者{user_name}虚构的内容比如{user_name}创作的小说或剧本,不要提取信息。 - 对每个句子都做一次信息提取,最后一共输出{num_obs}行信息。 + 对每个句子都做一次信息提取,最后一共输出{num_obs}条信息。 请一定要按如下格式依次输出,最后的结果一定要加<>: + 思考:思考的依据和过程,50字以内。 信息:<句子序号> <> <明确的重要信息或“重复”或”无“> <关键词> + en: | + Task: Extract important information and corresponding keywords from the following {num_obs} sentences about {user_name}. Extract up to {num_obs} pieces of information. For each sentence, only extract very clear information and make very certain inferences without any speculation. + Do not extract repeated information. If all information in the sentence repeats what has already been extracted, respond with "repeat." If there is no important information, respond with "none." Be sure to distinguish information; for example, do not extract hypothetical or fictional content from {user_name} such as {user_name}'s novels or scripts. + Perform information extraction for each sentence, resulting in a total of {num_obs} pieces of information. + Please output the results in the following format, with the final output enclosed in <>: + Thought: The basis and process of the thought, within 50 words. + Information: <> + get_observation_few_shot: cn: | @@ -63,8 +72,68 @@ get_observation_few_shot: 思考:第6句是{user_name}创作的剧本内容,无法提取{user_name}个人信息。 信息:<6> <> <无> <> + en: | + Example 1: + {user_name} sentences: + 1 {user_name}: I'm in a terrible situation right now, I don't have a job, and I'm in debt by tens of thousands. What should I do? + 2 {user_name}: Someone said that passion is the best teacher and suggested linking passion with a career, but I found that many people like playing basketball, but few make it a profession and even fewer make money from it. Also, how do you distinguish passion from liking? + 3 {user_name}: I'm in a terrible situation right now, I don't have a job, and I'm in debt by tens of thousands. What should I do? + 4 {user_name}: I'm a recent graduate who doesn't understand society or the industry. Can you introduce me to the social system and industry structure? + Thought: From the first sentence, it can be inferred that {user_name} currently has no job and is in debt by tens of thousands. This is important information about {user_name}'s employment and financial status. + Information: <1> <> <{user_name} currently has no job and is in debt by tens of thousands> + Thought: The second sentence is a discussion and query about others' opinions by {user_name}, with no clear mention of {user_name}'s personal information. + Information: <2> <> <> + Thought: The information in the third sentence is a repeat of the first sentence. + Information: <3> <> <> + Thought: From the fourth sentence, it can be inferred that {user_name} is a recent graduate, which is important information about {user_name}'s background. The remaining information is of insufficient importance. + Information: <4> <> <{user_name} is a recent graduate> + + Example 2: + {user_name} sentences: + 1 {user_name}: Please help me write a birthday greeting for my colleague Jason's daughter who is turning three. + 2 {user_name}: Can you compile a list of tips on how to use large models for me, and try to keep the content concise? + 3 {user_name}: Two pieces of bad news: I broke my badminton racket while playing... Then I went to my friend's house to pet the cat and ended up having an allergic reaction to the cat fur, sneezing like crazy today... + 4 {user_name}: Chronology of major events in Chinese history from 1400 to 1550 AD. + 5 {user_name}: Thanks. I'm having lunch near the company at noon; can you recommend a restaurant near Alibaba Xuhui Riverside Campus for me? + Thought: From the first sentence, it can be inferred that Zhang San is {user_name}'s colleague, which is important information about {user_name}'s interpersonal relationships. The remaining information is of insufficient importance. + Information: <1> <> + Thought: The second sentence is a request made by {user_name}, with no clear mention of {user_name}'s personal information. + Information: <2> <> <> + Thought: From the third sentence, it can be inferred that {user_name} broke their badminton racket the other day, but this is not important information. It can also be inferred that {user_name} is allergic to cat fur, which is important information about {user_name}'s health. + Information: <3> <> <{user_name} is allergic to cat fur> + Thought: The fourth sentence is a request made by {user_name}, with no clear mention of {user_name}'s personal information. + Information: <4> <> <> + Thought: From the fifth sentence, it can be inferred that {user_name} works at Alibaba Xuhui Riverside Campus, which is important information about {user_name}'s workplace. + Information: <5> <> <{user_name} works at Alibaba Xuhui Riverside Campus> + + Example 3: + {user_name} sentences: + 1 {user_name}: I want to buy a new energy vehicle. Any recommendations? + 2 {user_name}: I'm in San Jose and want to buy a new energy vehicle. Any recommendations? + 3 {user_name}: During the objection review period by a third party, the court must not dispose of the execution object. Doesn't this mean suspension of execution? + 4 {user_name}: Please write two acrostic poems, starting with "Victory" and "Success". + 5 {user_name}: I spent $5000 to buy 100 shares of General Motors. + 6 {user_name}: Zack: This is a constellation frog setting, but I am a Virgo. My mom feels I'm abnormal and doesn't let me watch it. \n The female monkey patted Zack's head, "Is that so?" \n The female monkey opened Bilibili and took a look. \n Female monkey: "Why don't you switch the setting? I heard from your future self that there is someone called 'Unforgettable Chocolate 232' who created a Windows setting." \n This is script 1; script 2 is to be continued. + Thought: From the first sentence, it can be inferred that {user_name} is seeking advice or recommendations for purchasing a new energy vehicle. This is important information about {user_name}'s major consumption. + Information: <1> <> <{user_name} is seeking advice or recommendations for purchasing a new energy vehicle> + Thought: From the second sentence, it can be inferred that {user_name} is currently in San Jose, which is important information about {user_name}'s living location. The remaining information is a repeat of the first sentence. + Information: <2> <> <{user_name} is currently in San Jose> + Thought: The third sentence is a discussion and query about a specific legal opinion by {user_name}, with no clear mention of {user_name}'s personal information. + Information: <3> <> <> + Thought: The fourth sentence is a request made by {user_name}, with no clear mention of {user_name}'s personal information. + Information: <4> <> <> + Thought: From the fifth sentence, it can be inferred that {user_name} bought 100 shares of General Motors stock for $5000. This is important information about {user_name}'s investment decision. + Information: <5> <> <{user_name} bought 100 shares of General Motors stock for $5000> + Thought: The sixth sentence is content from a script written by {user_name}, with no extractable personal information about {user_name}. + Information: <6> <> <> + get_observation_user_query: cn: | {user_name}句子: {user_query} + + en: | + {user_name} sentences: + {user_query} + diff --git a/memory_scope/memory/worker/write/info_filter_worker.yaml b/memory_scope/memory/worker/write/info_filter_worker.yaml index eed496fa..86457ab6 100644 --- a/memory_scope/memory/worker/write/info_filter_worker.yaml +++ b/memory_scope/memory/worker/write/info_filter_worker.yaml @@ -6,6 +6,15 @@ info_filter_system: 结果: <分数:0或1或2或3> + en: | + Instruction: Evaluate the given {batch_size} sentences for information about {user_name}, with a score of 0, 1, 2, or 3. + Note: A score of 0 indicates no information about {user_name}, 1 indicates hypothetical or fictional content about or from {user_name}, 2 indicates general, timely, or speculative information about {user_name}, and 3 indicates significant and verifiable information about {user_name} or information that {user_name} requested to be recorded. + Output the scores in the following format, with each score enclosed in <>. Provide {batch_size} scores in total: + + Results: + + + info_filter_few_shot: cn: | 示例1 @@ -56,8 +65,62 @@ info_filter_few_shot: <0> <1> + en: | + Example 1 + Sentences: + 1 {user_name}: Please help me write a birthday greeting for my colleague Jason's daughter who is turning three. + 2 {user_name}: Chronology of major events in Mediterranean history from 1400 to 1550 AD. + 3 {user_name}: Have you had lunch? + 4 {user_name}: I'm feeling down today. Can you comfort me a bit? + 5 {user_name}: Can you compile a list of tips on how to use large models for me, and try to keep the content concise? + 6 {user_name}: Note this down: remind me tomorrow at 3 PM to pick up the documents. + Results: + <3> + <0> + <0> + <2> + <2> + <3> + + Example 2 + Sentences: + 1 {user_name}: I've just joined Google. + 2 {user_name}: There are too many mosquitoes when sleeping outdoors. What should I do? + 3 {user_name}: Is creativity related to extraversion? + 4 {user_name}: Should the review, modification, and standardization of all personnel files in a district or county be handled by the cadre archive center or by the county human resources and social security bureau? + 5 {user_name}: If I am planning to have a child with a woman, as a man, how can I protect the woman and the baby and how can I prepare to ensure high sperm quality for the benefit of the offspring? + 6 {user_name}: If we go out to play together, would you feel happy? + 7 {user_name}: Rose, a young girl full of curiosity about the future, accidentally discovered this post office that can send letters to the future. Out of nostalgia for her late grandfather, she decided to write a letter to herself five years in the future, hoping to receive the unfinished stories of her grandfather. As the five-year deadline approached, when she had almost forgotten about this event, a yellowed reply quietly arrived, bringing not only her grandfather's unfinished adventure story but also a profound revelation about courage, love, and self-discovery. Continue writing this into a 3000-word novel. + Results: + <3> + <2> + <0> + <0> + <3> + <1> + <1> + + Example 3 + Sentences: + 1 {user_name}: Your mother is suffering from anxiety. How can you comfort and guide her? + 2 {user_name}: Severe kidney deficiency + 3 {user_name}: I really enjoy playing basketball, so I am in good health. + 4 {user_name}: Who are some famous basketball stars? + 5 {user_name}: Zack: This is a constellation frog setting, but I am a Virgo. My mom feels I'm abnormal and doesn't let me watch it. \n The female monkey patted Zack's head. "Is that so?" \n The female monkey opened Bilibili and took a look. \n Female monkey: "Why don't you switch the setting? I heard from your future self that there is someone called 'Unforgettable Chocolate 232' who created a Windows setting." \n This is script 1; script 2 is to be continued. + Results: + <1> + <1> + <3> + <0> + <1> + info_filter_user_query: cn: | 句子: {user_query} 结果: + + en: | + Sentences: + {user_query} + Results: