Question and answer method and device, electronic equipment, storage medium and program product

By building timing knowledge graphs and multimodal data processing technology, extracting features and generating service call strategies, the shortcomings of existing systems in processing complex timing and multimodal data are solved, and the accuracy of response results and system flexibility are improved. sex.

CN119272776APending Publication Date: 2025-01-07SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411138714.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing search question-and-answer system has shortcomings in handling questions involving timing information, multimodal data and complex semantic information, and it is difficult to accurately capture the time evolution and cross-modal associations of events, and the generated response results are inaccurate.

Method used

By constructing a timing knowledge graph, semantic features, timing features and intention features are extracted, service calling strategies are generated, combined with multimodal data processing technology, dynamically select models and optimize service calling sequences to generate multimodal response data.

Benefits of technology

It significantly improves the accuracy and efficiency of the system when handling complex timing queries, can understand user intentions more accurately and generate more accurate and interpretable response results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272776A_ABST
    Figure CN119272776A_ABST
Patent Text Reader

Abstract

The invention provides a question and answer method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. Determining a first query feature based on the first dialogue text and the time sequence knowledge graph; determining a semantic feature, a time sequence feature and an intention feature based on the first dialogue text, the time sequence knowledge graph and the first query feature; determining a second query feature based on the first dialogue text, a time sequence knowledge graph, the first query feature, the semantic feature, the time sequence feature and the intention feature; determining a service calling strategy based on the second query feature, the time sequence knowledge graph, the semantic feature, the time sequence feature and the intention feature; and generating response data based on the service calling strategy, the time sequence knowledge graph, the first query feature, the semantic feature, the time sequence feature, the intention feature and the second query feature. By means of the mode, processing of complex question and answer interaction is facilitated, and the finally generated answer result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question-answering method, device, electronic device, storage medium and program product. Background Art

[0002] With the rapid development of artificial intelligence and big data technology, information retrieval technology is being used more and more widely in various fields.

[0003] Current information retrieval technology mainly relies on keyword matching algorithms, vector space models, and machine learning algorithms to process the information that users want to retrieve or query; in terms of knowledge representation, traditional relational databases and document databases are still widely used, but knowledge graph technology has gradually become a hot topic; in natural language processing, pre-trained language models have significantly improved text comprehension capabilities; multimodal data processing technology has also made great progress. However, these technologies still face many challenges when integrated into complex retrieval question-answering systems.

[0004] In some related technologies, the retrieval question and answer system can identify the user's intention through the user's conversation text, and generate answers based on the user's intention, thereby realizing question and answer interaction with the user.

[0005] However, existing retrieval question-answering systems have obvious shortcomings when dealing with questions involving temporal information, multimodal data, and complex semantic information: first, existing knowledge representation methods find it difficult to effectively integrate temporal information and multimodal data, resulting in the inability of retrieval question-answering systems to accurately capture the temporal evolution of events and cross-modal associations; second, most retrieval question-answering systems use a fixed model architecture, which easily affects the system's retrieval efficiency; third, for questions containing complex temporal relationships and multimodal information, existing retrieval question-answering systems often find it difficult to perform deep semantic understanding and intent recognition; in addition, existing retrieval question-answering systems have limited interactive capabilities, making it difficult to further understand and optimize user intent, resulting in inaccurate generated responses.

[0006] Therefore, existing retrieval question-answering methods have difficulty handling complex question-answering interactions, resulting in inaccurate generated answer results. Summary of the invention

[0007] The present invention provides a question-answering method, device, electronic device, storage medium and program product, which are used to solve the defect that the existing retrieval question-answering method is difficult to handle complex question-answering interactions, resulting in inaccurate generated answer results.

[0008] The present invention provides a question-answering method, comprising: obtaining a first dialogue text of a user; constructing a temporal knowledge graph based on the first dialogue text; determining a first query feature of the first dialogue text based on the first dialogue text and the temporal knowledge graph; determining a semantic feature, a temporal feature and an intention feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph and the first query feature; determining a second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature; determining a service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; and generating response data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature.

[0009] According to a question-answering method provided by the present invention, a first query feature of a first dialogue text is determined based on a first dialogue text and a time series knowledge graph, including: inputting the first dialogue text into a first query analysis model to obtain a first feature output by the first query analysis model; inputting the time series knowledge graph into a prediction model to obtain a prediction complexity output by the prediction model; and generating a first query feature and a candidate model set of the first dialogue text based on the first feature and the prediction complexity.

[0010] According to a question-answering method provided by the present invention, a candidate model set includes a semantic model, a temporal feature extraction model and an intention recognition model; based on a first dialogue text, a temporal knowledge graph and a first query feature, the semantic features, temporal features and intention features of the first dialogue text are determined, including: inputting the first dialogue text, the temporal knowledge graph and the first query feature into the semantic model to obtain the semantic features of the first dialogue text output by the semantic model; inputting the first dialogue text, the temporal knowledge graph and the first query feature into the temporal feature extraction model to obtain the temporal features output by the temporal feature extraction model; inputting the first dialogue text, the temporal knowledge graph and the first query feature into the intention recognition model to obtain the intention features output by the intention recognition model.

