Large-model-fused affair graph construction and reasoning question and answer method and device

By integrating the big model's event-related graph construction and reasoning Q&A methods, the problems of difficult event relationship reasoning, insufficient graph construction and difficult user answer verification in the existing technology are solved, and efficient and convenient intelligent Q&A services are realized, improving the accuracy and efficiency of information acquisition.

CN119918657APending Publication Date: 2025-05-0210TH RES INST OF CETC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411870536.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

It is difficult for existing technology to effectively reason and construct rational maps, especially when processing massive news data, and lack of automated event extraction, relationship inference and graph construction capabilities, resulting in users requiring manual processing, which is time-consuming and labor-intensive.

Method used

Using the integrated large-scale model of the factual map construction and reasoning Q&A method, we can realize automated event extraction, relationship inference and map construction through the structured extraction of news data, the factual map construction and the reasoning Q&A agent, and support efficient and convenient intelligent Q&A services.

Benefits of technology

It realizes efficient, convenient and trustworthy data access, graph construction and intelligent Q&A full process services, reducing the difficulty of users' information acquisition and improving the accuracy and efficiency of information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918657A_ABST
    Figure CN119918657A_ABST
Patent Text Reader

Abstract

The invention discloses a big-model-fused event atlas construction and question and answer reasoning method and device, and belongs to the field of natural language processing and big models, and the method comprises the steps: S1, news data structured extraction; s2, building a affair graph; and S3, reasoning questions and answers by a affair graph. According to the method, the problems that an existing event relation is difficult to reasone, a'human-in-loop 'event graph construction method is insufficient, and a user question answer is difficult to verify are solved, and efficient, convenient and credible data access and graph construction and intelligent question and answer whole-process service can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing and large models, and more specifically, to a method and device for constructing a causal graph and reasoning question-answering that integrates a large model. Background Art

[0002] With the rapid development of information technology and the continuous enrichment of social media platforms, a large amount of hot news event data has been collected on news websites and social network spaces. Both the data style and data types are increasing, which brings more abundant and diverse information to business personnel (users) such as financial analysis, public opinion analysis, and regional hot spot analysis, while increasing the difficulty of accurate user information acquisition. In order to enable various users to more conveniently and quickly sort out the context of hot news events, quickly and accurately obtain high-value information, and assist users in completing tasks such as financial risk prediction, military conflict prediction, and regional public opinion warning, it is necessary to start from the entire process of data access to information services for continuous exploration and continuous improvement.

[0003] Most of the current mainstream news websites and social platforms are to complete the access and display of hot news, with the goal of improving the timeliness, convenience, and friendliness of users' rapid access to news information. However, this is far from meeting users' needs for browsing and in-depth analysis of massive news data, but requires a full business process method that integrates data access, cleaning, extraction, organization, analysis, and display. In addition, traditional knowledge graphs are entity-centric, focusing on information such as entity attributes and the relationship between entities, and lack information on events and logical relationships between events. The event graph just addresses this problem, so a set of processes and methods that can automatically complete event extraction, event relationship inference, event context combing, and event graph construction is needed; current users pay attention to information acquisition, especially information that needs to be obtained through reasoning, and still mainly rely on manual processing or keyword retrieval methods. The retrieval results are the articles with the highest matching degree rather than directly giving the clear answers that users want. After users get the list of recommended articles, they still need to manually screen, study, and find answers, which is time-consuming and labor-intensive. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method and device for constructing a causal graph and reasoning question and answer that integrates a large model, so as to solve the problems of the difficulty in reasoning about existing event relationships, the insufficiency of the causal graph construction method of "human in the loop", and the difficulty in verifying answers to user questions, thereby achieving efficient, convenient and reliable data access, graph construction and intelligent question and answer full-process services.

[0005] The object of the present invention is achieved through the following solutions:

[0006] A method for constructing a causal graph and reasoning question answering by integrating a large model, comprising the following steps:

[0007] S1, news data structured extraction, driven by text structured extraction agents, based on large models and text structured extraction basic component sets, combined with news data content and existing label information, completes news data summary extraction, keyword extraction, classification tagging, topic clustering, summary segmentation and event element extraction as needed;

[0008] S2, the construction of the event graph, driven by the construction of the event graph intelligent agent, based on the large model and the event graph to build a basic component set, combined with the results of the news data structured extraction module, the graph is constructed from top to bottom, hierarchically and graded, and the basic components are analyzed, assembled and called for different news content to complete the addition and update of the graph data; among them, the event graph is based on the news event theme and category as its root node and label, the event sentence as the next level node, the event time or the news time to which the event belongs as the relationship between the node and the root node, the entity extracted from the event sentence elements and the entity label as the relationship between the bottom node and the upper level, and the event trigger word as the relationship to connect the subject and object of the event;

