Event context generation method and device based on large language model and medium
Through the event context generation method based on the large language model, the problems of insufficient clarity of event context and limited universality in the prior art are solved, and clear and logical event contexts are generated in different fields and complex events.
Patent Information
- Application Number
- CN202411840116.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The existing event context generation technology has problems of insufficient clarity and limited universality, and it is difficult to effectively generate clear and logical event contexts in different fields and complex events.
The event vein generation method based on the large language model is adopted, and relevant data is obtained through the event attribute information input by the user, denoising and clustering is performed. The preset large language model is used to judge the data correlation and sort out the logical order of the vein nodes to generate a clear event vein list.
The logic and clarity of the event context are realized, allowing users to quickly understand the causes and consequences of events, and there is no need to adapt to specific areas, and it is suitable for different types of events and areas.
Smart Images

Figure CN119782520A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language model application, and in particular to an event context generation method, device and medium based on a large language model. Background Art
[0002] With the development of the Internet, information is growing exponentially. Every day, a huge amount of data is generated from various channels such as news media, social media, and corporate documents. For example, in the field of news, a major event may have hundreds or thousands of reports from different media. These reports contain a wide range of content, including different aspects of the event, situations at different stages, etc. It is difficult for users to sort out the ins and outs of the event in a short period of time. Enterprises also face similar problems. In market research, project tracking and other work, a large amount of documents and data about market dynamics and project progress will be accumulated. A technology is needed to help users quickly understand the development path of related events. Event context generation technology came into being to meet the needs of extracting key event clues from a large amount of information. The current event context generation scheme has the following main shortcomings: 1. Lack of clarity: On the one hand, the poor visualization effect leads to unclear context, making it difficult for users to quickly grasp the core content and development process; on the other hand, the information in the event context is too complicated, and there is no effective hierarchical division and key points, which makes it easy for users to get lost in a large amount of information when browsing. For example, when presenting the R&D events of large-scale scientific and technological projects, if the technical details of each stage, personnel changes and other information are listed without sorting, the entire context will appear chaotic. 2. Limited versatility: Event context generation schemes are often designed for specific types of events or fields and lack versatility. When applied to other fields or different types of events, the effect is greatly reduced. For example, the context generation technology designed for entertainment events may not be able to accurately capture the concepts, relationships and development logic unique to the financial field when dealing with financial market volatility events, resulting in the generated context being unable to meet the needs of financial analysis. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to a first aspect of the present invention, a method for generating event context based on a large language model is provided, the method comprising the following steps:
[0005] S100, based on event attribute information input by a user, obtaining a plurality of event data related to the event attribute information, wherein the event attribute information at least includes an event name.
[0006] S200, performing denoising processing on the plurality of event data to obtain a plurality of event data after denoising processing.
[0007] S300, clustering the multiple event data after denoising to obtain M clusters, and obtaining one event data from each cluster to add to the event data set to be processed; the initial value of the event data set to be processed is empty.
[0008] S400, for each event data in the event data set to be processed, use the preset large language model to determine whether the event data is semantically related to the event attribute information. If so, add the event data to the candidate event data set; the initial value of the candidate event data set is empty.
[0009] S500, using the preset large language model to sort out the event contexts in the candidate event data set to generate a corresponding event context list.
[0010] S600, for each context node in the event context list, use the preset large language model to determine whether the context node is semantically related to the event attribute information, and if so, add the context node to the candidate context node set; the initial value of the candidate context node set is empty; the context node includes the event context time and the event context name.
[0011] S700: Use the preset large language model to sort out the logical order of the context nodes in the candidate context node set to obtain a logically clear context node set as the intermediate context node set.
[0012] S800, for each context node in the intermediate context node set, obtain the similarity between the context node and each event data in the candidate event data set. If there is event data in the candidate event data set whose similarity with the context node is greater than the set similarity threshold, use the event data as the source data of the context node, and add the context node and the corresponding source data to the target context node set; the initial value of the target context node set is empty.
[0013] According to a second aspect of the present invention, there is provided an electronic device comprising a processor and a memory; the processor is used to execute the steps of the method described in the first aspect of the present invention by calling a program or instruction stored in the memory.
[0014] According to a second aspect of the present invention, there is provided a computer-readable storage medium storing a program or instructions, wherein the program or instructions enable a computer to execute the steps of the method according to the first aspect of the present invention.
[0015] The present invention has at least the following beneficial effects:
[0016] The event context generation method based on the large language model provided in the embodiment of the present invention can ensure the logic of the context by generating and sorting out the event context through the large language model, so that the user can browse the causes and consequences of the event more clearly. In addition, by using the general understanding ability of the large language model, there is no need to perform adaptation work for each field.
[0017] It should be understood that the content described in this section is not intended to be the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of an event context generation method based on a large language model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0022] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0023] The present invention aims to provide an event context generation method that can meet the following conditions (1) to (3):
[0024] Condition (1): Enhance the visualization effect, make the presented event context clear, and allow users to quickly grasp the core content and development process of the event;
[0025] Condition (2): Effectively divide the information in the event context into different levels and highlight the key points to prevent users from getting lost when browsing a large amount of information, and ensure that the information presentation is organized whether it is a large-scale scientific and technological project development event or other complex events;
[0026] Condition (3): The context generation technology is not limited to a specific type of event or field, so that it can play a good role in different fields and various events. For example, this technology can accurately capture the concepts, relationships and development logic unique to the financial field to meet the needs of financial analysis, and can also be applied to event analysis in other fields such as entertainment.
[0027] Based on this, an embodiment of the present invention provides an event context generation method based on a large language model. The event context is generated by a large language model. The method includes the following steps: event information input and related data acquisition; data cleaning and correlation judgment; large model event context generation; event context cleaning and combing; event context source information tracing. Specifically, Figure 1 As shown, the method may include the following steps:
[0028] S100, based on event attribute information input by a user, obtaining a plurality of event data related to the event attribute information, wherein the event attribute information at least includes an event name.
[0029] In an embodiment of the present invention, the attribute information further includes one of an event keyword and an event description.
[0030] In another embodiment of the present invention, the attribute information further includes event keywords and event descriptions.
[0031] In the embodiment of the present invention, multiple relevant documents can be obtained from the open source database using the data acquisition interface according to the event name or according to the event name and event keywords as the corresponding event data. It is known to those skilled in the art that any method for obtaining multiple event data related to the event attribute information from the open source database based on the event attribute information input by the user falls within the protection scope of the present invention.
[0032] S200, performing denoising processing on the plurality of event data to obtain a plurality of event data after denoising processing.
[0033] In the embodiment of the present invention, the denoising process is to remove the noise data in the plurality of event data. The noise data may include data with wrong format, irrelevant advertisement content and the like.
[0034] It is known to those skilled in the art that any method for removing noise data from a plurality of event data falls within the protection scope of the present invention.
[0035] S300, clustering the multiple event data after denoising to obtain M clusters, and obtaining one event data from each cluster to add to the event data set to be processed; the initial value of the event data set to be processed is empty.
[0036] In the embodiment of the present invention, clustering is performed on multiple event data after denoising, semantic deduplication can be performed, data with too high similarity can be removed, the amount of calculation for subsequent processing can be reduced, and the data can be kept pure.
[0037] In S300 , a commonly used clustering algorithm such as K-Means or Single-pass clustering algorithm may be used to cluster the multiple event data after denoising. The specific clustering method may be the existing technology.
[0038] In the embodiment of the present invention, a piece of event data may be randomly obtained from each cluster and added to the event data set to be processed.
[0039] S400, for each event data in the event data set to be processed, use the preset large language model to determine whether the event data is semantically related to the event attribute information. If so, add the event data to the candidate event data set; the initial value of the candidate event data set is empty.
[0040] Since the event data in the event data set to be processed is retrieved only through information such as event name or event name and event keywords, it cannot be guaranteed that all event data are related to the event corresponding to the event name. Therefore, it is necessary to further determine the relevance semantically.
[0041] In the embodiment of the present invention, the preset large language model may be any large language model in the existing large language models. It is possible to determine whether each event data in the event data set to be processed is semantically related to the event attribute information by inputting corresponding interactive information, i.e., instruction statements, into the preset large language model.
[0042] Specifically, in S400, the preset large language model determines whether the event data is semantically related to the event attribute information based on the first interaction information.
[0043] In an embodiment of the present invention, the first interaction information may include judgment description information, answer indication information, output indication information, and event data to be judged, wherein the judgment description information is used to indicate whether the preset large language model judges whether the event data to be judged is semantically related to the event attribute information, the answer indication information is used to indicate how the preset large language model answers, and the output indication information is used to indicate how the preset large language model outputs the answer. The first interaction information may be determined based on actual conditions, for example, it may be determined based on experience.
[0044] In an illustrative embodiment, the first interactive information may be: "Combined with the event description, determine whether the following news contains information related to eventName, answer 'yes' or 'no', and output the result in a standard json format {'Is it related': "}\n[Event description] eventDesc\n[News] clusterDataList. ". Among them, eventName represents the event name that needs to be filled in, eventDesc represents the event description that needs to be filled in, and clusterDataList represents the event data in the event data set to be processed that needs to be filled in.
[0045] By inputting the first interaction information into the large language model, the large language model will determine whether each event data in the event data set to be processed is semantically related to the event attribute information based on the received first interaction information. If so, it will output yes in JSON format, otherwise, it will output no.
[0046] In S400, if a piece of event data in the event data set to be processed is not semantically related to the event attribute information, the piece of event data is not used.
[0047] S500, using the preset large language model to sort out the event contexts in the candidate event data set to generate a corresponding event context list.
[0048] In the embodiment of the present invention, the context node includes the event context time and the event context name, and the specific format is [{"event context time":"","event context name":""}].
[0049] In S500, the preset large language model sorts out the event context in the candidate event data set based on the second interaction information to generate a corresponding event context list.
[0050] In an embodiment of the present invention, the second interaction information includes combing description information, output indication information, combing condition information, and event data to be combed, the combing description information is used to instruct the preset large language model to comb the event context in the candidate event data set based on the second interaction information, the output indication information is used to instruct the preset large language model in what way to output the answer, and the combing condition information is used to indicate the conditions based on which the preset large language model combs. The second interaction information can be determined based on actual conditions, for example, it can be determined based on experience.
[0051] In an exemplary embodiment, the second interactive information may be: based on the following news list, summarize the development context related to the event eventName, and output in standard json format [{"Event context time":"","Event context name":""}]. \nRequirements: 1. The context name must be a declarative sentence; 2. The context name must be concise; 3. Remove reference phenomena\n
News list
[0052] By inputting the second interaction information into the large language model, the large language model will sort out the event contexts in the candidate event data set according to the received second interaction information, and output an event context list in the format of [{"event context time":"","event context name":""}] in standard JSON format.
[0053] S600, for each context node in the event context list, using the preset large language model to determine whether the context node is semantically related to the event attribute information, if so, adding the context node to a candidate context node set; the initial value of the candidate context node set is empty.
[0054] Since there may be information in the context combed by the large model that is irrelevant to the event, it is necessary to further determine the relevance of each context node with the event.
[0055] Further, in S600, the preset large language model determines whether the context node is semantically related to the event attribute information based on the third interaction information.
[0056] In an embodiment of the present invention, the third interaction information includes judgment description information, answer indication information, output indication information, and context nodes to be judged, the judgment description information is used to indicate whether the context nodes to be judged are semantically related to the event attribute information based on the third interaction information, the answer indication information is used to indicate how the preset large language model answers, and the output indication information is used to indicate how the preset large language model outputs the answer. The third interaction information can be determined based on actual conditions, for example, it can be determined based on experience.
[0057] In an exemplary embodiment, the third interaction information may be: "Based on the event description, determine whether the following context node contains information related to eventName, answer 'yes' or 'no', and output the result in a standard json format {"Is it related": ""}\n[Event description] eventDesc\n[Context node] venationDataList." Wherein, venationDataList represents the context node in the event context list that needs to be filled in.
[0058] By inputting the third interaction information into the large language model, the large language model will determine whether each context node in the event data set to be processed is semantically related to the event attribute information based on the received third interaction information. If so, it will output yes in JSON format, otherwise, it will output no.
[0059] In S600, if a context node in the event context list is not semantically related to the event attribute information, the context node is discarded.
[0060] S700: Use the preset large language model to sort out the logical order of the context nodes in the candidate context node set to obtain a logically clear context node set as the intermediate context node set.
[0061] Since the time sequence of events sorted out by the large language model is not clear enough and the logic is confusing, it is necessary to sort out the entire event sequence to make the logic clear. The sorting process requires considering both the time and logic of occurrence.
[0062] Further, in S700, the preset large language model sorts out the logical order of the candidate context nodes based on the fourth interaction information.
[0063] In an embodiment of the present invention, the fourth interaction information includes combing description information, output indication information, and context nodes to be combed, the combing description information is used to instruct the preset large language model to comb the logical order of the candidate context nodes based on the fourth interaction information, and the output indication information is used to instruct the preset large language model in what manner to output the answer. The fourth interaction information can be determined based on actual conditions, for example, based on experience.
[0064] In an exemplary embodiment, the fourth interactive information may be: "Please sort out the following event context and re-order it so that it is logically clear and duplicate items can be removed. The result is directly output as a sorted context node sequence list, and output in a standard JSON format [sequence number 1, sequence number 2]. [Context node list] pureVenationList." Wherein, pureVenationList represents the context node in the candidate context node set that needs to be filled in.
[0065] By inputting the fourth interaction information into the large language model, the large language model will sort out the logical order of the candidate context nodes according to the received fourth interaction information, and output the sorted context node sequence number list in a standard JSON format.
[0066] S800, for each context node in the intermediate context node set, obtain the similarity between the context node and each event data in the candidate event data set. If there is event data in the candidate event data set whose similarity with the context node is greater than the set similarity threshold, use the event data as the source data of the context node, and add the context node and the corresponding source data to the target context node set; the initial value of the target context node set is empty.
[0067] In an embodiment of the present invention, the similarity may be cosine similarity. The similarity threshold may be set to an empirical value, such as 0.8. It is known to those skilled in the art that any method for obtaining the cosine similarity between the context node and each event data in the candidate event data set belongs to the protection scope of the present invention.
[0068] In S800, if there is no event data in the candidate event data set whose similarity with a certain context node is greater than a set similarity threshold, the context node is discarded.
[0069] Furthermore, the event context generation method based on the large language model provided by the embodiment of the present invention further includes the following steps:
[0070] S900: Visually display the context nodes in the target context node set.
[0071] It is known to those skilled in the art that any method for visually displaying the context nodes in the target context node set falls within the protection scope of the present invention.
[0072] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0073] The embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.
[0074] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0075] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating event context based on a large language model, characterized in that: The method comprises the following steps: S100, based on event attribute information input by a user, acquiring a plurality of event data related to the event attribute information, wherein the event attribute information at least includes an event name; S200, performing denoising processing on the plurality of pieces of event data to obtain a plurality of pieces of event data after denoising processing; S300, clustering the multiple pieces of event data after denoising to obtain M clusters, and obtaining one piece of event data from each cluster to add to the event data set to be processed; The initial value of the event data set to be processed is empty; S400, for each event data in the event data set to be processed, using a preset large language model to determine whether the event data is semantically related to the event attribute information, and if so, adding the event data to the candidate event data set; The initial value of the candidate event dataset is empty; S500, using the preset large language model to sort out the event contexts in the candidate event data set to generate a corresponding event context list; S600, for each context node in the event context list, using the preset large language model to determine whether the context node is semantically related to the event attribute information, and if so, adding the context node to a set of candidate context nodes; The initial value of the candidate context node set is empty; The context node includes event context time and event context name; S700, using the preset large language model to sort out the logical order of the context nodes in the candidate context node set, to obtain a logically clear context node set as an intermediate context node set; S800, for each context node in the intermediate context node set, obtain the similarity between the context node and each event data in the candidate event data set, if there is event data in the candidate event data set whose similarity with the context node is greater than a set similarity threshold, use the event data as the source data of the context node, and add the context node and the corresponding source data to the target context node set; The initial value of the target context node set is empty.
2. The method according to claim 1, characterized in that The following steps are also included: S900: Visually display the context nodes in the target context node set.
3. The method according to claim 1, characterized in that The attribute information also includes an event description.
4. The method according to claim 3, characterized in that: In S400, the preset large language model determines whether the event data is semantically related to the event attribute information based on the first interaction information, wherein the first interaction information includes judgment description information, answer indication information, output indication information and event data to be judged, wherein the judgment description information is used to indicate the preset large language model to judge whether the event data to be judged is semantically related to the event attribute information, the answer indication information is used to indicate how the preset large language model should answer, and the output indication information is used to indicate how the preset large language model should output the answer.
5. The method according to claim 1, characterized in that In S500, the preset large language model combs the event context in the candidate event data set based on the second interaction information to generate a corresponding event context list, wherein the second interaction information includes combing description information, output indication information, combing condition information and event data to be combed, the combing description information is used to instruct the preset large language model to comb the event context in the candidate event data set based on the second interaction information, the output indication information is used to instruct the preset large language model in what manner to output an answer, and the combing condition information is used to indicate on which conditions the preset large language model combs.
6. The method according to claim 1, characterized in that In S600, the preset large language model determines whether the context node is semantically related to the event attribute information based on the third interaction information, and the third interaction information includes judgment description information, answer indication information, output indication information and the context node to be judged. The judgment description information is used to indicate that the preset large language model determines whether the context node to be judged is semantically related to the event attribute information based on the third interaction information, the answer indication information is used to indicate how the preset large language model answers, and the output indication information is used to indicate how the preset large language model outputs the answer.
7. The method according to claim 1, characterized in that In S700, the preset large language model sorts out the logical order of the candidate context nodes based on the fourth interaction information, and the fourth interaction information includes sorting description information, output indication information and context nodes that need to be sorted. The sorting description information is used to instruct the preset large language model to sort out the logical order of the candidate context nodes based on the fourth interaction information, and the output indication information is used to instruct the preset large language model in what manner to output the answer.
8. The method according to claim 1, characterized in that In S300, a K-Means or Single-pass clustering algorithm is used to cluster the multiple event data after the denoising process.
9. An electronic device, characterized in that: including a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 8 by calling the program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Hot news event venation generation method and device based on BERT
CN116992886A
Contradiction dispute event venation generation method
CN118569389A
Search event context display method and generation method, and electronic device
WO2024159994A1
Cited By
Event context reduction method and system based on vector retrieval and large language model
CN120780759A