[0011] According to a question-answering method provided by the present invention, a second query feature of a first dialogue text is determined based on a first dialogue text, a temporal knowledge graph, a first query feature, a semantic feature, a temporal feature and an intention feature, including: generating interactive response data based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature; obtaining a second dialogue text of the user based on the interactive response data; inputting the second dialogue text, the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature into a second query analysis model to obtain the second query feature of the first dialogue text output by the second query analysis model.

[0012] According to a question-answering method provided by the present invention, a service call strategy is determined based on a second query feature, a temporal knowledge graph, a semantic feature, a temporal feature and an intention feature, including: generating multiple service call tasks based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; determining the execution order of each service call task based on the service dependency relationship between each service call task; and determining the service call strategy based on the execution order of each service call task.

[0013] According to a question-answering method provided by the present invention, the answer data includes text answer data and image answer data; based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature, the answer data of the first dialogue text is generated, including: inputting the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into a text generation model to obtain the text answer data of the first dialogue text output by the text generation model; inputting the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into an image generation model to obtain the image answer data of the first dialogue text output by the image generation model; inputting the text answer data and the image answer data into a result sorting model to obtain the arrangement order output by the result sorting model; and sorting the text answer data and the image answer data based on the arrangement order.

[0014] The present invention also provides a question-answering device, comprising: an acquisition module for acquiring a first dialogue text of a user; a knowledge graph construction module for constructing a temporal knowledge graph based on the first dialogue text; a first query module for determining a first query feature of the first dialogue text based on the first dialogue text and the temporal knowledge graph; a semantic and intention recognition module for determining the semantic feature, temporal feature and intention feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph and the first query feature; a second query module for determining the second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature; a service call module for determining a service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; and a result generation module for generating answer data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature.

[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the above-mentioned question-and-answer methods is implemented.

[0016] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned question-and-answer methods is implemented.

[0017] The present invention also provides a computer program product, including a computer program, which implements any of the above-mentioned question-answering methods when executed by a processor.

[0018] The question-answering method, device, electronic device, storage medium and program product provided by the present invention obtain the first dialogue text of the user; construct a time series knowledge graph based on the first dialogue text; determine the first query feature of the first dialogue text based on the first dialogue text and the time series knowledge graph; determine the semantic feature, time series feature and intention feature of the first dialogue text based on the first dialogue text, the time series knowledge graph and the first query feature; determine the second query feature of the first dialogue text based on the first dialogue text, the time series knowledge graph, the first query feature, the semantic feature, the time series feature and the intention feature; determine the service call strategy based on the second query feature, the time series knowledge graph, the semantic feature, the time series feature and the intention feature; generate the answer data of the first dialogue text based on the service call strategy, the time series knowledge graph, the first query feature, the semantic feature, the time series feature, the intention feature and the second query feature. In the above manner, the time series knowledge graph is introduced in the process of retrieving questions and answers, so that the subsequent feature extraction process can accurately capture the time series information in the dialogue text, which is conducive to understanding the intention of complex dialogue texts, and then is conducive to processing complex question-answering interactions, so that the answer result finally generated is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces 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 creative work.

[0020] Figure 1 It is a flow chart of the question-answering method provided by the present invention.

[0021] Figure 2 It is a structural schematic diagram of the question-answering device provided by the present invention.

[0022] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] It should be noted that the embodiments of the present invention may involve the use of user data. In actual applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).

[0025] See also Figure 1 , Figure 1 is a flow chart of the question-answering method provided by the present invention. In this embodiment, the question-answering method is applied to a question-answering system, and the question-answering method includes steps S110 to S170, and each step is specifically as follows: S110: Acquire the user's first conversation text.

[0026] Specifically, when a user needs to perform a search query or question answering, he or she may submit a dialogue request to the question answering system. The question answering system may obtain the user's first dialogue text based on the dialogue request. The first dialogue text is a text containing the information that the user wants to retrieve or the information that the user wants to query.

[0027] Optionally, the user may directly input the first dialogue text on the question-answering system.

[0028] Optionally, the user may input voice into the question-answering system, and the question-answering system converts the received voice into the first dialogue text.

[0029] It should be noted that the question-answering system in this embodiment is a system built based on multimodal metadata retrieval enhancement generation technology and factual optimization technology (i.e., TKAM-QOS system), which is used to improve the accuracy, efficiency and interpretability of response results when dealing with complex time series relationships and multimodal data in the process of information retrieval and question-answering. The question-answering system can achieve deep understanding and precise response to time series information and multi-source heterogeneous data by integrating key technologies such as time series knowledge graphs, adaptive model scheduling, deep semantic understanding, interactive query optimization, dynamic service combination, and multimodal result generation and interpretation.