[0009] S3, causal graph reasoning question and answer, is driven by the causal graph reasoning question and answering intelligent agent, based on the large model causal graph reasoning question and answer basic component set, facing the causal graph constructed in step S2, for different types of user questions, it decomposes the problem solving steps, calls components, generates answers, and presents them to users in a visual form. At the same time, it returns the answer, the graph corresponding to the answer, and the original news source of the graph for users to verify and confirm.

[0010] Further, in step S1, the text structured extraction agent is driven, based on the large model and the text structured extraction basic component set, combined with the news data content and the existing label information, to complete the news data summary extraction, keyword extraction, classification tagging, topic clustering, summary segmentation and event element extraction as needed, specifically including the following sub-steps:

[0011] S11, for the news data structured extraction task, combined with the big model to complete the news data structured extraction agent construction, the specific construction process is as follows:

[0012] Step ①, perform a mind tree-based decomposition of the news data structured extraction task to complete task decomposition and large model prompt generation;

[0013] Step ②, complete the scheduling of structured extraction components based on the prompt statement;

[0014] S12, for each piece of hot news data input, extracts the agent based on the structured news data, completes component scheduling and returns the results, as follows:

[0015] Step ①, calling a text classification model to determine the category label of news data, and processing the news data into sentences as the input of the text classification model to determine whether this sentence is an event sentence; the text classification model includes a TextCNN classification model, and the specific process is as follows: the input layer uses Word2vec or Glove to convert the text into a vector set in units of words or phrases, and then connects the convolution layer used to extract text matrix features, and extracts multiple hierarchical features by setting the convolution kernel size; the obtained convolution layer features are reduced in dimension by using a pooling layer, and finally connected in series and spliced, and input into a fully connected layer; the fully connected layer obtains the classification probability of the text based on the extracted local and global information of the document and outputs the category to which it belongs, and uses a function to calculate the hidden layer output of the fully connected layer to obtain the probability that the current document belongs to each class, and judge the category to which the text belongs;

[0016] Step ②, call the entity recognition model to determine the entities and labels in the event sentence; based on the Bert-BILSTM-CRF entity recognition model, combined with the Bert pre-trained language model, data set, and sequence labeling task fine-tuning, text entity recognition is realized; wherein, the Bert pre-trained model and the bidirectional long short-term memory network BILSTM are used to extract the features of each word and the forward and backward context information, and the CRF layer is used to add constraints to ensure the validity of the final prediction result, and the constraints are learned by this layer when training the data;

[0017] Step ③, call the event element extraction model to obtain the time, place, trigger word, event subject and event object of the event. Specifically, based on the BERT pre-trained model, an event extraction model is designed, which consists of two stages: trigger word recognition and event element recognition. The specific acquisition process is as follows: In the trigger word recognition stage, trigger word extraction is regarded as a word-level classification task, and a multi-classifier is added to BERT to build a trigger word extractor; in the element recognition stage, multiple groups of binary classifiers are added to BERT, each group of classifiers serves a type of role, determines the scope of all arguments belonging to it, and on this basis realizes the ability to extract event elements from text business data.

[0018] Further, in step S2, the intelligent agent is constructed based on the big model and the event map, and the basic component set is constructed based on the big model and the event map. The result of the news data structured extraction module is combined to construct the map from top to bottom in a hierarchical manner. The basic components are analyzed, assembled and called for different news contents to complete the addition and update of the map data. Among them, the event map is based on the news event theme and the category to which it belongs as its root node and label, the event sentence is the next level node, the event occurrence time or the event news occurrence time is the relationship between the node and the root node, the entity extracted from the event sentence element and the entity label are the relationship between the bottom node and the upper level, and the event trigger word is used as the relationship to connect the subject and object of the event, which specifically includes the following sub-steps:

[0019] S21, for the task of constructing a hierarchical event graph, combines the big model to form an event graph to construct an intelligent agent; the process is as follows:

[0020] Step ①, based on the structured extraction results of news data, build tasks around the hierarchical reasoning map, perform decomposition based on the thinking tree, complete task disassembly and generate large model prompts;

[0021] Step ②, complete the event graph and build component scheduling based on the prompt statement;

[0022] S22, for each hot news article and result extraction result, build an intelligent agent based on the event graph, complete component scheduling and return the result; the details are as follows:

[0023] Step ①, conduct knowledge modeling, complete concept definition, hierarchy definition and attribute definition;

[0024] Step ②: Use the acquired news category labels, event sentences, entities and their labels, and event elements as acquired knowledge to complete the fusion, disambiguation, and linking of the same entities;

