Method and system for generating schedule assistant based on natural language processing algorithm
The natural language processing-based day planner system addresses operational complexity and inaccuracy in existing tools by automating text cleaning, time extraction, and calendar event creation, resulting in improved user experience and accuracy.
Patent Information
- Application Number
- CN202510262104.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-07-15
AI Technical Summary
The existing schedule management tools are cumbersome to operate, inaccurate time semantic analysis, and poor user experience.
Through the combination of natural language processing algorithms and time semantic analysis algorithms, intelligent analysis and management of user natural language inputs can be realized, operating procedures can be simplified, and parsing accuracy and efficiency can be improved.
It simplifies user operations, improves the accuracy and efficiency of schedule management, and improves user experience.
Smart Images

Figure CN120317850A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and particularly relates to a method and system for generating a schedule assistant based on natural language processing algorithms. Background Art
[0002] Existing schedule management tools mostly rely on manual input and management by users, which is cumbersome. With the development of natural language processing technology, intelligent schedule management assistants have gradually become a research hotspot. However, existing artificial intelligence technologies still have deficiencies in terms of the accuracy of time semantic parsing and user experience. The existing schedule management tools mainly include the following types:
[0003] (1) Manually input schedule management tools: such as calendar applications and to-do list applications, where users need to manually input all schedule information. These tools are cumbersome to operate. Especially when inputting complex time and event descriptions, users need to spend a lot of time on manual adjustment and management;
[0004] (2) Template-based schedule management tools: such as some intelligent assistant applications that provide predefined templates, and users can quickly create schedules by selecting templates. However, the number of templates of such tools is limited and cannot cover all the needs of users, with poor flexibility;
[0005] (3) Speech recognition and voice assistants: such as voice assistants like Apple's Siri, Google Assistant, and Amazon Alexa, where users can create and manage schedules through voice commands. Although such tools provide certain convenience, when parsing complex natural language inputs, they often have problems of recognition errors and inaccurate parsing.
[0006] In summary, the following are the main problems in the existing technology regarding schedule management tools:
[0007] (1) Cumbersome operation: Most of the existing schedule management tools have complex operation steps, and users need to spend a lot of time on manual adjustment and management. For example, users need to manually input dates, times, event descriptions, etc. Especially when dealing with multiple time periods and events, the operation is cumbersome and prone to confusion;
[0008] (2) Low accuracy of time semantic parsing: Existing time parsing algorithms are prone to parsing errors when facing complex natural language inputs, resulting in incorrect schedule arrangements. For example, when a user inputs "Have a meeting at 9 am next Tuesday", the system may not be able to accurately parse the specific date and time, leading to incorrect reminders;
[0009] (3) Poor user experience: Due to cumbersome operations and inaccurate parsing, users have a poor experience during use. For example, users need to repeatedly confirm and adjust schedule information, which increases the usage burden and reduces the usage efficiency. Summary of the Invention
[0010] The present invention solves the problems of cumbersome operations, inaccurate time semantic parsing, and poor user experience of existing schedule management tools, and provides a method and system for generating a schedule assistant based on natural language processing algorithms. By combining natural language processing technology and time semantic parsing algorithms, intelligent parsing and management of users' natural language input are achieved, the operation process of users is simplified, and the accuracy and efficiency of schedule management are improved.
[0011] The technical solutions claimed by the present invention are as follows:
[0012] A method for generating a schedule assistant based on natural language processing algorithms, comprising the following steps:
[0013] S1: Clean and format the input text;
[0014] S2: Use a time semantic parsing algorithm to extract the time information of the text obtained in S1;
[0015] S3: Based on the time information extracted in S2, splice the time information of the text obtained in S1, and replace the corresponding text in the message list of the user input with the spliced text;
[0016] S4: Based on the message list obtained in S3, study and design effective prompt instructions for creating a schedule to guide the model to generate outputs that meet specific requirements;
[0017] S5: Parse the model answer result processed in S4 and call the calendar software interface to automatically create a schedule and set a reminder.
[0018] In the above method, the S1 includes the following steps:
[0019] S11: Remove all punctuation marks from the input text;
[0020] S12: Call the text cleaning function to remove special characters in the text obtained in S11, and replace full-width letters, numbers, and spaces with half-width; the special characters include: HTML tags, abnormal characters, redundant characters, parentheses and supplementary content in parentheses, URLs, E-mails, and phone numbers;
[0021] S13: Obtain the current date and time, and format it into a standard date and time string;
[0022] S14: Extract all the user input content from the user input message list and concatenate it into an overall string. Check whether there are the same date, time, or meeting theme keywords in the user input through regular expression matching. If multiple inputs involve the same date or event, they are considered to belong to the same schedule; if multiple different times are mentioned in the input, it can be judged whether they belong to the same event through time logic.
[0023] In the above method, the user input content described in S14 is confirmed through regular expression matching.
[0024] In the above method, the specific implementation process of the time semantic parsing algorithm described in S2 includes the following steps:
[0025] S21: Perform synonym mapping on time quantifiers and time quantities in the Chinese idiomatic context; the time quantifiers include: day, date, day, week; the time quantities include: yesterday, tomorrow, before, after;
[0026] S22: Extract relationship entities through natural language technology, identify and extract all possible time expressions from the text string to obtain time entities and their corresponding times. If no time entity is extracted, return an empty string, otherwise jump to S23;
[0027] S23: Parse the entities extracted in S22 and their corresponding times, and convert the times corresponding to the entities into standard time formats. At the same time, judge the entity content. If the entity content includes a start time, format the start time range as a string and return it. If the entity content only contains a start time, format the start time range as a string and return it.
[0028] In the above method, S23 also includes the processing of the time corresponding to the time entity. Specifically, design a time information adjustment function to adjust the target time according to the current time and return the next future valid time, so as to adjust the parsed start time to ensure that it is a future time; the time information adjustment function is used to judge whether the time is a future time. If not, give a future valid time.
[0029] In the above method, the specific steps of S3 include: if no time semantics is parsed in the current text, the date of the current day will not be replaced or concatenated. By setting the content field of the last element in the message list to be submitted to the large model as the current time string, and then concatenating the user's original input information, and return the message list; otherwise, directly replace the content field of the last element in the message list with the current time and the parsed user input, and return the message list.
[0030] Preferably, the prompt instructions in S4 include: role prompt, skill requirement prompt, and constraint setting; the role prompt refers to guiding the model to act as an efficient schedule assistant; the skill requirement prompt includes: schedule element collection, JSON result formation and confirmation; the constraint setting includes: schedule information format restriction, information understanding constraint, and multi-round drawing processing constraint.
[0031] In the above method, S5 specifically includes: parsing the answer result of the large model so that the time semantics and location information can be used as interface input parameters for subsequent direct calling of the calendar software interface to automatically create a schedule and set a reminder.
[0032] The present invention also provides a system for generating a schedule assistant based on natural language processing algorithms, including a text processing module connected in sequence for cleaning and formatting the input text, a time information extraction module for extracting the time information of the text obtained by the text processing module using a time semantics parsing algorithm, a time information splicing module for splicing the time information of the text obtained by the text processing module based on the time information obtained by the time information extraction module and replacing the corresponding text in the message list of the user input with the spliced text, a model text output module for studying and designing effective prompt instructions for creating a schedule based on the message list obtained by the time information splicing module to guide the model to generate an output meeting specific requirements, and a schedule creation module for parsing the model answer result processed by the model text output module and calling the calendar software interface to automatically create a schedule and set a reminder.
[0033] Beneficial effects
[0034] The present invention provides a method and system for generating a schedule assistant based on natural language processing algorithms. The method includes: cleaning and formatting the input text, cleaning the text to simplify the text content, making subsequent processing more concise and unified, and the formatting processing is used to uniformly process all user inputs to ensure comprehensive parsing; using a time semantics parsing algorithm to extract the time information of the text, accurately extracting the time information in the user input, reducing parsing errors, and solving the problem of inaccurate time semantics parsing of existing schedule management tools; automatically splicing the time information of the user input text based on the obtained time information, and replacing the corresponding text in the message list of the user input with the spliced text, reducing the manual input steps of the user and improving the operation convenience; parsing the model answer result and calling the calendar software interface to automatically create a schedule and set a reminder, improving the user experience through intelligent schedule management, increasing user satisfaction, and solving the problems of cumbersome operation and poor user experience of existing schedule management tools.
[0035] In summary, the present invention provides a simple, intuitive and effective convenient schedule management assistant tool. Through natural language processing algorithms combined with time semantic parsing technology, it realizes the intelligent parsing and management of the schedule information input by users in natural language, simplifies the user operation process, and improves the accuracy and efficiency of schedule management. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 FIG. is a flowchart of a method for generating a schedule assistant based on natural language processing algorithms according to an embodiment of the present invention.
[0037] Figure 2 FIG. is a system flowchart of a method for generating a schedule assistant based on natural language processing algorithms according to an embodiment of the present invention. DETAILED IMPLEMENTATION METHOD
[0039] To make the objectives, technical solutions and advantages of the present invention clearer, the following further describes the technical solutions clearly and completely in conjunction with the drawings of the present invention.
[0040] The first group of embodiments: A method for generating a schedule assistant based on natural language processing algorithms
[0041] This group of embodiments provides a method for generating a schedule assistant based on natural language processing algorithms, as Figure 1 shown, including the following steps:
[0042] S1: Clean and format the input text; specifically: First, set up a text input interface for users to input text, and then process the input text. To improve the text quality of the parameters to be detected during time entity recognition, the cleaning and formatting of the input text are designed. After receiving the user input, first perform the cleaning and formatting of the text: Remove all punctuation marks, including Chinese and English commas, periods, exclamation marks, question marks, semicolons, etc., to simplify the text; Use the text cleaning function, as shown in Table 1, to further remove HTML tags, abnormal characters, redundant characters, bracket supplementary content, URLs, email addresses, phone numbers, and replace full-width letters, numbers, spaces and other characters with half-width formats to ensure the consistency of text processing; Obtain the current date and time and format it into a standard date-time string for subsequent processing; In a specific embodiment of the present invention, the user will make multiple inputs on the text input interface, and the multiple inputs of the user constitute a message list. Extract all the content input by the user from the message list input by the user through regular matching and concatenate it into an overall string to ensure the comprehensiveness of parsing. Check whether there are the same date, time or meeting topic keywords in the user input through regular matching. If multiple inputs involve the same date or event (such as "3 pm tomorrow" and "have a meeting at 3 pm"), it can be considered that they belong to the same schedule; If multiple different times are mentioned in the input, it can be judged whether they belong to the same event through time logic.
[0043] Table 1. Text before and after data cleaning
[0044]
[0045]
[0046] S2: Use the time semantic parsing algorithm to extract the time information from the text obtained in S1. To accurately parse time entities from the cleaned text, a time semantic parsing algorithm is designed. Define a semantic parsing function to process the parsed time information, ensure the unified time format, and adjust it to a future time: perform week description replacement to improve the accuracy of semantic parsing; identify and extract time expressions in the text through the time entity recognition function in natural language technology to obtain time entities and their corresponding times. If no extraction is made, return an empty string; otherwise: parse the extracted time entities and their corresponding times, convert the time corresponding to the entity to the standard time format, and at the same time, judge the entity content. If the entity content includes the start time, format the start time range as a string and return it. If the entity content only contains the start time, format the start time range as a string and return it. For example: Suppose the extracted start time is "3:00 PM, February 21, 2025", and the end time is "5:00 PM, February 21, 2025". Then the time difference is 2 hours, and the final formatted string should be "2025-2-21 15:00:00-2025-2-21 17:00:00".
[0047] Adjust the target time according to the current time to ensure it is a valid future time, that is: process the time corresponding to the time entity. Specifically: design a time information adjustment function to adjust the target time according to the current time and return the next valid future time, thereby adjusting the time corresponding to the time entity to ensure it is a future time; the time information adjustment function is used to judge whether the time is a future time. If not, give a valid future time. For example: Suppose the current time is "10:00 AM, February 20, 2025", and the time entered by the user is "10 o'clock tomorrow morning". The current time is 10:00 AM, February 20, 2025, and "10 o'clock tomorrow morning" is the target time entered by the user, that is: 10:00 AM, February 21, 2025; calculate the new end time using the start time and time difference and format it as a string and return it. The text processed through this step is shown in Table 2.
[0048] Table 2. Semantic Parsing Example Table
[0049]
[0050]
[0051] S3: Based on the time information obtained in S2, splice the time information to the text information obtained in S1, and replace the corresponding text in the user input message list with the spliced text. To provide more accurate time information prompts for the model, conditional judgment is designed to screen whether time semantics are parsed. If no clear time semantics are parsed, the current time (the current time refers to the user input time of the content field of the last element in the message list to be submitted to the large model) is intelligently spliced with the user's original input to generate a schedule prompt to be confirmed. If clear time semantics are detected, a schedule prompt containing the accurate time point is directly generated to facilitate the user's quick confirmation.
[0052] S4: Based on the message list obtained in S3, study and design effective prompt instructions for creating a schedule to guide the model to generate outputs that meet specific requirements. In a specific embodiment of the present invention, in order to ensure that the system can generate outputs that meet the user's needs, schedule assistant prompt instructions are designed. As shown in Table 3, before the prompt instructions were designed, when the user input corresponding schedule arrangement requirements, the results default generated by the large model were relatively vague in all aspects and difficult to provide direct schedule arrangement help to the user. Specific examples are as follows.
[0053] Table 3. Default Output of the Large Model
[0054]
[0055]
[0056]
[0057]
[0058] In the process of designing the prompt instructions for the schedule assistant, several key aspects were clarified:
[0059] (1) Role prompt: Clarify the role of the instruction model, that is, as an efficient schedule assistant, to ensure that the model always maintains this role orientation when parsing and generating outputs. For example, the user inputs: "From 3 pm to 5 pm tomorrow, I will have a meeting with Wang in Conference Room 301 on the 2nd floor of the company". To guide the model to correctly understand and output, we can clearly tell the model in the system prompt: You are an efficient schedule assistant, responsible for collecting and generating schedule information; extracting key information such as the time, location, and participants of the meeting; only processing valid information for future times and outputting in the agreed format as JSON. In this way, the model will extract information and output structured JSON results according to these prompts.
[0060] (2) Skill Requirement Hints: The model is required to have skills such as schedule element collection, JSON result formation and confirmation, etc., to ensure that the model can accurately extract key information from the user input and return the result in a suitable format. Among them, the JSON result formation and confirmation include the function of organizing information, that is, when the start time of the schedule is collected, the schedule information that is not explained by the model is directly returned to the user in JSON format, and the returned JSON structure is defined. And add a user recognition and selection process to guide the user to click the "Create Schedule" button on the page to synchronize the schedule information to the enterprise WeChat schedule.
[0061] (3) Constraint Setting: Set constraints on schedule information format, information understanding, and multi-round conversation processing to ensure that the model can maintain accuracy and stability when processing complex inputs.
[0062] After adding the prompt instructions and keeping the same user input, specific output examples are shown in Table 4. Although the results returned by the large model are clearer and more intelligent, there is still room for improvement in the recognition of schedule time.
[0063] Table 4. Output of the large model after adding prompt instructions
[0064]
[0065]
[0066]
[0067] S5: Analyze the model answer result processed in S4 and call the calendar software interface to automatically create a schedule and set a reminder; when the user inputs a schedule arrangement, directly analyze the model answer result, call the calendar software interface to automatically create a schedule and set a reminder. As shown in Table 5, after key processes such as prompt instructions, text cleaning, and semantic parsing, the optimized text is input to the large model to obtain the result of the large model answer; by directly analyzing the answer and calling the platform calendar interface, one-key creation of a schedule and reminder service is performed.
[0068] Table 5. Answer of the large model obtained by using the schedule assistant to generate text
[0069]
[0070] The Second Group of Embodiments: A System for Generating a Schedule Assistant Based on Natural Language Processing Algorithms
[0071] This group of embodiments provides a system for generating a schedule assistant based on natural language processing algorithms, as Figure 2As shown, it includes a text processing module for cleaning and formatting the input text, a time information extraction module for extracting the time information of the text obtained by the text processing module using a time semantic parsing algorithm, a time information splicing module for splicing the time information of the text obtained by the text processing module based on the time information obtained by the time information extraction module and replacing the corresponding text in the message list input by the user with the spliced text, a model text output module for studying and designing an effective prompt instruction for creating a schedule based on the message list obtained by the time information splicing module to guide the model to generate an output meeting specific requirements, and a schedule creation module for parsing the model answer result processed by the model text output module and calling the calendar software interface to automatically create a schedule and set a reminder.
[0072] The above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.
Claims
1. A method for generating a schedule assistant based on natural language processing algorithms, characterized in that, It includes the following steps: S1: Clean and format the input text; S2: Use the time semantic parsing algorithm to extract the time information of the text obtained in S1; S3: Based on the time information extracted in S2, splice the time information of the text obtained in S1, and replace the corresponding text in the message list of the user input with the spliced text; S4: Based on the message list obtained in S3, research and design an effective prompt instruction for creating a schedule to guide the model to generate an output that meets specific requirements; S5: Parse the model answer result processed in S4 and call the calendar software interface to automatically create a schedule and set a reminder.
2. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 1, wherein The S1 includes the following steps: S11: Remove all punctuation marks from the input text; S12: Call the text cleaning function to remove special characters from the text obtained in S11, and replace full-width letters, numbers, and spaces with half-width; the special characters include: HTML tags, abnormal characters, redundant characters, parentheses and supplementary content in parentheses, URLs, E-mails, and phone numbers; S13: Obtain the current date and time and format it into a standard date and time string; S14: Extract all user input contents from the message list of the user input and splice them into an overall string, and check whether there are the same date, time, or meeting topic keywords in the user input through regular matching. If multiple inputs involve the same date or event, it is considered that they belong to the same schedule; if multiple different times are mentioned in the input, it can be judged whether they belong to the same event through time logic.
3. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 1 or 2, characterized in that, The user input content in S14 is confirmed by regular expression matching.
4. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 1 or 2, characterized in that, The specific implementation process of the time semantic parsing algorithm in S2 includes the following steps: S21: Perform synonym mapping on time quantifiers and time quantities in the Chinese idiomatic context; the time quantifiers include: day, date, day, week; the time quantities include: yesterday, tomorrow, before, after; S22: Extract relationship entities through natural language technology, identify and extract all possible time expressions from the text string, obtain the time entity and its corresponding time. If no time entity is extracted, return an empty string, otherwise jump to S23; S23: Parse the entity and its corresponding time extracted in S22, and convert the time corresponding to the entity into a standard time format. At the same time, judge the entity content. If the entity content includes the start time, format the start time range into a string and return it. If the entity content only contains the start time, format the start time range into a string and return it.
5. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 4, wherein, S23 also includes the processing of the time corresponding to the time entity. Specifically, design a time information adjustment function to adjust the target time according to the current time and return the next future valid time, so as to adjust the parsed start time to ensure that it is a future time; the time information adjustment function is used to judge whether the time is a future time, and if not, give a future valid time.
6. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 5, wherein The specific steps of S3 are as follows: If the current text does not parse the time semantics, the date of the current day will not be replaced or spliced. By setting the content field of the last element in the message list to be submitted to the large model as the current time string, then splicing the original input information of the user, and returning the message list; Otherwise, directly replace the content field of the last element in the message list with the current time and the parsed user input, and return the message list.
7. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 6, wherein The prompt instructions described in S4 include: role prompt, skill requirement prompt, and constraint setting; The role prompt refers to guiding the model to act as an efficient schedule assistant; The skill requirement prompts include: schedule element collection, JSON result formation and confirmation; The constraint setting includes: schedule information format limitation, information understanding constraint, and multi-round drawing processing constraint.
8. The method for generating a schedule assistant based on a natural language processing algorithm according to claim 7, wherein, S5 specifically includes: parsing the answer result of the large model so that the time semantics and location information can be used as interface input parameters for subsequent direct calls to the calendar software interface to automatically create schedules and set reminders.
9. A system for generating a schedule assistant based on natural language processing algorithms, characterized in that, It includes a text processing module for cleaning and formatting the input text, a time information extraction module for using the time semantics parsing algorithm to extract the time information of the text obtained by the text processing module, a time information splicing module for splicing the time information of the text obtained by the text processing module based on the time information obtained by the time information extraction module and replacing the corresponding text in the message list of the user input with the spliced text, a model text output module for studying and designing effective prompt instructions for creating schedules based on the message list obtained by the time information splicing module to guide the model to generate outputs that meet specific requirements, and a schedule creation module for parsing the model answer result processed by the model text output module and calling the calendar software interface to automatically create schedules and set reminders.