[0030] The TKAM-QOS system adopts advanced temporal knowledge representation technology and multimodal data fusion technology, enabling it to effectively process input data of different modalities such as text, images, audio, etc., and accurately capture the temporal relationship therein. By combining the TComplEx model and CLIP technology, the system can realize the effective integration of cross-modal and temporal information, and provide a rich knowledge base for complex query processing; at the same time, in terms of adaptive model scheduling, the TKAM-QOS system can use lightweight models and Multi-Armed Bandit algorithms to dynamically select the most suitable large-scale language models and external knowledge sources, thereby significantly improving the flexibility and processing efficiency of the system.

[0031] The innovation of the TKAM-QOS system lies in the combination of temporal reasoning, interactive query optimization and dynamic service composition. Through the collaborative work of multiple modules, the system's performance in processing complex temporal queries can be greatly improved. In terms of semantic understanding and intent recognition, the DeBERTa-v3 and TimeBART models can be used to achieve accurate understanding of complex temporal relationships in the query process; in terms of interactive query optimization, the system can effectively improve the system's processing capabilities for incomplete or fuzzy queries through multiple rounds of dialogue and temporal logic reasoning; in terms of dynamic service composition, the improved HTN algorithm and graph attention network are used to achieve efficient service call sequence planning and optimization.

[0032] The TKAM-QOS system has excellent capabilities in processing time-series related multimodal data, performing complex reasoning, and providing interpretable results. Therefore, it has broad application prospects in tasks that require processing complex time series relationships and multimodal data, especially in professional fields that require high accuracy, efficiency, and interpretability. The TKAM-QOS system is suitable for a variety of complex application scenarios, such as time series analysis, event prediction, and multimodal information integration. By using the TKAM-QOS system, users can obtain more accurate, comprehensive, and easier-to-understand query results, thereby improving decision-making quality and promoting knowledge discovery and innovative research.

[0033] In this embodiment, the TKAM-QOS system includes a temporal knowledge graph construction module, an adaptive model scheduling module, a deep semantic understanding module, an interactive query optimization module, a dynamic service composition module and a multimodal result generation module.

[0034] S120: Construct a temporal knowledge graph based on the first conversation text.

[0035] The temporal knowledge graph construction module of the TKAM-QOS system can construct a temporal knowledge graph that integrates multimodal data based on the first conversation text.

[0036] The temporal knowledge graph is a knowledge graph related to the user's first conversation text, thus providing a rich knowledge basis for complex queries.

[0037] For example, if the first dialogue text is "analyze the factory business situation in a certain area within three months", then the time series knowledge graph can be a factory business knowledge graph, and the time series knowledge graph is constructed based on the factory business data in the area within three months.

[0038] Specifically, after receiving the first conversation text, the temporal knowledge graph construction module can retrieve relevant external knowledge information on the network or database, such as papers, news, social media posts, audio, video and other related data; use the improved REBEL model to extract entities and relationships from the acquired external knowledge information, adopt the TComplEx model to encode the temporal information in the external knowledge information, and use the CLIP model and Wav2Vec2 model to extract features for multimodal data, and embed the extracted entities and relationships, temporal information and multimodal data features into the same vector space to realize the fusion representation of multiple features and generate a temporal knowledge graph.

[0039] Optionally, an RDF4J graph database is used to store graph data and temporal knowledge graphs.

[0040] It should be noted that the temporal knowledge graph construction module is one of the core components of the TKAM-QOS system, which can be used to integrate and encode multimodal data. For text data, the module uses the improved REBEL model for entity and relationship extraction, and simultaneously handles named entity recognition and relationship extraction tasks based on the T5 architecture; the encoding of temporal information uses the TComplEx model, which effectively represents time information through complex embedding; image data can be extracted through the CLIP model, and audio data is processed using the Wav2Vec2 model. In terms of storage, RDF4J is used as a graph database to support efficient SPARQL queries.

[0041] S130: Determine a first query feature of the first conversation text based on the first conversation text and the temporal knowledge graph.

[0042] Specifically, the adaptive model scheduling module of the TKAM-QOS system can determine the first query feature of the first dialogue text based on the first dialogue text and the temporal knowledge graph.

[0043] Optionally, during the retrieval question and answer processing, the TKAM-QOS system can adopt an adaptive model scheduling strategy to dynamically select an appropriate processing model according to the query complexity for subsequent processing.

[0044] S140: Determine semantic features, temporal features, and intentional features of the first conversation text based on the first conversation text, the temporal knowledge graph, and the first query feature.

[0045] Specifically, the deep semantic understanding module of the TKAM-QOS system can determine the semantic features, temporal features and intention features of the first dialogue text based on the first dialogue text, the temporal knowledge graph and the first query features.