[0025] Step ③: Construct a set of events of the same category and theme as the newly added event to form background knowledge, i.e., the "context" events of the newly added event, to assist in sorting out the event context and inferring the relationship between events;

[0026] Step ④, organize and visualize the acquired knowledge according to the knowledge modeling results; divide the event map into four levels, the top level is the name of the event category, the second level is the event sentence, and its relationship with the upper level is "sub-event". At the same time, the event corresponding message is associated with its attribute, the third level is the subject in the event element or the entity in the event, and its relationship with the upper level is the entity label, and the last level is the object in the event element, and the trigger word is its relationship with the upper level.

[0027] Furthermore, in step S3, the causal graph reasoning question-answering agent is driven, based on the large-model causal graph reasoning question-answering basic component set, facing the causal graph constructed in step S2, for different types of user questions, the question answering steps are decomposed, components are called, answers are generated, and displayed to the user in a visual form. At the same time, the answer, the graph corresponding to the answer, and the original news source of the graph are returned for the user to verify and confirm, which specifically includes the following sub-steps:

[0028] S31, for the hierarchical reasoning graph fast query and multi-hop reasoning question answering tasks, combines the big model to build a reasoning graph reasoning question answering agent; its process is as follows:

[0029] Step ①, based on the user input question, the fact map and the hot news data set, around the user's question quick query and reasoning question and answer needs, perform decomposition based on the thinking tree, complete task disassembly and large model prompt generation;

[0030] Step ②, complete the scheduling of intelligent question-answering components based on the prompt statement;

[0031] S32, based on the question input by the user, the question-answering agent is reasoned based on the factual graph, and the component scheduling is completed and the result is returned; the details are as follows:

[0032] Step ①: Entity and relationship recognition is performed on the user input question. The model used is the entity and relationship recognition model based on Bert-BILSTM-CRF;

[0033] Step ②, when only one entity is identified, the entity is searched in the causal graph, and all triples matching the subject or object with the key entity are extracted as the candidate answer set;

[0034] Step ③, use the semantic similarity model based on the Bert model to calculate the semantic relevance between the user input content and the candidate answers, and select the triple with the largest relevance as the answer to the input question; the calculation steps of the Bert semantic similarity model are as follows: the relationship between the user question and all the triples obtained by the query is used as the input of the Bert pre-training model, and then the LSTM network layer is still used to integrate the local input of the user input content word sequence to obtain the overall vector representation h q ,h q It also encodes two aspects of information: the latent semantic information of the input content itself; and the information that the details of the input content are explicitly matched in the answer. A matching layer is connected to the end of the network, and the cosine similarity is used to calculate the matching score of the vector. The triple corresponding to the highest-scoring relationship is the answer to the user's input question.

[0035] Step ④, when multiple entities or relationships are identified, the question relationship chain extraction model based on the large model is called to generate all the key information required for the query answer;

[0036] Step ⑤, integrate the relationship chain into the query template to generate a cypher statement query, and the query result is the final answer;

[0037] Step ⑥, when the relationship chain extraction is wrong, the reading comprehension question-answering method for news document datasets is used to obtain the answer;

[0038] Step ⑦, return the graph data within one hop centered on the extracted entity, and query the attribute value of the sub-event to which the entity belongs to obtain the event source message data, and display it to the user in a visual form.

[0039] Furthermore, in step ① of step S11, task decomposition is completed by integrating the functions of each model with task requirements and structured extraction components; and large model prompt generation forms the decomposition results into prompt statements that can be understood by the large model.

[0040] Furthermore, in step ② in step S11, the text structured extraction component set includes a text classification model, a topic clustering model, a word segmentation model, a keyword extraction model, a part-of-speech tagging model, an entity recognition model, a relationship extraction model, a summary extraction model, an event detection model and an event element extraction model.

[0041] Furthermore, in step ② in step S12, the entity tags include: time, place, person, organization and target.

[0042] Furthermore, in step ② in step S21, the event graph construction component scheduling set includes a conceptual modeling tool, an entity linking algorithm, an entity disambiguation algorithm, an entity fusion algorithm, an event relationship inference algorithm, and a text similarity algorithm.

[0043] Furthermore, in step ② in step S31, the scheduling set of the causal graph reasoning question-answering components includes an entity recognition algorithm, a relationship extraction algorithm, a cypher sentence generation model, a relationship chain extraction model, a similarity matching model, and a reading comprehension question-answering model.

[0044] Furthermore, in step ④ of step S32, several relationship chain extraction examples are provided in the big model prompt for the big model to perform context learning.

[0045] A computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded by the processor, the method described in any one of the above items is executed.

[0046] The beneficial effects of the present invention include:

