Time entity analysis method and device, equipment, medium and computer program product
By combining a large language model with customized time parsing rules, we can identify and structure the parsed time entities, solving the problem of inaccurate parsing results in existing methods and achieving flexible and generalizable time parsing.
Patent Information
- Application Number
- CN202511012740.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-09-19
AI Technical Summary
Existing temporal entity parsing methods suffer from inaccurate parsing results, especially in terms of flexibility, context understanding and generalization capabilities.
Combining a large language model with custom time parsing rules, it identifies time entities through a natural language understanding model, performs supplementary processing based on contextual relationships, and performs structured parsing through time parsing data structures, supporting multiple time expressions.
It achieves more flexible and more generalizable time parsing, improves the accuracy and stability of complex time expressions, and adapts to diverse natural language environments.
Smart Images

Figure CN120671660A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language parsing, and in particular to a time entity parsing method, apparatus, device, medium and computer program product. Background Art
[0002] Intelligent dialogue systems are widely used in scenarios such as customer service, intelligent assistants, and task scheduling. During natural language interactions, users often use time-related queries and instructions, such as "check next week's schedule" or "book a meeting every Thursday." Existing time extraction and parsing methods include rule-based matching, statistical learning, and direct inference using large language models. Rule-based matching methods suffer from inflexible expression; statistical learning methods rely on large amounts of annotated data and struggle to capture the diversity of natural language expressions; and direct inference using large language models suffers from incomplete logical reasoning chains and unstable parsing results. Summary of the Invention
[0003] The present invention provides a time entity parsing method, apparatus, device, medium and computer program product, which are used to solve the problem of inaccurate parsing results in existing natural language time entity parsing methods.
[0004] The present invention provides a time entity resolution method, comprising the following steps: Recognizing the text to be processed by a natural language understanding model to obtain a time entity of the text to be processed; the natural language understanding model is obtained by training a language sample containing a time entity; Based on the time entity, determining the time expression information of the text to be processed; The time expression information is parsed through a time parsing data structure to obtain a time parsing result.
[0005] According to a time entity parsing method provided by the present invention, identifying a text to be processed by a natural language understanding model to obtain a time entity of the text to be processed includes: Identify sentences in the text to be processed in sequence using a natural language understanding model to determine target sentences containing time information in the text to be processed; The time information is supplemented based on the context of the target sentence to obtain the time entity of the text to be processed.
[0006] According to a time entity parsing method provided by the present invention, the time entity includes a time combination, a fuzzy time, and an offset time; and determining the time expression information of the to-be-processed text based on the time entity includes: Obtaining the recognition time of the text to be processed; In the case where the recognition time is the basic time, the time expression information of the text to be processed is determined based on one entity or a combination of multiple entities in the time combination, the fuzzy time and the offset time.
[0007] According to a time entity resolution method provided by the present invention, the time entity resolution method further includes: Construct a time parsing solution corresponding to each target time expression and obtain a set of time parsing rules; Construct the mapping relationship between the date node and the time record table to obtain the mapping time table; A time resolution data structure is constructed based on the time resolution rule set and the mapping time table.
[0008] According to a time entity parsing method provided by the present invention, the target time expression includes an absolute time expression, a relative time expression, and a periodic time expression; the time expression information is parsed using a time parsing data structure to obtain a time parsing result including: When the time expression information is expressed in the absolute time expression, performing supplementary parsing on the time expression information using the mapping timetable to obtain a time parsing result; When the time expression information is expressed in the relative time expression mode, the time expression information is parsed based on the time parsing rule set to obtain a time parsing result; In a case where the time expression information is expressed in the periodic time expression manner, tag parsing is performed on the time expression information based on the mapping time table to obtain a time parsing result.
[0009] According to a time entity parsing method provided by the present invention, the time expression information is parsed using a time parsing data structure to obtain a time parsing result, which includes: When the recognition result of the text to be processed does not contain a time entity, outputting a prompt message of lack of time information; In the case that the recognition result of the text to be processed contains an incomplete time entity, marking the time information of the text to be processed and outputting prompt information of the marking result; In the case that the recognition result of the text to be processed contains a complete time entity, a step of determining the time expression information of the text to be processed is performed.
[0010] The present invention also provides a time entity parsing device, comprising the following modules: A temporal entity recognition module is configured to recognize the text to be processed using a natural language understanding model to obtain the temporal entity of the text to be processed; the natural language understanding model is trained on language samples containing temporal entities; A time expression information determination module, configured to determine the time expression information of the text to be processed based on the time entity; The time parsing module is used to parse the time expression information through the time parsing data structure to obtain a time parsing result.
[0011] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements any of the above-mentioned time entity parsing methods.
[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described time entity parsing methods.
[0013] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned time entity parsing methods.
[0014] The temporal entity parsing method, apparatus, device, medium, and computer program product provided by the present invention utilize a natural language understanding model to identify temporal entities in a text to be processed, thereby obtaining temporal entities within the text. Based on these temporal entities, temporal expression information of the text to be processed is obtained through diverse expressions. This temporal expression information is then parsed using a structured parsing mechanism to obtain a temporal parsing result. Combining a natural language understanding model with structured parsing rules, the present invention achieves more flexible and generalizable temporal parsing. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 This is one of the flow charts of the time entity resolution method provided by the present invention.
[0017] Figure 2 This is the second flow chart of the time entity resolution method provided by the present invention.
[0018] Figure 3It is a structural diagram of the time entity parsing device provided by the present invention.
[0019] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0021] The present invention provides a temporal entity extraction and temporal entity parsing method based on a large language model (LLM) combined with custom temporal parsing rules, so as to solve the problems of poor flexibility, poor context understanding ability, poor generalization ability and poor stability in existing natural language entity parsing methods, which lead to reduced accuracy of temporal entity parsing results of existing natural language entity parsing methods.
[0022] The core objectives achieved by the present invention include the following: Accurate extraction of time entities: By combining the natural language understanding capabilities of a large language model with customized time parsing rules, time entities in complex time expressions can be accurately identified.
[0023] Improved contextual reasoning capabilities: Utilize recursive parsing mechanisms and contextual supplementation logic to improve the ability to understand ambiguous time descriptions, indirect time descriptions, and time descriptions that rely on context.
[0024] Support for multi-dimensional time expression: The present invention can parse time units (for example, year, month, day, hour, minute, second, and quarter), and handle time offsets (for example, "next month" and "three days later") and complex time combinations.
[0025] Enhanced applicability: This invention supports precise parsing of special time concepts (such as holidays, weekends, and weekdays), as well as fuzzy time periods (such as "morning" and "afternoon"), to adapt to a wider range of time entity parsing application scenarios.
[0026] Standardized output: This invention can ensure a unified format for time entity parsing results, making it highly compatible and stable in different task-based dialogue systems or business scenarios.
[0027] The following combination Figures 1-4 The present invention describes the temporal entity resolution method, apparatus, device, medium and computer program product.
[0028] Figure 1 This is one of the flow charts of the time entity resolution method provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 100: Recognize the text to be processed by a natural language understanding model to obtain a time entity of the text to be processed; the natural language understanding model is trained on language samples containing time entities; Specifically, based on the core objectives of the present invention, the specific implementation process of the time entity parsing method provided by the present invention includes: (1) initializing the data structure of time parsing; (2) extracting the time slots in the user input; (3) parsing complex time expressions; (4) standardizing the output of time parsing results; and (5) error handling and supplementation mechanism.
[0029] Regarding the above process (2), this embodiment improves the ability to understand the time expression in the text to be processed (converted from voice information or text information) input by the user through the large language model LLM after instruction fine-tuning, and accurately identifies the time slot in the text to be processed input by the user in combination with customized time parsing rules. By parsing the time description information in natural language (for example, specific time points, time ranges, and cycle times, etc.), it is converted into a structured output format, such as a lightweight data exchange format (Java Script Object Notation, JSON), providing high-quality basic data support for subsequent complex time processing.
[0030] Step 200: Determine the time expression information of the text to be processed based on the time entity; Specifically, regarding the above process (3), this embodiment supports recursive parsing of multiple complex time expressions, such as absolute time, periodic time, and offset time. Through recursive rules and combinatorial logic, it ensures that these complex time expressions can be correctly parsed and converted into standardized structures.
[0031] Regarding process (4) above, in this embodiment, the parsed time information is converted into a standard date and time string format to ensure that it can be directly called and used in downstream systems. For recurring times, the present invention outputs the corresponding cron expression (a string format used to define the execution time of scheduled tasks). This standardized output method allows for seamless integration and processing of time data in complex scenarios.
[0032] Step 300: Parse the time expression information using a time parsing data structure to obtain a time parsing result.
[0033] Specifically, the present invention combines the large language model LLM after instruction fine-tuning with customized structured time parsing rules to solve the limitations of existing time entity parsing methods. The present invention has the following technical effects: flexible adaptation to diverse expressions, overcoming the rigidity of rule matching, and supporting complex natural language time expressions, including text context association parsing; improving generalization capabilities, compared with existing statistical learning-based methods, through the generalization capabilities of the large language model LLM, reducing dependence on large-scale annotated data, and using a small number of examples to adapt to diverse time expressions; enhancing logical reasoning and stability, through structured time parsing rules and a prompt processing mechanism for parsing errors, ensuring the consistency of time parsing results, and avoiding the logical breaks and instability problems of direct reasoning of the large language model LLM. In summary, the present invention breaks through the limitations of existing methods, realizes efficient, stable and highly generalized time expression parsing, and is suitable for time processing tasks in natural language environments.
[0034] The present invention provides an example of the entire process of time entity parsing as follows: User input: Set an alarm for me tomorrow morning. Step 1: Extract the time entity (tomorrow morning) through the large language model LLM; Step 2: Convert the result of step 1 into a standard format (JSON format); Step 3: Time parsing is performed based on the rule. The parsing result is the time range of tomorrow + morning, for example, 08:00:00 on June 9, 2025 to 12:00:00 on June 9, 2025.
[0035] This embodiment uses a natural language understanding model to identify time entities in the text to be processed, obtains time entities in the text to be processed, and then uses diverse expressions based on the time entities to obtain time expression information for the text to be processed. This time expression information is then parsed using a structured parsing mechanism to obtain a time parsing result. This invention combines a natural language understanding model with structured parsing rules to achieve more flexible and more generalizable time parsing.
[0036] In one embodiment, the time entity resolution method provided by the embodiment of the present invention may further include: Step 110: sequentially identify sentences in the text to be processed using a natural language understanding model to determine target sentences containing time information in the text to be processed; Step 120: Supplement the time information based on the context of the target sentence to obtain the time entity of the text to be processed.
[0037] The specific process of identifying the text to be processed through the natural language understanding model and obtaining the time entity of the text to be processed is as follows: after receiving the text to be processed input by the user (converted from various information), the large language model (LLM) after instruction fine-tuning is first called, and the text to be processed input by the user is processed in combination with the customized time parsing rules.
[0038] The processing process of the text to be processed includes: using the natural language understanding model fine-tuned by instructions to identify the sentences in the text to be processed in turn, and obtain the target sentence containing time information in the text to be processed; when the time information contained in the target sentence is incomplete, the incomplete time information is supplemented in combination with the context information of the target sentence, and then the supplemented time information is identified and processed to extract the time slots in the text to be processed. The time slots include specific time points, time ranges, and cycle times, etc., and the extracted time slots are converted into a structured JSON format, that is, the time entity of the text to be processed is obtained.
[0039] This embodiment extracts the time slots in the user input text by identifying and supplementing the time information.
[0040] In one embodiment, the time entity resolution method provided by the embodiment of the present invention may further include: Step 210: Obtain the recognition time of the text to be processed; Step 220: When the recognition time is the base time, the time expression information of the text to be processed is determined based on one entity or a combination of multiple entities in the time combination, the fuzzy time and the offset time.
[0041] The parsing principles of custom time parsing rules are as follows: Absolute time parsing: For example, the time expression "28th" is used to supplement missing time information according to absolute time parsing rules. Periodic time parsing: For example, the time expression "every Monday morning at 8:30" is generated into a standardized cron expression. Time offset parsing: For example, the time expression "8:00 AM offset by 30 minutes" is used to calculate the offset time. The results of time expression information parsing can be stored in a cache for subsequent use.
[0042] This embodiment uses a natural language understanding model fine-tuned by instructions to generate one or more structured time slot information including the time combination, fuzzy time and offset time based on the identified time entity. The time slot information is represented in a unified JSON format for subsequent time value parsing.
[0043] Figure 2This is the second flow chart of the time entity resolution method provided by the present invention. Figure 2 As shown, the method may further include: Step 10: Construct a time parsing solution corresponding to each target time expression to obtain a set of time parsing rules; Step 20: Construct a mapping relationship between date nodes in the time record table to obtain a mapping time table; Step 30: Construct a time resolution data structure based on the time resolution rule set and the mapping time table.
[0044] Specifically, regarding the above process (1), this embodiment establishes the data structure required for time resolution (i.e., the time resolution data structure in this embodiment) during the initialization phase of this application. The time resolution data structure includes a set of time resolution rules and a special timetable (i.e., the mapping timetable in this embodiment).
[0045] The time parsing rule set is used to store parsing methods for different types of time expressions (for example, absolute time expressions, relative time expressions, and periodic time expressions). The special time table is used to define mapping relationships for special times such as holidays, lunar calendar dates, and fuzzy time periods.
[0046] By introducing a parsing mechanism for custom time periods and special dates, the present invention supports the flexible definition and adaptation of ambiguous time periods and special dates. The present invention also supports custom special date tables and time period tables, enabling the flexible definition and adaptation of ambiguous time periods and special dates in different scenarios, ensuring accurate parsing of time expression information in various scenarios.
[0047] This embodiment improves the adaptability of time parsing by pre-building a time parsing data structure including a time parsing rule set and a special time table.
[0048] In one embodiment, the time entity resolution method provided by the embodiment of the present invention may further include: Step 310: When the time expression information is expressed in the absolute time expression, the time expression information is supplementarily parsed using the mapping timetable to obtain a time parsing result. Step 320: When the time expression information is expressed in the relative time expression mode, parse the time expression information based on the time parsing rule set to obtain a time parsing result. Step 330: When the time expression information is expressed in the periodic time expression mode, perform tag parsing on the time expression information based on the mapping time table to obtain a time parsing result.
[0049] Specifically, the present invention achieves efficient and accurate time entity extraction and parsing through the combination of a large language model (LLM) and custom time parsing rules, through the semantic understanding ability of LLM and the controllability of time parsing rules; the present invention also adopts a recursive parsing method to hierarchically process complex time expressions (for example, the time expression content "the first Monday of every month") through a recursive time parsing mechanism, thereby improving the accuracy of time reasoning; the present invention also supports standard time units (for example, year, month, day, hour, minute and second, etc.) through multi-dimensional time information extraction, and simultaneously parses time offset and periodic time (for example, the time expression content "every The present invention also uses contextual supplementation and reasoning to supplement and correct time based on the context of the user input text, avoiding ambiguity or errors caused by lack of contextual information during time parsing. The present invention also supports the parsing of special time concepts such as holidays, weekends, weekdays, and ambiguous time (for example, the time expressions "morning" and "evening") through special time processing, thereby improving the applicability of the present invention. The present invention also uses standardized time output and adopts a unified time format to output time parsing results, ensuring the consistency of parsing results in different application scenarios, thereby improving the compatibility and scalability of the present invention.
[0050] This embodiment improves the accuracy of time parsing by combining a large language model (LLM) with custom parsing rules, a recursive time parsing mechanism, multi-dimensional time information extraction, context supplementation and reasoning, special time processing and standardized time output.
[0051] In one embodiment, the time entity resolution method provided by the embodiment of the present invention may further include: Step 400: If the recognition result of the text to be processed does not contain a time entity, output a prompt message indicating that time information is missing; Step 500: If the recognition result of the text to be processed contains an incomplete time entity, mark the time information of the text to be processed and output prompt information of the marking result; Step 600: When a complete time entity exists in the recognition result of the text to be processed, a step of determining the time expression information of the text to be processed is performed.
[0052] Specifically, regarding the above process (5), in this embodiment, a special mark will be output for a time expression that fails to parse the time entity or is missing information. The special mark can prompt the user to ask again. During the parsing process, if a semantic conflict is encountered (for example, a time expression such as "the past three days" that changes with semantics), the present invention will make a supplementary judgment based on the context information of the user input text. If parsing is not possible, a prompt message will be returned to prompt the user to re-enter. In the case of failure to complete the parsing, such as an unconfigured special date, the input will be marked as "parsing failed" and stored in the exception log.
[0053] This embodiment ensures the consistency of time parsing results through structured parsing and error prompt processing mechanism, avoiding the logical discontinuity and instability problems of LLM direct reasoning.
[0054] The time entity parsing device provided by the present invention is described below. The time entity parsing device described below and the time entity parsing method described above can be referenced to each other.
[0055] Please refer to Figure 3 The present invention also provides a time entity parsing device, comprising: A time entity recognition module 301 is configured to recognize a text to be processed using a natural language understanding model to obtain a time entity of the text to be processed; the natural language understanding model is trained on language samples containing time entities; A time expression information determination module 302 is configured to determine the time expression information of the text to be processed based on the time entity; The time parsing module 303 is configured to parse the time expression information through a time parsing data structure to obtain a time parsing result.
[0056] Optionally, the temporal entity recognition module includes: A target sentence determination unit, configured to sequentially identify sentences in the text to be processed using a natural language understanding model, and determine a target sentence containing time information in the text to be processed; A time entity recognition unit is used to perform supplementary processing on the time information based on the context relationship of the target sentence to obtain the time entity of the text to be processed.
[0057] Optionally, the time entity includes a time combination, a fuzzy time, and an offset time; and the time expression information determination module includes: A recognition time acquisition unit, configured to acquire the recognition time of the text to be processed; The time expression information determination unit is used to determine the time expression information of the text to be processed based on one entity or multiple entity combinations among the time combination, the fuzzy time and the offset time, when the recognition time is the basic time.
[0058] Optionally, the time entity parsing device further includes: A time parsing rule set determination module is used to construct a time parsing solution corresponding to each target time expression mode and obtain a time parsing rule set; A mapping schedule determination module is used to construct a mapping relationship between date nodes in the time record table to obtain a mapping schedule; The time parsing data structure building module is used to build a time parsing data structure based on the time parsing rule set and the mapping time table.
[0059] Optionally, the time parsing module includes: a time expression information supplementary parsing unit, configured to, when the time expression information is expressed in the absolute time expression, supplementarily parse the time expression information using the mapping timetable to obtain a time parsing result; a time expression information parsing unit, configured to parse the time expression information based on the time parsing rule set to obtain a time parsing result when the expression mode of the time expression information is the relative time expression mode; The time expression information tag parsing unit is used to perform tag parsing on the time expression information based on the mapping time table when the expression mode of the time expression information is the periodic time expression mode, so as to obtain a time parsing result.
[0060] Optionally, the time entity parsing device further includes: A first prompt information output module is used to output a prompt information indicating that time information is missing when the recognition result of the text to be processed does not contain a time entity; A second prompt information output module is used to mark the time information of the text to be processed and output prompt information of the marking result when the recognition result of the text to be processed contains incomplete time entities; The complete time entity determination module is used to execute the step of determining the time expression information of the text to be processed when the recognition result of the text to be processed contains a complete time entity.
[0061] Figure 4 An example of a physical structure diagram of an electronic device is shown below. Figure 4As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communications bus 440. The processor 410 may invoke logic instructions in the memory 430 to execute a temporal entity parsing method, which includes: identifying a text to be processed using a natural language understanding model to obtain temporal entities of the text to be processed; the natural language understanding model is trained on language samples containing temporal entities; based on the temporal entities, determining temporal expression information of the text to be processed; and parsing the temporal expression information using a temporal parsing data structure to obtain a temporal parsing result.
[0062] Furthermore, the logic instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0063] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the time entity parsing method provided by the above methods, which includes: identifying the text to be processed through a natural language understanding model to obtain the time entity of the text to be processed; the natural language understanding model is obtained by training a language sample containing a time entity; based on the time entity, determining the time expression information of the text to be processed; parsing the time expression information through a time parsing data structure to obtain a time parsing result.
[0064] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the time entity parsing method provided by the above-mentioned methods, the method comprising: identifying the text to be processed through a natural language understanding model to obtain the time entity of the text to be processed; the natural language understanding model is obtained by training a language sample containing a time entity; based on the time entity, determining the time expression information of the text to be processed; parsing the time expression information through a time parsing data structure to obtain a time parsing result.
[0065] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0066] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A time entity resolution method, characterized in that: include: Recognizing the text to be processed by a natural language understanding model to obtain a time entity of the text to be processed; the natural language understanding model is obtained by training a language sample containing a time entity; Based on the time entity, determining the time expression information of the text to be processed; The time expression information is parsed through a time parsing data structure to obtain a time parsing result.
2. The time entity resolution method according to claim 1, characterized in that: The identifying of the text to be processed by the natural language understanding model to obtain the time entity of the text to be processed includes: Identify sentences in the text to be processed in sequence using a natural language understanding model to determine target sentences containing time information in the text to be processed; The time information is supplemented based on the context of the target sentence to obtain the time entity of the text to be processed.
3. The time entity resolution method according to claim 1, characterized in that: The time entity includes a time combination, a fuzzy time, and an offset time; and determining the time expression information of the to-be-processed text based on the time entity includes: Obtaining the recognition time of the text to be processed; In the case where the recognition time is the basic time, the time expression information of the text to be processed is determined based on one entity or a combination of multiple entities in the time combination, the fuzzy time and the offset time.
4. The time entity resolution method according to claim 1, characterized in that: The time entity parsing method further includes: Construct a time parsing solution corresponding to each target time expression and obtain a set of time parsing rules; Construct the mapping relationship between the date node and the time record table to obtain the mapping time table; A time resolution data structure is constructed based on the time resolution rule set and the mapping time table.
5. The time entity resolution method according to claim 4, characterized in that: The target time expression includes an absolute time expression, a relative time expression, and a periodic time expression. The time expression information is parsed using a time parsing data structure to obtain a time parsing result including: When the time expression information is expressed in the absolute time expression, performing supplementary parsing on the time expression information using the mapping timetable to obtain a time parsing result; When the time expression information is expressed in the relative time expression mode, the time expression information is parsed based on the time parsing rule set to obtain a time parsing result; In a case where the time expression information is expressed in the periodic time expression manner, tag parsing is performed on the time expression information based on the mapping time table to obtain a time parsing result.
6. The time entity resolution method according to claim 1, characterized in that: The time expression information is parsed using a time parsing data structure to obtain a time parsing result, which includes: When the recognition result of the text to be processed does not contain a time entity, outputting a prompt message of lack of time information; In the case that the recognition result of the text to be processed contains an incomplete time entity, marking the time information of the text to be processed and outputting prompt information of the marking result; In the case that the recognition result of the text to be processed contains a complete time entity, a step of determining the time expression information of the text to be processed is performed.
7. A time entity resolution device, characterized in that: include: A temporal entity recognition module is configured to recognize the text to be processed using a natural language understanding model to obtain the temporal entity of the text to be processed; the natural language understanding model is trained on language samples containing temporal entities; A time expression information determination module, configured to determine the time expression information of the text to be processed based on the time entity; The time parsing module is used to parse the time expression information through the time parsing data structure to obtain a time parsing result.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the time entity parsing method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the time entity parsing method as described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the time entity parsing method as described in any one of claims 1 to 6 is implemented.