[0046] Optionally, the deep semantic understanding module can perform fine-grained analysis of queries to accurately capture user intent and key information.

[0047] S150: Determine a second query feature of the first conversation text based on the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, and the intention feature.

[0048] Specifically, the interactive query optimization module of the TKAM-QOS system can determine the second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature.

[0049] Optionally, the interactive query optimization module can guide users to refine relevant queries or retrieve information and perform temporal reasoning through multiple rounds of dialogue.

[0050] S160: Determine a service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature, and the intent feature.

[0051] Specifically, the dynamic service composition module of the TKAM-QOS system can determine the service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature.

[0052] Optionally, the dynamic service composition module can convert user intent into an optimal service calling sequence.

[0053] S170: Generate response data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature.

[0054] Specifically, the multimodal result generation module of the TKAM-QOS system generates response data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature.

[0055] Optionally, a multimodal result generation module can integrate various types of information, generate comprehensive answers and provide visual explanations.

[0056] The question-answering method provided in this embodiment obtains the first dialogue text of the user; constructs a temporal knowledge graph based on the first dialogue text; determines the first query feature of the first dialogue text based on the first dialogue text and the temporal knowledge graph; determines the semantic feature, temporal feature and intention feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph and the first query feature; determines the second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature; determines the service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; generates the answer data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature. In the above manner, the temporal knowledge graph is introduced in the process of retrieving questions and answers, so that the subsequent feature extraction process can accurately capture the temporal information in the dialogue text, which is conducive to understanding the intention of complex dialogue texts, and then is conducive to processing complex question-answering interactions, so that the answer result generated in the end is more accurate.

[0057] In some embodiments, based on the first conversation text and the temporal knowledge graph, determining the first query feature of the first conversation text includes: inputting the first conversation text into a first query analysis model to obtain a first feature output by the first query analysis model; inputting the temporal knowledge graph into a prediction model to obtain a prediction complexity output by the prediction model; and generating a first query feature and a candidate model set for the first conversation text based on the first feature and the prediction complexity.

[0058] Specifically, after completing the construction of the time series knowledge graph, the adaptive model scheduling module can input the first dialogue text into the first query analysis model to obtain the first feature output by the first query analysis model.

[0059] Preferably, the first query analysis model is a DistilBERT model.

[0060] Furthermore, the adaptive model scheduling module can input the time series knowledge graph into the prediction model to obtain the prediction complexity output by the prediction model.

[0061] Preferably, the prediction model is a model built based on the XGBoost algorithm, which can be used to predict the prediction complexity of this retrieval question and answer.

[0062] Furthermore, the adaptive model scheduling module may use a Multi-Armed Bandit algorithm to generate a first query feature and a set of candidate models for the first dialogue text based on the first feature and the prediction complexity.

[0063] The candidate model collection includes large language models such as GPT-3.5 and Qwen-7B and specially fine-tuned small models.

[0064] In the question-answering method provided in this embodiment, the adaptive model scheduling module uses the lightweight DistilBERT model to quickly analyze and obtain the first feature, and combines the XGBoost algorithm to predict the prediction complexity of this retrieval question and answer. The Multi-Armed Bandit algorithm is used in the model selection strategy to model the problem as an exploration-exploitation balance problem, and multiple candidate models (including a variety of large language models and specially fine-tuned small models) are provided as alternative models for subsequent processing. At the same time, the Langchain framework is integrated to support flexible external knowledge calls, so that the adaptive model scheduling module can dynamically select the most appropriate processing model according to the user's query characteristics, which can significantly improve the system's processing efficiency and resource utilization.

[0065] In some embodiments, the candidate model set includes a semantic model, a temporal feature extraction model and an intent recognition model; based on the first dialogue text, the temporal knowledge graph and the first query feature, the semantic features, temporal features and intent features of the first dialogue text are determined, including: inputting the first dialogue text, the temporal knowledge graph and the first query feature into the semantic model to obtain the semantic features of the first dialogue text output by the semantic model; inputting the first dialogue text, the temporal knowledge graph and the first query feature into the temporal feature extraction model to obtain the temporal features output by the temporal feature extraction model; inputting the first dialogue text, the temporal knowledge graph and the first query feature into the intent recognition model to obtain the intent features output by the intent recognition model.

[0066] Specifically, after obtaining the first dialogue text, the temporal knowledge graph and the first query feature, the deep semantic understanding module can input the first dialogue text, the temporal knowledge graph and the first query feature into the semantic model to obtain the semantic features of the first dialogue text output by the semantic model.

[0067] Preferably, the semantic model is a DeBERTa-v3 model.

[0068] Furthermore, the deep semantic understanding module can input the first conversation text, the temporal knowledge graph and the first query feature into the temporal feature extraction model to obtain the temporal features output by the temporal feature extraction model.