[0047] (1) The present invention provides a method for constructing a causal graph and intelligent question-answering based on a large language model and driven by an intelligent agent, which has the full-process service capabilities of news data access processing, knowledge extraction, causal graph construction, graph updating, reasoning question-answering, and visual answer display and traceability.

[0048] (2) The present invention constructs a news data structured extraction method guided by the needs of event graph construction, and in the embodiment, a "machine master and auxiliary" working mode can also be provided. The information such as entities, categories, topics, events and their elements obtained by the news data structured extraction module is the core component of the event graph construction module, and is stored after manual review and confirmation, which improves the efficiency and accuracy of knowledge extraction and the practicality of graph construction.

[0049] (3) The present invention provides a set of solutions for factual graph reasoning question and answering, which can automatically decompose question answering steps, call components, generate answers based on user questions, and support visual display and answer traceability. It can display the intermediate results, final answers, answer source maps, and original texts corresponding to the maps that users can understand during the answer acquisition process. This can not only help users understand the answer acquisition process of factual graph question and answering, but also make the given answers traceable and confirmable. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative labor.

[0051] Figure 1 A flowchart of the steps of a method for constructing a causal graph and reasoning question-answering that integrates a large model according to an embodiment of the present invention;

[0052] Figure 2 A structural diagram of a news data structured extraction module according to an embodiment of the present invention;

[0053] Figure 3 A schematic diagram of the structure of a module for constructing a matter-of-fact graph according to an embodiment of the present invention;

[0054] Figure 4 Schematic diagram of the structure of the fact graph reasoning question-answering module of an embodiment of the present invention. DETAILED DESCRIPTION

[0055] All features disclosed in all embodiments in this specification, or steps in all methods or processes implicitly disclosed, except for mutually exclusive features and / or steps, can be combined and / or expanded or replaced in any manner.

[0056] The specific implementation process of the present invention is as follows:

[0057] In a preferred embodiment, the present invention provides a device for constructing a logical graph and answering a question by reasoning based on a large model, specifically a computer device including a processor and a memory, wherein a computer program is stored in the memory, specifically including the following modules:

[0058] The news data structured extraction module is driven by the text structured extraction intelligent agent. Based on the large model and the basic component set of text structured extraction, it combines news data content, existing label information, etc. to complete news data summary extraction, keyword extraction, classification labeling, topic clustering, summary segmentation and event element extraction as needed.

[0059] The event graph construction module is driven by the event graph construction agent, based on the large model and event graph construction basic component set, combined with the results of the news data structured extraction module, following the top-down idea, hierarchical construction of the graph, automatic analysis, assembly and call of basic components for different news content, and complete the addition and update of graph data. Among them, the event graph is based on the news event theme and category as its root node and label, the event sentence as the next level node, the event time or the news time to which the event belongs as the relationship between the node and the root node, the entity and entity label extracted from the event sentence elements as the relationship between the bottom node and the previous level, and the event trigger word as the relationship to connect the subject and object of the event. Finally, after the event graph is built or updated, it needs to be manually reviewed and confirmed before it can be put into the database.

[0060] The causal graph reasoning question and answer module is driven by the causal graph reasoning question and answering agent. It is based on the large-model causal graph reasoning question and answer basic component set. It is oriented to the constructed causal graph and automatically decomposes the question answering steps, calls components, generates answers for different types of user questions, and presents them to users in a visual form. At the same time, it returns the answer, the graph corresponding to the answer, and the original news text of the graph source for users to verify and confirm.

[0061] In another preferred embodiment, the present invention provides a method for constructing a causal graph and answering questions by integrating a large model, such as Figure 1 As shown, the specific steps include:

[0062] Step S1, for open source hot news data, first perform structured knowledge extraction, corresponding to the news data structured extraction module in the figure. Aiming at the event sentences, entities and relationship information required for building the event graph, based on the characteristics of news data and the structured extraction process, comb the large model prompt template, combine the basic component set of text structured extraction, build a news data structured extraction agent, perform summary extraction on the input news data, that is, extract the core event sentences of the current news data, and classify the events. For the entity information with labels such as time, place, person, category, speech, etc. required for building the event graph, extract each event sentence separately, and complete the event element extraction of subject, object and trigger words in the event sentence.

[0063] like Figure 2 As shown in FIG. 1 , the structure diagram of the news data structured extraction module in this embodiment is shown in FIG. The input of this module is hot news data, and the output is the structured extraction result: mainly including event topic tags, category tags, event sentences, entities, entity tags (including time, place, organization, person, speech, task).

[0064] First, for the news data structured extraction task, the news data structured extraction agent is constructed in combination with the big model. The construction process is as follows: ① Perform a mind tree-based decomposition for the news data structured extraction task to complete the task disassembly and generate big model prompts. Among them, task disassembly needs to be completed in combination with the task requirements and the functions of each model in the structured extraction intelligent component concentration; for the big model prompt generation, the disassembly results are formed into prompt statements that the big model can understand. ② Based on the above prompt statements, the structured extraction component scheduling is completed. Among them, the text structured extraction component set includes a series of components such as text classification model, topic clustering model, word segmentation model, keyword extraction model, part-of-speech tagging model, entity recognition model, relationship extraction model, summary extraction model, event detection model, event element extraction model, etc.

[0065] Then, for each piece of hot news data input, the intelligent agent is extracted based on the structured news data, component scheduling is completed and the results are returned. The details are as follows:

[0066] ① Call the text classification model to determine the category label of the news data, and process the news data into sentences as the input of the text classification model to determine whether this sentence is an event sentence. Taking the TextCNN classification model as an example, the process is as follows: the input layer uses Word2vec or Glove to convert the text into a vector set in units of characters or words. In this embodiment, the word embedding layer is a 7x5 vector matrix, which means that the number of words in the text is 7 and the dimension of the word vector is 5; then the convolution layer used to extract the text matrix features is connected. By setting the convolution kernel size, multiple hierarchical features can be extracted. In this embodiment, a total of 6 different convolution kernels are used to collect feature maps for the same text matrix, and finally 6 feature maps are obtained; the obtained convolution layer features are reduced in dimension using a pooling layer to reduce the training parameters for the fully connected layer. In this embodiment, the 1-maximum pooling method is used to compress the 6 feature maps into 6 eigenvalues, and finally they are concatenated into a feature vector of length 6 and input into the fully connected layer; the fully connected layer obtains the classification probability of the text based on the extracted local-global information of the document and outputs the category to which it belongs. In this embodiment, the softmax function is used to calculate the hidden layer output of the fully connected layer to obtain the probability that the current document belongs to each class and judge the category to which the text belongs.

[0067] ② Call the entity recognition model to determine the entities and labels in the event sentence. Taking the entity recognition model based on Bert-BILSTM-CRF as an example, the process is as follows: Combine the Bert pre-trained language model, specific data set, and sequence labeling task fine-tuning to achieve text entity recognition. Among them, the Bert pre-trained model and the bidirectional long short-term memory network are mainly used to extract the features of each word and the forward and backward context information, and the CRF layer is mainly used to add some constraints to ensure that the final prediction result is valid. These constraints can be automatically learned by this layer during training data to greatly reduce the probability of incorrect prediction. In this embodiment, entity labels include: time, place, person, organization, target, etc.

[0068] ③ Call the event element extraction model to obtain the time, place, trigger word, event subject, and event object of the event. In this embodiment, based on the BERT pre-training model, an event extraction model is designed, which consists of two stages: trigger word recognition and event element recognition. The specific implementation plan is as follows: In the trigger word recognition stage, trigger word extraction is regarded as a word-level classification task, and a multi-classifier is added to BERT to build a trigger word extractor; in the element recognition stage, in order to overcome the problem of long argument phrases and overlapping roles, multiple groups of binary classifiers are added to BERT, each group of classifiers serves a type of role, determines the scope of all arguments belonging to it, and realizes the ability to extract elements from text business data events on this basis.

[0069] Step S2, combining the obtained news data classification results, event sentence detection results, entity recognition results and event element extraction results to complete the construction of a multi-level event graph.

[0070] like Figure 3 The module input is the structure diagram of the event graph construction module in this embodiment. The module input is the structured extraction result of news data: mainly including news original text, event sentences, event categories, entities, entity tags, etc., and the output is the constructed event graph.

[0071] First, for the task of constructing a hierarchical event graph, a large model is combined to form an event graph to construct an intelligent agent. The main process is as follows: ① Based on the structured extraction results of news data, around the task of constructing a hierarchical event graph, a decomposition based on a thinking tree is performed to complete the task disassembly and the generation of large model prompts. ② Based on the above prompt statements, the event graph construction component scheduling is completed. Among them, the event graph construction component scheduling set includes a series of components such as concept modeling tools, entity linking algorithms, entity disambiguation algorithms, entity fusion algorithms, event relationship inference algorithms, and text similarity algorithms.