[0069] Preferably, the time series feature extraction model is a TimeBART model.

[0070] Furthermore, the deep semantic understanding module can input the first conversation text, the temporal knowledge graph and the first query feature into the intent recognition model to obtain the intent feature output by the intent recognition model.

[0071] Preferably, the intent recognition model adopts a Few-Shot learning method and is a model built based on Prototypical Networks.

[0072] Optionally, the deep semantic understanding module can integrate the XLM-RoBERTa model to support multi-language understanding.

[0073] In the question-answering method provided in this embodiment, the deep semantic understanding module adopts the DeBERTa-v3 model for deep semantic analysis, uses the TimeBART model to extract temporal features, the intent recognition model adopts the Few-Shot learning method, and uses the prototype network to achieve rapid adaptation to new intent categories. At the same time, the deep semantic understanding module also integrates the XLM-RoBERTa model to support multi-language understanding, which can accurately capture the key information in user intent and queries, and provide a basis for subsequent processing.

[0074] In some embodiments, based on the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature, the second query feature of the first conversation text is determined, including: based on the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature, generating interactive response data; based on the interactive response data, obtaining the user's second conversation text; inputting the second conversation text, the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature into the second query analysis model to obtain the second query feature of the first conversation text output by the second query analysis model.

[0075] Specifically, after obtaining the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature, the interactive query optimization module can call the DialoGPT model through the multi-round dialogue system built on the Rasa framework, and generate a reply, i.e., interactive response data, according to the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature, and conduct multi-round dialogue interactions with the user based on the interactive response data to obtain the user's second dialogue text, which is a multi-round dialogue text.

[0076] Furthermore, the interactive query optimization module can input the second dialogue text, the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature into the second query analysis model to obtain the second query feature of the first dialogue text output by the second query analysis model.

[0077] Preferably, the second query analysis model is a ConvBERT model, which can be used to perform context understanding and implement temporal reasoning of text in combination with Allen interval algebra and ASP.

[0078] Preferably, the interactive query optimization module uses the T5-base model to perform query rewriting and generate diversified interactive responses.

[0079] The question-answering method provided in this embodiment is an interactive query optimization module based on a multi-round dialogue system built on the Rasa framework, using DialoGPT to generate replies, and the ConvBERT model is used for context understanding, so that the temporal reasoning engine can implement complex time constraint reasoning based on Allen interval algebra and ASP, and the query rewriting uses the T5-base model to learn different rewriting modes through the Few-Shot method, so that the module can guide users to improve relevant retrieval query information through intelligent dialogue, thereby improving the system's ability to handle complex queries and fuzzy queries.

[0080] In some embodiments, a service call strategy is determined based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature, including: generating multiple service call tasks based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; determining the execution order of each service call task based on the service dependency relationship between each service call task; determining the service call strategy based on the execution order of each service call task.

[0081] Specifically, after obtaining the second query feature, temporal knowledge graph, semantic feature, temporal feature and intention feature, the dynamic service composition module can generate multiple service call tasks based on the second query feature, temporal knowledge graph, semantic feature, temporal feature and intention feature.

[0082] Furthermore, an improved HTN algorithm combined with the Monte Carlo Tree Search algorithm is used to plan the service call sequence. Based on the service dependency relationship between each service call task, the execution order of each service call task is determined. At the same time, the Graph Attention Network is used to optimize service selection, the PPO algorithm is used to realize real-time adjustment of the execution order, and the Ray framework is used for distributed computing.

[0083] Furthermore, based on the execution order of each service calling task, a service calling strategy is determined.

[0084] In the question-answering method provided in this embodiment, the dynamic service composition module adopts an improved HTN algorithm combined with a Monte Carlo tree search algorithm to plan the service call sequence, and the service selection optimization uses a graph attention network to consider the dependencies between services. The real-time adjustment mechanism is implemented based on the PPO algorithm, so that the dynamic service composition module can continuously optimize the calling strategy according to feedback, greatly improve the flexibility and adaptability of the system, and can dynamically combine the optimal processing flow for different types of queries.

[0085] In some embodiments, the response data includes text response data and image response data; based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature, the response data of the first dialogue text is generated, including: inputting the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the text generation model to obtain the text response data of the first dialogue text output by the text generation model; inputting the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the image generation model to obtain the image response data of the first dialogue text output by the image generation model; inputting the text response data and the image response data into the result sorting model to obtain the arrangement order output by the result sorting model; and sorting the text response data and the image response data based on the arrangement order.

[0086] Specifically, after obtaining the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature, the multimodal result generation module can input the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the text generation model to obtain the text response data of the first dialogue text output by the text generation model.

[0087] Preferably, the text generation model is a BART-large model.

[0088] Furthermore, the multimodal result generation module can input the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the image generation model to obtain the image response data of the first dialogue text output by the image generation model.

[0089] Preferably, the image generation model is a Stable Diffusion model.