[0072] Then, for each hot news original text and result extraction result, an intelligent agent is constructed based on the event graph, component scheduling is completed and the result is returned. Specifically as follows: ① Perform knowledge modeling, complete concept definition, hierarchical definition and attribute definition; ② Use the acquired news category labels, event sentences, entities and their labels, and event elements as the acquired knowledge to complete the fusion, disambiguation and linking of the same entity; ③ Construct the event set of the same category and theme as the newly added event to form background knowledge, that is, the "context" event of the newly added event, to assist in the event context combing and inference of the relationship between events; ④ Organize and visualize the acquired knowledge according to the knowledge modeling results. In this embodiment, the event graph is divided into four levels, the top layer is the event category name, for example: "xx war", "xx conflict", the second layer is the event sentence, and the relationship with the upper layer is "sub-event", and the corresponding message of the event is associated as its attribute, the third layer is the subject in the event element or the entity in the event, and the relationship with the upper layer is the entity label, and the last layer is the object in the event element, and the trigger word is the relationship between it and the upper layer.

[0073] Step S3, based on the constructed hierarchical graph, completes fast query and multi-hop reasoning question and answer of entities, attributes, relationships, etc. in the graph.

[0074] like Figure 4 As shown in FIG, the structural diagram of the reasoning question-answering module of the event graph in this embodiment. The input of this module is the user input question, the hierarchical event graph and the hot news data set, and the output is the answer corresponding to the user input question, the answer corresponding graph, and the related question / entity recommendation list.

[0075] First, for the hierarchical causal graph rapid query and multi-hop reasoning question-answering tasks, a causal graph reasoning question-answering agent is built in combination with a large model. The main process is as follows: ① Based on the user input question, causal graph and hot news data set, around the user's question rapid query and reasoning question-answering needs, a mind tree-based decomposition is performed to complete the task disassembly and large model prompt generation. ② Based on the above prompt statements, the intelligent question-answering component scheduling is completed. Among them, the causal graph reasoning question-answering component scheduling set includes a series of components such as entity recognition algorithm, relationship extraction algorithm, cypher sentence generation model, relationship chain extraction model, similarity matching model, reading comprehension question-answering model, etc.

[0076] Then, for the user input question, the question-answering agent is inferred based on the fact graph, the component scheduling is completed and the result is returned. The details are as follows: ① Entity and relationship recognition is performed on the user input question, and the model used is the entity and relationship recognition model based on Bert-BILSTM-CRF; ② When only one entity is recognized, the obtained entity is searched in the fact graph, and all triples matching the subject or object with the key entity are extracted as the candidate answer set; ③ The semantic similarity model based on the Bert model is used to calculate the semantic relevance between the user input content and the candidate answer, and the triple with the largest relevance is selected as the answer to the input question; Among them, the calculation steps of the Bert semantic similarity model are as follows: the relationship between the user question and all the triples obtained by the query is used as the input of the Bert pre-trained model, and then the LSTM network layer is still used to integrate the local input of the user input content word sequence to obtain the overall vector representation h q ,h q At the same time, two aspects of information are encoded: the latent semantic information of the input content itself; the detailed information of the input content is explicitly matched in the answer. A matching layer is connected to the end of the network, and the matching score of the vector is calculated using cosine similarity. The triple corresponding to the highest-scoring relationship is the answer to the user's input question. ④ When multiple entities or relationships are identified, the question relationship chain extraction model based on the large model is called to generate all the key information required for the query answer; among them, in order to make the relationship chain extracted by the large model more accurate and output in a structured form, it is necessary to provide several relationship chain extraction examples in the large model prompt for context learning of the large model. ⑤ Then the relationship chain is integrated into the query template to generate a cypher statement query, and the query result is the final answer. ⑥ When the relationship chain extraction is wrong, the reading comprehension question-answering method for news document datasets is used to obtain the answer. ⑦ Finally, the graph data within one hop centered on the extracted entity is returned, and the attribute value of the sub-event to which the entity belongs is queried to obtain the event source message data, which is displayed to the user in a visual form.

[0077] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.

[0078] According to one aspect of an embodiment of the present invention, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations.

[0079] As another aspect, an embodiment of the present invention further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

Claims

1. A method for constructing a causal graph and reasoning question answering by integrating a large model, characterized in that: The following steps are involved: S1, news data structured extraction, driven by text structured extraction agents, based on large models and text structured extraction basic component sets, combined with news data content and existing label information, completes news data summary extraction, keyword extraction, classification tagging, topic clustering, summary segmentation and event element extraction as needed; S2, the construction of the event graph, driven by the construction of the event graph intelligent agent, based on the large model and the event graph to build a basic component set, combined with the results of the news data structured extraction module, the graph is constructed from top to bottom, hierarchically and graded, and the basic components are analyzed, assembled and called for different news content to complete the addition and update of the graph data; among them, the event graph is based on the news event theme and category as its root node and label, the event sentence as the next level node, the event time or the news time to which the event belongs as the relationship between the node and the root node, the entity extracted from the event sentence elements and the entity label as the relationship between the bottom node and the upper level, and the event trigger word as the relationship to connect the subject and object of the event; S3, causal graph reasoning question and answer, is driven by the causal graph reasoning question and answering intelligent agent, based on the large model causal graph reasoning question and answer basic component set, facing the causal graph constructed in step S2, for different types of user questions, it decomposes the problem solving steps, calls components, generates answers, and presents them to users in a visual form. At the same time, it returns the answer, the graph corresponding to the answer, and the original news source of the graph for users to verify and confirm.

2. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 1 is characterized in that: In step S1, the text structured extraction agent is driven, based on the large model and the text structured extraction basic component set, combined with the news data content and the existing label information, to complete the news data summary extraction, keyword extraction, classification tagging, topic clustering, summary segmentation and event element extraction as needed, which specifically includes the following sub-steps: S11, for the news data structured extraction task, combined with the big model to complete the news data structured extraction agent construction, the specific construction process is as follows: Step ①, perform a mind tree-based decomposition of the news data structured extraction task to complete task decomposition and large model prompt generation; Step ②, complete the scheduling of structured extraction components based on the prompt statement; S12, for each piece of hot news data input, extracts the agent based on the structured news data, completes component scheduling and returns the results, as follows: Step ①, calling a text classification model to determine the category label of news data, and processing the news data into sentences as the input of the text classification model to determine whether this sentence is an event sentence; the text classification model includes a TextCNN classification model, and the specific process is as follows: the input layer uses Word2vec or Glove to convert the text into a vector set in units of words or phrases, and then connects the convolution layer used to extract text matrix features, and extracts multiple hierarchical features by setting the convolution kernel size; the obtained convolution layer features are reduced in dimension by using a pooling layer, and finally connected in series and spliced, and input into a fully connected layer; the fully connected layer obtains the classification probability of the text based on the extracted local and global information of the document and outputs the category to which it belongs, and uses a function to calculate the hidden layer output of the fully connected layer to obtain the probability that the current document belongs to each class, and judge the category to which the text belongs; Step ②, call the entity recognition model to determine the entities and labels in the event sentence; based on the Bert-BILSTM-CRF entity recognition model, combined with the Bert pre-trained language model, data set, and sequence labeling task fine-tuning, text entity recognition is realized; wherein, the Bert pre-trained model and the bidirectional long short-term memory network BILSTM are used to extract the features of each word and the forward and backward context information, and the CRF layer is used to add constraints to ensure the validity of the final prediction result, and the constraints are learned by this layer when training the data; Step ③, call the event element extraction model to obtain the time, place, trigger word, event subject and event object of the event. Specifically, based on the BERT pre-trained model, an event extraction model is designed, which consists of two stages: trigger word recognition and event element recognition. The specific acquisition process is as follows: In the trigger word recognition stage, trigger word extraction is regarded as a word-level classification task, and a multi-classifier is added to BERT to build a trigger word extractor; in the element recognition stage, multiple groups of binary classifiers are added to BERT, each group of classifiers serves a type of role, determines the scope of all arguments belonging to it, and on this basis realizes the ability to extract event elements from text business data.

3. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 1 is characterized in that: In step S2, the intelligent agent is constructed based on the big model and the event map, and the basic component set is constructed based on the big model and the event map. The result of the news data structured extraction module is combined to construct the map from top to bottom in a hierarchical manner. The basic components are analyzed, assembled and called for different news contents to complete the addition and update of the map data. Among them, the event map is based on the news event theme and the category to which it belongs as its root node and label, the event sentence is the next level node, the event occurrence time or the event news occurrence time is the relationship between the node and the root node, the entity and entity label extracted from the event sentence elements are the relationship between the bottom node and the upper level, and the event trigger word is used as the relationship to connect the subject and object of the event, which specifically includes the following sub-steps: S21, for the task of constructing a hierarchical event graph, combines the big model to form an event graph to construct an intelligent agent; the process is as follows: Step ①, based on the structured extraction results of news data, build tasks around the hierarchical reasoning map, perform decomposition based on the thinking tree, complete task disassembly and generate large model prompts; Step ②, complete the event graph and build component scheduling based on the prompt statement; S22, for each hot news article and result extraction result, build an intelligent agent based on the event graph, complete component scheduling and return the result; the details are as follows: Step ①, conduct knowledge modeling, complete concept definition, hierarchy definition and attribute definition; Step ②: Use the acquired news category labels, event sentences, entities and their labels, and event elements as acquired knowledge to complete the fusion, disambiguation, and linking of the same entities; Step ③, construct a set of events of the same category and theme as the newly added event to form background knowledge, that is, the "context" event of the newly added event, to assist in sorting out the event context and inferring the relationship between events; Step ④, organize and visualize the acquired knowledge according to the knowledge modeling results; divide the event map into four levels, the top level is the name of the event category, the second level is the event sentence, and its relationship with the upper level is "sub-event". At the same time, the event corresponding message is associated as its attribute, the third level is the subject in the event element or the entity in the event, and its relationship with the upper level is the entity label, and the last level is the object in the event element, and the trigger word is its relationship with the upper level.

4. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 1 is characterized in that: In step S3, the causal graph reasoning question-answering agent is driven by the causal graph reasoning question-answering basic component set based on the large model causal graph reasoning question-answering basic component set, facing the causal graph constructed in step S2, for different types of user questions, the question answering steps are decomposed, components are called, answers are generated, and they are presented to the user in a visual form. At the same time, the answer, the graph corresponding to the answer, and the original news source of the graph are returned for the user to verify and confirm, which specifically includes the following sub-steps: S31, for hierarchical reasoning graph fast query and multi-hop reasoning question answering tasks, combines the big model to build a reasoning graph reasoning question answering agent; The process is as follows: Step ①, based on the user input question, the fact map and the hot news data set, around the user's question quick query and reasoning question and answer needs, perform decomposition based on the thinking tree, complete task disassembly and large model prompt generation; Step ②, complete the scheduling of intelligent question-answering components based on the prompt statement; S32, based on the question input by the user, the question-answering agent is reasoned based on the factual graph, and the component scheduling is completed and the result is returned; the details are as follows: Step ①, perform entity and relationship recognition on the user input question, and the model used is the entity and relationship recognition model based on Bert-BILSTM-CRF; Step ②, when only one entity is identified, the entity is searched in the causal graph, and all triples matching the subject or object with the key entity are extracted as the candidate answer set; Step ③, use the semantic similarity model based on the Bert model to calculate the semantic relevance between the user input content and the candidate answers, and select the triple with the largest relevance as the answer to the input question; the calculation steps of the Bert semantic similarity model are as follows: the relationship between the user question and all the triples obtained by the query is used as the input of the Bert pre-training model, and then the LSTM network layer is still used to integrate the local input of the user input content word sequence to obtain the overall vector representation h q ,h q It also encodes two aspects of information: the latent semantic information of the input content itself; and the information that the details of the input content are explicitly matched in the answer. A matching layer is connected to the end of the network, and the cosine similarity is used to calculate the matching score of the vector. The triple corresponding to the highest-scoring relationship is the answer to the user's input question. Step ④, when multiple entities or relationships are identified, the question relationship chain extraction model based on the large model is called to generate all the key information required for the query answer; Step ⑤, integrate the relationship chain into the query template to generate a cypher statement query, and the query result is the final answer; Step ⑥, when the relationship chain extraction is wrong, the reading comprehension question-answering method for news document datasets is used to obtain the answer; Step ⑦, return the graph data within one hop centered on the extracted entity, and query the attribute value of the sub-event to which the entity belongs to obtain the event source message data, and display it to the user in a visual form.

5. The method for constructing a causal graph and reasoning question-answering based on a large-scale fusion model according to claim 2 is characterized in that: In step ① of step S11, task decomposition is completed by integrating the task requirements with the structured extraction components to complete the functions of each model; the large model prompt generation converts the decomposition results into prompt statements that the large model can understand.

6. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 2 is characterized in that: In step ② of step S11, the text structured extraction component set includes a text classification model, a topic clustering model, a word segmentation model, a keyword extraction model, a part-of-speech tagging model, an entity recognition model, a relationship extraction model, a summary extraction model, an event detection model and an event element extraction model.

7. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 2 is characterized in that: In step ② of step S12, the entity tags include: time, place, person, organization and target.

8. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 3 is characterized in that: In step ② of step S21, the event graph construction component scheduling set includes a concept modeling tool, an entity linking algorithm, an entity disambiguation algorithm, an entity fusion algorithm, an event relationship inference algorithm, and a text similarity algorithm.

9. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 4 is characterized in that: In step ② of step S31, the scheduling set of the causal graph reasoning question-answering component includes an entity recognition algorithm, a relationship extraction algorithm, a cypher sentence generation model, a relationship chain extraction model, a similarity matching model, and a reading comprehension question-answering model.

10. The method for constructing a causal graph and answering questions based on a large-scale fusion model according to claim 4 is characterized in that: In step ④ of step S32, several relationship chain extraction examples are provided in the big model prompt for the big model to perform context learning.

11. A computer device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded by the processor, the method according to any one of claims 1 to 10 is executed.

Citation Information

Cited By

  • Information service method and system based on agent causal relationship reasoning

    CN120611801A