[0090] Furthermore, the text response data and the image response data are input into a result ranking model to obtain the arrangement order output by the result ranking model.

[0091] Preferably, the result ranking model is a model built based on the LambdaMART algorithm.

[0092] Further, the text response data and the image response data are sorted based on the arrangement order.

[0093] Preferably, the model decisions of the multimodal result generation module are explained according to the SHAP value, and interactive visualization is achieved through D3.js, and the timing information is displayed using Timeline.js.

[0094] In the question-answering method provided in this embodiment, the multimodal result generation module uses the BART-large model to generate text responses, uses Stable Diffusion to generate image responses, and adopts the LambdaMART algorithm to comprehensively consider the relevance and diversity of response data of different modalities, sort and fuse the results, and determine the arrangement order of the response data. In terms of interpretability, SHAP values ​​are used to explain model decisions, interactive visualization is achieved through the D3.js library, and Timeline.js is used to intuitively present the development context of events, which can significantly improve the richness and interpretability of the response data output by the system and provide users with comprehensive and easy-to-understand answers.

[0095] In summary, the effects and advantages of the present invention are mainly reflected in the following aspects: First, through the construction and utilization of the time series knowledge graph, the system's ability to handle complex time series queries is significantly improved, so that it can accurately grasp the development context of events and time dependencies; secondly, the adaptive model scheduling module greatly improves the system's processing efficiency and resource utilization, and can flexibly select the most appropriate processing model according to query characteristics; thirdly, the dynamic service combination mechanism provided by the interactive query optimization module greatly enhances the flexibility and adaptability of the system, so that the system can adapt to various complex queries and fuzzy query scenarios; in addition, the multimodal result generation module significantly improves the richness and interpretability of the response data output by the system, and can provide users with comprehensive and easy-to-understand answers.

[0096] In order to better understand the TKAM-QOS system and the response method of the present invention, the present invention also provides a specific example of the response method. In this embodiment, the response method is applied to news event analysis.

[0097] Suppose a user makes the following request to the TKAM-QOS system (i.e., the first dialogue text): "Analyze major events related to climate change in the past year, combine news reports, social media discussions, and scientific research papers, evaluate changes in public attitudes toward climate policy, and predict major related events that may occur in the next six months."

[0098] After receiving the first conversation text, the TKAM-QOS system will search for relevant data such as news articles, social media posts, scientific research paper abstracts, and time information.

[0099] The temporal knowledge graph construction module will process the acquired relevant data: the temporal knowledge graph construction module first pre-processes news articles and social media posts, including word segmentation and stop word removal, and the scientific research paper abstracts are converted into structured text descriptions; the improved REBEL model is used to extract entities and relationships in news articles, social media posts, and scientific research paper abstracts, with special attention to events, policies, and opinions related to climate change, and the TComplEx model is used to encode the temporal information in news articles, social media posts, and scientific research paper abstracts; if multimodal data is collected, the CLIP model is used to process images that may be contained, and the Wav2Vec2 model is used to process audio; the features extracted by all models are projected into a unified embedding space, and the cross-modal attention mechanism is used to fuse these features, and the importance weight of each modal feature is dynamically calculated. Finally, the weighted features are integrated to form the nodes and edges of the temporal knowledge graph to construct the temporal knowledge graph.

[0100] Furthermore, the adaptive model scheduling module uses a lightweight DistilBERT model to quickly extract the first feature of the first dialogue text, and combines the XGBoost algorithm to predict the prediction complexity of this retrieval question and answer; the adaptive model scheduling module can use the Multi-Armed Bandit algorithm to generate the first query feature and candidate model set of the first dialogue text based on the first feature and the prediction complexity, wherein the system decides to use the GPT-3.5 model in the candidate model set as the main language processing model, and at the same time calls the TimeBART model specifically for time series analysis. The system also decides to use the Langchain framework to call external knowledge sources, such as climate databases and policy literature libraries.

[0101] Furthermore, the deep semantic understanding module uses the DeBERTa-v3 model for semantic understanding, deeply analyzes the content of the retrieval query, and generates semantic features.

[0102] Specifically, after obtaining the first dialogue text, the temporal knowledge graph and the first query feature, the deep semantic understanding module can input the first dialogue text, the temporal knowledge graph and the first query feature into the semantic model to obtain the semantic features of the first dialogue text output by the semantic model, focusing on identifying key concepts such as "climate change", "public attitude", "policy", etc., and understanding the time range of the query (the past year and the next six months); using the TimeBART model to extract and understand the temporal features; using the Few-Shot learning method, based on the prototype network, intent recognition is performed to identify multiple intents involved in this retrieval question and answer, such as "event analysis", "attitude assessment", and "trend prediction", and generate intent features.

[0103] Furthermore, the interactive query optimization module is based on the dialogue system built on the Rasa framework, and uses the DialoGPT model to generate clarifying questions, such as "Are you more interested in specific types of climate policies?" or "When analyzing public attitudes, which specific groups do you want to focus on?", etc., and uses the ConvBERT model to understand the user's answers and update the context; the interactive query optimization module uses Allen interval algebra combined with ASP for temporal reasoning to determine the sequence and causal relationship of events, and uses the T5-base model to rewrite and expand the original dialogue text to cover more comprehensive relevant information, and finally output the second query feature.

[0104] Furthermore, the dynamic service composition module uses an improved HTN algorithm combined with a Monte Carlo tree search algorithm to plan the service call sequence, deciding to call the event extraction service first, then the attitude analysis service, and finally the trend prediction service; the graph attention network is used to optimize service selection, considering the dependencies between services, such as the impact of attitude analysis results on trend prediction; the PPO algorithm is used to achieve real-time adjustment of the execution order, adjust the service call strategy in real time, and dynamically adjust the call parameters of subsequent services according to the intermediate results.

[0105] Furthermore, the multimodal result generation module uses the BART-large model to generate the text content of the analysis report; for key data, such as the trend of changes in public attitudes, the Matplotlib library is called to generate visual charts; the LambdaMART algorithm is used to sort the generated response data to ensure that the most relevant and important information is presented first; the SHAP value is used to explain the decision-making process of the model, such as which factors have the greatest impact on changes in public attitudes; the D3.js library is used to create an interactive timeline to show major events in the past year; for future trend predictions, confidence intervals are used to represent uncertainty and visualized through Timeline.js.

[0106] Through a series of steps, the system is able to conduct a comprehensive analysis of a given request, providing highly reliable and interpretable event analysis, attitude assessment, and trend prediction, while maintaining sufficient flexibility to adapt to different retrieval query situations and continuously update knowledge. The system's output includes not only detailed text reports, but also intuitive visualization content and an interactive exploration interface, allowing users to deeply understand the system's analysis process and results, and conduct further news investigations and reports based on this.

[0107] The present invention also provides a question-answering device. Figure 2 , Figure 2 It is a structural diagram of the question-answering device provided by the present invention. In this embodiment, the question-answering device includes an acquisition module 210, a knowledge graph construction module 220, a first query module 230, a semantic and intent recognition module 240, a second query module 250, a service call module 260 and a result generation module 270.

[0108] The acquisition module 210 is used to acquire the first conversation text of the user.

[0109] The knowledge graph construction module 220 is used to construct a temporal knowledge graph based on the first conversation text.

[0110] The first query module 230 is used to determine a first query feature of the first dialogue text based on the first dialogue text and the temporal knowledge graph.

[0111] The semantic and intention recognition module 240 is used to determine the semantic features, temporal features and intention features of the first dialogue text based on the first dialogue text, the temporal knowledge graph and the first query feature.

[0112] The second query module 250 is used to determine the second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature.

[0113] The service calling module 260 is used to determine the service calling strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature.

[0114] The result generation module 270 is used to generate response data of the first dialogue text based on the service call strategy, the time series knowledge graph, the first query feature, the semantic feature, the time series feature, the intention feature and the second query feature.

[0115] In some embodiments, the first query module 230 is used to input the first conversation text into the first query analysis model to obtain the first feature output by the first query analysis model; input the time series knowledge graph into the prediction model to obtain the prediction complexity output by the prediction model; and generate the first query feature and candidate model set of the first conversation text based on the first feature and the prediction complexity.

[0116] In some embodiments, the candidate model set includes a semantic model, a temporal feature extraction model, and an intent recognition model.

[0117] The semantic and intent recognition module 240 is used to input the first dialogue text, the temporal knowledge graph and the first query feature into the semantic model to obtain the semantic features of the first dialogue text output by the semantic model; input the first dialogue text, the temporal knowledge graph and the first query feature into the temporal feature extraction model to obtain the temporal features output by the temporal feature extraction model; input the first dialogue text, the temporal knowledge graph and the first query feature into the intent recognition model to obtain the intent features output by the intent recognition model.

[0118] In some embodiments, the second query module 250 is used to generate interactive response data based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature; obtain the user's second dialogue text based on the interactive response data; input the second dialogue text, the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature into the second query analysis model to obtain the second query feature of the first dialogue text output by the second query analysis model.

[0119] In some embodiments, the service call module 260 is used to generate multiple service call tasks based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature and the intention feature; determine the execution order of each service call task based on the service dependency relationship between each service call task; determine the service call strategy based on the execution order of each service call task.

[0120] In some embodiments, the response data includes text response data and image response data.

[0121] The result generation module 270 is used to input the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the text generation model to obtain the text response data of the first dialogue text output by the text generation model; input the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature into the image generation model to obtain the image response data of the first dialogue text output by the image generation model; input the text response data and the image response data into the result sorting model to obtain the arrangement order output by the result sorting model; and sort the text response data and the image response data based on the arrangement order.

[0122] The present invention also provides an electronic device, Figure 3 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the question-answering method.

[0123] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0124] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the question-and-answer method provided by the above-mentioned methods.

[0125] The present invention also provides a computer program product, which includes a computer program. The computer program 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 question-and-answer methods provided by the above methods.

[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0128] 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 embodiments of the present invention.

Claims

1. A question-answering method, characterized in that: include: Get the user's first conversation text; Based on the first conversation text, construct a time series knowledge graph; Determine a first query feature of the first conversation text based on the first conversation text and the temporal knowledge graph; Determine semantic features, temporal features, and intention features of the first conversation text based on the first conversation text, the temporal knowledge graph, and the first query feature; Determine a second query feature of the first conversation text based on the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, and the intention feature; Determine a service call strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature, and the intention feature; Based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature, response data of the first dialogue text is generated.

2. The question-answering method according to claim 1, characterized in that: The determining, based on the first conversation text and the temporal knowledge graph, a first query feature of the first conversation text includes: Inputting the first conversation text into a first query analysis model to obtain a first feature output by the first query analysis model; Inputting the time series knowledge graph into a prediction model to obtain the prediction complexity output by the prediction model; Based on the first feature and the prediction complexity, a first query feature and a candidate model set of the first dialogue text are generated.

3. The question-answering method according to claim 2, characterized in that: The candidate model set includes a semantic model, a temporal feature extraction model and an intent recognition model; The determining, based on the first conversation text, the temporal knowledge graph and the first query feature, the semantic feature, the temporal feature and the intention feature of the first conversation text includes: Inputting the first dialogue text, the temporal knowledge graph, and the first query feature into a semantic model to obtain a semantic feature of the first dialogue text output by the semantic model; Inputting the first conversation text, the time series knowledge graph and the first query feature into a time series feature extraction model to obtain the time series feature output by the time series feature extraction model; The first conversation text, the time series knowledge graph and the first query feature are input into an intention recognition model to obtain the intention feature output by the intention recognition model.

4. The question-answering method according to claim 1, characterized in that: The determining, based on the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, and the intention feature, a second query feature of the first conversation text includes: Generate interactive response data based on the first conversation text, the time-series knowledge graph, the first query feature, the semantic feature, the time-series feature, and the intention feature; Based on the interactive response data, obtaining a second dialogue text of the user; The second conversation text, the first conversation text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature and the intention feature are input into a second query analysis model to obtain a second query feature of the first conversation text output by the second query analysis model.

5. The question-answering method according to claim 1, characterized in that: The determining of the service call strategy based on the second query feature, the time series knowledge graph, the semantic feature, the time series feature and the intention feature includes: Generate multiple service call tasks based on the second query feature, the time series knowledge graph, the semantic feature, the time series feature and the intention feature; Determining the execution order of each of the service calling tasks based on the service dependency relationship between each of the service calling tasks; A service calling strategy is determined based on the execution order of each of the service calling tasks.

6. The question-answering method according to claim 1, characterized in that: The response data includes text response data and image response data; The generating response data of the first dialogue text based on the service call strategy, the time series knowledge graph, the first query feature, the semantic feature, the time series feature, the intention feature and the second query feature includes: Inputting the service call strategy, the time series knowledge graph, the first query feature, the semantic feature, the time series feature, the intention feature, and the second query feature into a text generation model to obtain text response data of the first dialogue text output by the text generation model; Inputting the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature, and the second query feature into an image generation model to obtain image response data of the first dialogue text output by the image generation model; Inputting the text response data and the image response data into a result sorting model to obtain an arrangement order output by the result sorting model; The text response data and the image response data are sorted based on the arrangement order.

7. A question-answering device, characterized in that: include: An acquisition module, used to acquire the user's first conversation text; A knowledge graph construction module, used to construct a time series knowledge graph based on the first conversation text; A first query module, configured to determine a first query feature of the first conversation text based on the first conversation text and the temporal knowledge graph; A semantic and intention recognition module, configured to determine semantic features, temporal features, and intention features of the first dialogue text based on the first dialogue text, the temporal knowledge graph, and the first query feature; A second query module, configured to determine a second query feature of the first dialogue text based on the first dialogue text, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, and the intention feature; A service calling module, configured to determine a service calling strategy based on the second query feature, the temporal knowledge graph, the semantic feature, the temporal feature, and the intention feature; A result generation module is used to generate response data of the first dialogue text based on the service call strategy, the temporal knowledge graph, the first query feature, the semantic feature, the temporal feature, the intention feature and the second query feature.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the question-answering 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 question-answering method according to 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 question-answering method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Retrieval enhancement generation method for multi-modal financial data

    CN120257198A

  • Response text generation method and device and related equipment

    CN121350211A

  • Graph RAG system construction method in titanium alloy field

    CN121455976A