Knowledge question and answer method and device, electronic equipment, storage medium and program product

By combining the temporal knowledge graph and the large language model, the time information and keywords in the question are extracted, the context information is generated and integrated, which solves the timeliness and accuracy problems of the knowledge question-answering system in dynamic information processing and provides the latest and relevant response information.

CN120705256APending Publication Date: 2025-09-26MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510215844.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing knowledge question-answering systems suffer from insufficient timeliness and poor accuracy when processing dynamically changing information, especially in providing the latest and relevant information for time-sensitive questions.

Method used

A temporal knowledge graph is used to store knowledge information, and combined with a large language model, relevant knowledge information is obtained from the temporal knowledge graph by extracting time information and keywords in the question, generating contextual information and then fusing it to provide a response.

Benefits of technology

The timeliness and accuracy of the knowledge question-answering system have been improved, the generated response information is more in line with user needs, misunderstandings and incorrect answers are reduced, and the coherence and readability of the information are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705256A_ABST
    Figure CN120705256A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge question-answering method and device, electronic equipment, a storage medium and a program product, which are used for improving the timeliness and accuracy of knowledge questions and answers. The knowledge question-answering method comprises the following steps: extracting time information and a first keyword in a first question; obtaining first knowledge information corresponding to the first question from a time sequence knowledge graph based on the time information and the first keyword; splicing the first question and the first knowledge information, and inputting the spliced first question and first knowledge information into a large language model to obtain first context information of the first knowledge information; and fusing the first context information and the first knowledge information to obtain first response information of the first question.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a knowledge question answering method, device, electronic device, storage medium and program product. Background Art

[0002] With the rapid development of natural language processing technology, knowledge question-answering systems have emerged. Users input questions into the knowledge question-answering system, and the knowledge question-answering system retrieves relevant knowledge information to obtain the answer to the question.

[0003] Faced with complex and dynamically changing knowledge information, how to improve the timeliness and accuracy of knowledge question answering has become a hot research direction. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a knowledge question answering method, device, electronic device, storage medium and program product for improving the timeliness and accuracy of knowledge question answering.

[0005] In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions: In a first aspect, an embodiment of the present application provides a knowledge question answering method, comprising: Extracting time information and the first keyword from the first question; Based on the time information and the first keyword, obtaining first knowledge information corresponding to the first question from a time series knowledge graph; splicing the first question and the first knowledge information and inputting the resultant information into a large language model to obtain first context information of the first knowledge information; The first context information and the first knowledge information are integrated to obtain first answer information for the first question.

[0006] In a second aspect, an embodiment of the present application provides a knowledge question-answering device, comprising: an extraction module, configured to extract time information and a first keyword from the first question; A first acquisition module, configured to acquire first knowledge information corresponding to the first question from a time series knowledge graph based on the time information and the first keyword; a generation module, configured to concatenate the first question and the first knowledge information and input the concatenated information into a large language model to obtain first context information of the first knowledge information; A fusion module is used to fuse the first context information and the first knowledge information to obtain first answer information for the first question.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, including: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the knowledge question and answer method provided in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the knowledge question and answer method provided in the first aspect.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps in the knowledge question and answer method provided in the first aspect.

[0010] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: Extracting the time information and first keyword from the first question helps the question-answering system accurately understand the user's intent, making the generated answer information more tailored to user needs and reducing the possibility of misunderstandings and incorrect answers. A temporal knowledge graph is used to store knowledge information and its effective time. The first knowledge information obtained from the temporal knowledge graph based on the time information and the first keyword has high timeliness and strong relevance, which means that no matter what the first question is, the question-answering system can provide the latest and most relevant information. Furthermore, concatenating the first question and the first knowledge information and inputting them into a large language model can fully utilize the semantic understanding and generation capabilities of the large language model to generate first context information. The first context information effectively integrates the first knowledge information and is coherent and readable. It can be used to answer the first question and provide reliable data support for improving the accuracy of the answer. Finally, the first knowledge information and the first context information are fused to obtain the first answer information for the first question. This not only improves the accuracy of the answer, but also ensures the readability and coherence of the first answer information, allowing users to easily understand complex information and understand the source and basis of the first knowledge information while obtaining it. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of the structure of a knowledge question answering system provided in one embodiment of the present application; Figure 2A flowchart of a knowledge question answering method provided in one embodiment of the present application; Figure 3 A flowchart of a knowledge question answering method provided in another embodiment of the present application; Figure 4 A schematic diagram of the structure of a knowledge question-answering device provided in one embodiment of the present application; Figure 5 A schematic structural diagram of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION

[0012] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0013] The terms "first," "second," and the like in this specification and claims are used to distinguish similar objects and are not intended to describe a particular order or precedence. It should be understood that such terms are interchangeable where appropriate so that the embodiments of the present application can be implemented in sequences other than those illustrated or described herein. In addition, the term "and / or" in this specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the connected objects are in an "or" relationship.

[0014] Some concept descriptions: Temporal Knowledge Graphs (TKG) are an extension of Knowledge Graph (KG). They not only contain entities and their relationships, but also information about how these relationships change over time.

[0015] Knowledge question-answering systems in related technologies mainly include traditional question-answering systems, rule-based question-answering systems, and retrieval-based question-answering systems. Traditional question-answering systems often rely on static knowledge bases or static knowledge graphs. Since static knowledge bases and static knowledge graphs are not updated in a timely manner, it is difficult to reflect the latest events and developments, resulting in insufficient timeliness of information. In turn, traditional question-answering systems are unable to handle dynamically changing information, resulting in insufficient accuracy in time-sensitive questions. Rule-based question-answering systems have poor flexibility and are unable to cope with complex natural language expressions, which limits the user's query methods. Retrieval-based question-answering systems lack the ability to understand contextual information and are prone to generating answers that do not match the user's intentions, especially in multi-round conversations.

[0016] In view of this, an embodiment of the present application proposes a knowledge question answering method that combines the generation capability of a large language model and the structured information of a dynamic temporal knowledge graph, aiming to effectively handle time-sensitive problems and improve the timeliness, accuracy and intelligence of knowledge question answering. By extracting the time information and the first keyword from the first question, the method helps the question-answering system accurately understand the user's intent, making the generated answer information more in line with the user's needs and reducing the possibility of misunderstanding and incorrect answers. A temporal knowledge graph is used to store the knowledge information and its effective time. The first knowledge information obtained from the temporal knowledge graph based on the time information and the first keyword has high timeliness and strong relevance, which means that no matter what kind of question the first question is, the question-answering system can provide the latest and most relevant information. Furthermore, the first question and the first knowledge information are spliced ​​and input into a large language model, which can fully utilize the semantic understanding and generation capabilities of the large language model to generate first context information. The first context information effectively integrates the first knowledge information and is coherent and readable. It can be used to answer the first question and provide reliable data support for improving the accuracy of the answer. Finally, the first knowledge information and the first context information are fused to obtain the first answer information for the first question. This not only improves the accuracy of the answer, but also ensures the readability and coherence of the first answer information, allowing users to easily understand complex information and understand the source and basis of the first knowledge information while obtaining it.

[0017] It should be understood that the knowledge question-answering method provided in the embodiments of the present application can be executed by an electronic device, specifically by a processor of the electronic device. The electronic devices referred to herein may include terminals, such as but not limited to smartphones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances, smart watches, vehicle-mounted terminals, aircraft, etc.; or, the electronic device may also include a server, such as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0018] Before introducing the knowledge question answering method provided by the embodiment of the present application in detail, a brief introduction to the knowledge question answering system involved in the embodiment of the present application is given. Figure 1 , is a schematic diagram of the structure of a knowledge question answering system provided in one embodiment of the present application, the system including a terminal 1 and a server 2. A communication connection is established between the terminal 1 and the server 2, for example, the terminal 1 and the server 2 are connected via a wired or wireless network.

[0019] Terminal 1 provides an interactive interface, receives questions input by the user through the interactive interface, and sends the questions to server 2, which obtains the corresponding answers. Terminal 1 can also receive answers returned by server 2 and display them on the interactive interface.

[0020] Server 2 is deployed with a large language model and a temporal knowledge graph. The temporal knowledge graph contains a large amount of knowledge information and the validity period of each piece of knowledge information. After receiving the question from Terminal 1, Server 2 combines the generation capabilities of the large language model with the structured information of the dynamic temporal knowledge graph to generate the corresponding answer and return the answer to Terminal 1.

[0021] Based on the system architecture introduced above, the knowledge question and answer method provided in the embodiment of the present application will be described in detail with reference to the accompanying drawings.

[0022] Please refer to Figure 2 , is a flow chart of a knowledge question answering method provided in one embodiment of the present application, the method comprising the following steps: S202: Extract time information and a first keyword from the first question.

[0023] The first question can include information in multiple modalities (e.g., text, voice, and images). As an example, the terminal displays a graphical user interface (GUI) including an input box and prompt text. The input box is used to receive information in different modalities as the first question, and the prompt text is used to help the user clarify the content of the question.

[0024] If the text input by the user is received through the input box, the text is used as the first question.

[0025] If a voice message is received through the input box, Automatic Speech Recognition (ASR) technology is used to convert the voice message into text, which is used as the first question. For example, the user's voice input "What's the weather like today?" is converted into the corresponding text.

[0026] If an image is received through the input box, image recognition technology is used to analyze the image content and extract key information as the first question. For example, if a plant photo is received through the input box, image recognition technology is used to analyze the plant's name, morphology, and other key information as the first question.

[0027] If information in multiple modes such as text, voice, and image is received through the input box, this information is taken as the first question, and these information are embedded separately to obtain the vector corresponding to the information of each mode, and then these vectors are spliced ​​for subsequent processing, that is, ,in, Indicates text The vector obtained by embedding is Indicates voice The vector obtained by embedding is Represents the image The vector obtained by embedding is Indicates splicing.

[0028] The time information may include, but is not limited to, a specified time (hereinafter referred to as the first time), a specified time range (hereinafter referred to as the first time range), etc., to instruct the knowledge question answering system to output an answer that satisfies the time information. In S202 above, the time information in the first question can be extracted by various appropriate methods.

[0029] In one embodiment, the above S202 includes the following steps: Step A1: Encode the words in the first question to obtain the word vectors of the words.

[0030] The word in the first question is input into the Bidirectional Encoder Representations from Transformers (BERT) model for encoding to obtain a word vector. The resulting word vector contains the word and its context information and is usually a high-dimensional vector.

[0031] For example, let the first question be ,in, Represents the i-th word in the first question After encoding each word through the BERT model, the resulting word vector is represented as , Indicates the i-th word word vectors.

[0032] Step A2: predicting a first probability that the word belongs to the first part of the first entity and a second probability that the word belongs to the second part of the first entity based on the word vector of the word.

[0033] The first entity refers to an entity of type time. The first part of the entity can be the starting part of the entity, that is, the position where the entity begins to appear in the text, which marks the beginning of the description of this entity. The second part of the entity can be the non-starting part of the entity, that is, the part of the entity other than the starting part. For example, in the text "MM / DD / YYYY is a special holiday", "MM / DD / YYYY" is the first entity, "YYYY" is the first part of the first entity, and "MM / DD / YYYY" is the second part of the first entity.

[0034] Specifically, a predefined tag set ,Label Indicates that it does not belong to the first entity, represents the first part of the first entity, Represents the second part of the first entity. For example, in the text "I went to the mall yesterday morning", the labels corresponding to the words "I" and "went to the mall" are , the label corresponding to the word "yesterday morning" is For example, in the text "I was busy from 8 am to 5 pm", the labels corresponding to the words "I" and "busy until" are , the label corresponding to the word "eight o'clock in the morning" is , the label corresponding to the word "five o'clock in the afternoon" is .

[0035] For each word, a sequence labeling algorithm is used to predict the probability that the word belongs to each tag in the tag set, as shown in the following formula (1).

[0036] (1) in, Represents the word vector for a given i-th word In the case of , the i-th word is labeled as the j-th label in the label set The probability of the jth label The corresponding weight vector is used to transform the word vector Mapping to label space; is the jth label The corresponding bias term is used to adjust the output so that the sequence labeling model can better fit the data during training; is the tag index, which is used to indicate the sequence number of the tag in the tag set; Indicates that in a given word vector In the case of The corresponding unnormalized score reflects the probability that the i-th word is labeled with this label The relative probability of represents the sum of the unnormalized scores of all labels.

[0037] Based on this, for each word, the word is marked as a label The probability of the word belonging to the first part of the first entity is the probability that the word is marked as a label The probability of is the probability that the word belongs to the second part of the first entity.

[0038] Step A3: determining the time information in the first question based on the first word in the first question whose first probability is greater than the probability threshold and the second word in the first question whose second probability is greater than the probability threshold.

[0039] In the first question, the first word with a first probability greater than the probability threshold represents the first part of the first entity, and the start time can be determined from the first word; the second word with a second probability greater than the probability threshold represents the second part of the first entity, and the end time can be determined from the second word; further, the start time and the end time are used as time information in the first question, which is used to instruct the knowledge question and answer system to output an answer that is valid between the start time and the end time.

[0040] Alternatively, for each word, based on the probability of the word being labeled with each label in the label set, the label with the highest probability is selected from the label set as the label corresponding to the word, that is, , where represents the label corresponding to the i-th word; further, the corresponding label is selected as The word is taken as the first word, the starting time is determined from the first word, and the corresponding label is selected as The word is used as the second word, and the end time is determined from the second word; further, the start time and the end time are used as the time information in the first question.

[0041] In practical applications, after extracting the time information in the first question, the time information can also be standardized through regular expressions, for example, converting "tomorrow" and "October 16, 2024" into a unified format.

[0042] In the above embodiment, the word vector of a word contains rich semantics and contextual information of the word. Entity recognition technology is used to determine the first word belonging to the first part of the time entity and the second word belonging to the second part of the time entity from the first question. These words contain accurate start time or end time, and then based on these words, the time information in the first question can be accurately extracted, providing reliable data support for improving the timeliness of knowledge questions and answers.

[0043] In another embodiment, a series of time-related rules and patterns can be predefined, and the time information in the first question can be extracted based on a rule matching method. For example, a phrase containing a specific time keyword in the first question is extracted as time information, wherein the specific time keyword can include, but is not limited to: "year", "month", "day", "hour", "minute", "second", "morning", "afternoon", "noon", "evening", etc. For time information in date format, such as typical date expressions such as "YYYY-MM-DD" or "DD / MM / YYYY", regular expressions can be used to match and extract it. In addition, some time word combination rules can also be used, such as the structure of "from [start time] to [end time]" to extract time information.

[0044] The above describes some implementation methods for extracting the time information in the first question. Of course, it should be understood that the time information in the first question can also be extracted by other methods, and the embodiments of the present application are not limited to this.

[0045] In the above S202 , the first keyword in the first question may be extracted in various appropriate ways.

[0046] In one embodiment, the similarity between the words in the first question and the first question is determined, as shown in the following formula (2); then, a word with a similarity greater than a similarity threshold is selected as the first keyword, as shown in the following formula (3).

[0047] (2) (3) in, Indicates the nth word Regarding the first question The similarity between Indicates the first keyword, , Represents the similarity threshold.

[0048] In another embodiment, for each word in the first question, the frequency of occurrence of the word in the first question is counted; then, the word whose frequency of occurrence exceeds a frequency threshold is used as the first keyword.

[0049] In another embodiment, for each word in the first question, the term frequency-inverse document frequency (TF-IDF) of the word is determined. Then, the word whose TF-IDF is greater than a preset threshold is used as the first keyword. Term frequency (TF) measures the frequency of a word's occurrence in a single document, while inverse document frequency (IDF) measures the rarity of a word in the entire text collection.

[0050] The above describes some implementation methods for extracting the first keyword from the first question. Of course, it should be understood that the first keyword from the first question can also be extracted by other methods, which are not limited in this embodiment of the present application.

[0051] S204: Based on the time information and the first keyword, obtain first knowledge information corresponding to the first question from the temporal knowledge graph.

[0052] The temporal knowledge graph includes knowledge information and the effective time of the knowledge information. As an example, the knowledge information includes entities and the relationships between entities. The effective time of the knowledge information can include the effective time of the entity and the effective time of the relationship between the entities. Specifically, the temporal knowledge graph can be represented as ,in, Represents a node set, which includes the nodes corresponding to the entity; Represents an edge set, which includes edges between nodes. Edges represent the relationship between entities corresponding to the connected nodes; Represents a time collection that contains the effective time of entities and the effective time of relationships between entities, so as to track historical changes.

[0053] In the embodiments of the present application, the temporal knowledge graph can be constructed in various appropriate ways.

[0054] In one embodiment, knowledge information is collected through application programming interfaces (APIs), real-time data streams, or periodic crawling. This knowledge information includes historical events, change records, etc. is the collection of collected knowledge information, is a time set, then ,in, Represents the i-th knowledge information, which includes event description, state change, etc. Represents the effective time of the i-th piece of knowledge information. Change records generally refer to dynamic change information related to specific entities, relationships, or attributes. These changes can cover various types of knowledge information, including: entity state changes, such as a company's stock price fluctuations, changes in users' online behavior, product inventory levels, etc.; relationship changes, such as changes in the relationship between two entities (the establishment or dissolution of a partnership, changes in friend relationships in a social network, etc.); attribute updates, that is, changes in the attribute information of an entity, such as changes in a person's position, updates to the time and location of an event, adjustments to product specifications or prices, etc.; historical event supplements, that is, when new historical events are discovered or confirmed, these events need to be included in the knowledge graph. By continuously updating these change records, the temporal knowledge graph can maintain the timeliness of knowledge information and reflect dynamic changes in the real world. This mechanism also provides a basis for subsequent data analysis and decision-making.

[0055] Then, entities and relationships between entities are extracted from each piece of knowledge information; nodes corresponding to each entity are constructed, and based on the relationships between entities, edges between nodes corresponding to entities are constructed to obtain a time series knowledge graph, and a time series database (such as InfluxDB) or an extended graph database is used to store the time knowledge graph.

[0056] In addition, the time series knowledge graph can be continuously updated. The update frequency of the time series knowledge graph can be determined according to the update frequency of the data source. For example, real-time knowledge information can be updated every minute, while static knowledge information can be updated every week. Let the update frequency (unit: day) be ,but , then the updating process of knowledge information can be expressed as ,in, It is the updated temporal knowledge graph.

[0057] In an embodiment of the present application, the temporal knowledge graph supports time-based queries, allowing the acquisition of knowledge information that conforms to time information and is combined with first keyword filtering.

[0058] Specifically, in one embodiment, the time information in the first question includes a first time range. In this case, S204 includes the following steps: performing named entity recognition on the first keyword to obtain a second entity in the first keyword; obtaining second knowledge information from the temporal knowledge graph, wherein a third entity included in the second knowledge information matches the second entity and the validity period of the second knowledge information falls within the first time range; and determining that the second knowledge information is the first knowledge information corresponding to the first question.

[0059] Specifically, named entity recognition for the first keyword can be achieved in various appropriate ways, which are not limited in the embodiments of the present application. As an example, the prompt word for named entity recognition and the first keyword are input into a large language model, and the semantic understanding and processing capabilities of the large language model are used to identify the second entity in the first keyword. As another example, a trained named entity recognition model, such as a conditional random field (CRF), is used to perform entity recognition on the first keyword to obtain the second entity in the first keyword. As another example, the second entity in the first keyword is identified based on pre-set rules and patterns. Among them, these rules can be based on lexical, syntactic and semantic information, such as specific affixes, part-of-speech combinations, context clues, etc. For example, in English, names usually start with capital letters, and consecutive capitalized words may constitute a person's name.

[0060] Assume the first time range is , the first knowledge information can be expressed as ,in, Represents the i-th knowledge information in the judgment time series knowledge graph Entity and first keyword in Whether the second entity in matches.

[0061] More specifically, a query statement can be constructed based on the first keyword and time information. Taking Cyber ​​statement as an example, the query statement is ; Then, execute the query statement on the time series knowledge graph to obtain the first knowledge information.

[0062] In practical applications, whether two entities match can be determined by multi-keyword matching, that is, AND / OR logic. If there are multiple first keywords, AND / OR logic needs to be supported. For example, with AND logic, when the entity in the knowledge information matches the second entity in all first keywords, the entity is considered to have matched successfully; with OR logic, when the entity in the knowledge information matches the second entity in any first keyword, the entity is considered to have matched successfully. Through the above method, the first knowledge information can be efficiently collected, stored, updated, and queried, ensuring the timeliness and accuracy of the first knowledge information.

[0063] In another embodiment, intent recognition is performed on the first question to obtain a first intent; knowledge information is obtained from the temporal knowledge graph, in which the entities contained therein match the second entity and the effective time is within the first time range, and first knowledge information matching the first intent is obtained from the knowledge information.

[0064] For example, by performing intent recognition on the first question, it can be determined whether the first intention is to obtain entities within the first time range or the relationship between entities; on this basis, first determine the knowledge information that matches the first keyword and has an effective time within the first time range from the temporal knowledge graph as a candidate; if the first intention is to obtain entities, then obtain the entities in the candidate knowledge information as the first knowledge information; if the first intention is to obtain the relationship between entities, then obtain the relationship between entities in the candidate knowledge information as the first knowledge information.

[0065] The intent of the first question can be identified using various appropriate intent identification technologies, which are not limited in this embodiment of the present application. In one embodiment, the word vectors of the words in the first question are input into a fully connected layer for classification, as shown in the following formulas (4) to (5), to obtain the first intent of the first question.

[0066] (4) (5) in, Indicates the first intention, Indicates the first question The intent belongs to the preset intent set The probability of the i-th intention in , and are the parameters of the fully connected layer, Indicates the first question The word vector set composed of the word vectors of the words in .

[0067] The above describes some implementation methods of the above S204. Of course, it should be understood that the above S204 can also be implemented in other ways, and the present embodiment of the application does not limit this.

[0068] S206: The first question and the first knowledge information are combined and input into a large language model to obtain first context information of the first knowledge information.

[0069] The large language model can be various types of large-scale language models (LLM), such as the large language model of the GPT series, etc., which is not limited in the embodiments of the present application.

[0070] For example, the first problem is expressed as ,in, represents the length of the first question. The first knowledge information is represented as ,in, Indicates the number of first knowledge information. Then, concatenate the first question and the first knowledge information into a string ,in, is a delimiter, such as "\n" or "---"; the string is input into the large language model, which uses its semantic understanding and generation capabilities to generate the first context information ,in, Furthermore, the first context information may be formatted and displayed via a terminal.

[0071] The first context information may include, for example, but is not limited to, context text and the relevance of the context text to the first question, etc. The context text is coherent and provides a detailed answer or extended information to the first question.

[0072] As an example, the correlation can be determined by the following formula (6).

[0073] (6) By integrating the first question and the first knowledge information and using a large language model to generate relevant and coherent first context information, not only the response quality of the knowledge question-answering system is improved, but also a richer knowledge background is provided for users.

[0074] S208: Fusing the first context information and the first knowledge information to obtain first answer information for the first question.

[0075] The first knowledge information can be used as background information of the first context information. By effectively fusing the first context information and the first knowledge information, the accuracy of the generated first response information and the richness of the background information can be ensured.

[0076] In one embodiment, the first context information and the first knowledge information are concatenated, and the concatenated character string is used as the first response information.

[0077] In another embodiment, Figure 3 As shown, the above S208 includes the following steps: S2081: Perform embedding processing on the first context information to obtain a first vector.

[0078] As an example, the context text in the first context information can be embedded to obtain a first vector, that is, ,in, represents the first vector, Indicates embedded processing, Represents the context text, , Indicates the length of the context text.

[0079] As another example, keywords (such as nouns, verbs, etc.) and entities (such as names, places, etc.) in the context text can also be extracted, and the extracted keywords and entities are embedded and then fused to obtain a first vector. The specific implementation method of extracting keywords from the context text is similar to the specific implementation method of extracting the first keyword in the first question in S202 above, and will not be repeated here. The specific implementation method of extracting entities from the context text is similar to the specific implementation method of extracting the first entity in the first question through entity recognition in S202 above, and will not be repeated here.

[0080] S2082: Embed the first knowledge information to obtain a second vector.

[0081] As an example, the first knowledge information can be directly embedded to obtain the second vector, that is, ,in, represents the second vector, Indicates embedded processing, Represents the first knowledge information, , Indicates the quantity of the first knowledge information.

[0082] As another example, entities and relationships between entities in the first knowledge information may be extracted, and the extracted information may be embedded and then fused to obtain a second vector.

[0083] S2083 , performing weighted processing on the first vector and the second vector based on the first weight of the first vector and the second weight of the second vector to obtain a third vector.

[0084] The weighting of the first vector and the second vector may include, but is not limited to, any of weighted averaging and weighted summing. The first weight and the second weight may be pre-set fixed values, or they may be continuously adjusted during the knowledge quiz, thereby dynamically adjusting the influence of information from different sources and improving the quality of the answer.

[0085] As an example, the third vector can be obtained by the following formula (7).

[0086] (7) in, represents the third vector, represents the first vector, represents the first weight, represents the second vector, represents the second weight, .

[0087] S2084: Decode the third vector to obtain first response information for the first question.

[0088] As an example, the first response information can be obtained by decoding the third vector using a decoder, that is, ,in, Indicates the first response information, Represents a decoder.

[0089] Specifically, the first response information may include, but is not limited to, context text, first knowledge information supporting the context text, and the confidence level of the context text. The confidence level of the context text reflects the credibility of the context text and is typically calculated based on the similarity and integrity between the context text and the first knowledge information. Specifically, the confidence level of the context text can be calculated using the following formula (8).

[0090] (8) in, represents the confidence of the context text, Represents the context text, Represents the first knowledge information, It represents the similarity between the context text and the first knowledge information, usually calculated using cosine similarity or other similarity metrics.

[0091] In the above embodiment, the vector after embedding processing implies richer and deeper information. By weighted processing the first vector of the first context information and the second vector of the first knowledge information, the third vector obtained integrates the rich and deep information in the two vectors, thereby realizing the effective integration of the first context information and the first knowledge information; further, the third vector is decoded, and the obtained first response information has higher accuracy and coherence.

[0092] In another embodiment, Figure 3 As shown, after the above S208, the following steps may also be included: S210: Obtain first feedback information regarding the first question.

[0093] The first feedback information may include, for example, but is not limited to: feedback text entered by the user in response to the first answer information, the operation performed by the user in response to the first answer information (such as an exit operation, a confirmation operation, etc.), the user's rating of the first answer information, etc. The first feedback information may be received by the terminal and sent to the server, which may adjust the first weight and the second weight based on the first feedback information to continuously optimize the quality of the answer to the first question.

[0094] As an example, the first feedback information may include third feedback information for the first context information and fourth feedback information for the first knowledge information. For example, after displaying the first response information on the terminal, an interface for scoring the first context information and the first knowledge information is displayed, and the user's score for the first context information, as the third feedback information, is received through the interface. The user's score for the first knowledge information, as the fourth feedback information, is also received through the interface.

[0095] S212: Based on the first feedback information, adjust the first weight to obtain a third weight, and adjust the second weight to obtain a fourth weight.

[0096] In one embodiment, the above S212 includes the following steps: S2121: Determine, based on the first feedback information, a first score of the first response information, a first adjustment method corresponding to the first weight, and a second adjustment method corresponding to the second weight.

[0097] The first score of the first response information is used to reflect the user's satisfaction with the first response information. Specifically, the first score of the first response information may include the first score of the first context information and the first score of the first knowledge information.

[0098] The first score of the first response information can be obtained by quantifying the first feedback information in various appropriate ways. As an example, by parsing the first feedback information, the user's satisfaction with the first context information and the first knowledge information can be obtained, and then the user's satisfaction with the first context information can be quantified into a corresponding first score, as shown in the following formula (9). The user's satisfaction with the first knowledge information can also be quantified into a corresponding first score, as shown in the following formula (10).

[0099] (9) (10) in, A first score representing the first context information, Indicates the user's satisfaction with the first context information, Indicates the reference value, represents the first score of the first knowledge information, Indicates the user's satisfaction with the first knowledge information.

[0100] In addition, after the first feedback information is obtained, the first feedback information is stored in the historical record as a basis for adjusting the first weight and the second weight in the next round.

[0101] The first adjustment method corresponding to the first weight may include, but is not limited to, increasing the first weight, decreasing the first weight, or not adjusting the first weight. The first adjustment method corresponding to the second weight may include, but is not limited to, increasing the second weight, decreasing the second weight, or not adjusting the second weight.

[0102] As an example, determining a first adjustment method corresponding to a first weight and a second adjustment method corresponding to a second weight includes: determining third feedback information for the first context information and fourth feedback information for the first knowledge information from the first feedback information; performing sentiment classification on the third feedback information to obtain a first sentiment category, and determining a first adjustment method corresponding to the first weight based on the first sentiment category; performing sentiment classification on the fourth feedback information to obtain a second sentiment category, and determining a second adjustment method corresponding to the second weight based on the second sentiment category.

[0103] Specifically, sentiment classification of feedback information includes: firstly processing the feedback information using the Long-Short Term Memory (LSTM) network to obtain the hidden state Then, the hidden state Input into a fully connected layer and mapped to a numerical value through the activation function tanh to obtain the probability that the feedback information belongs to each emotion category (such as positive, negative, neutral) in the emotion category set, that is, ,in, Indicates the probability that the feedback information belongs to a certain emotion category, which can be a continuous value (such as -1 to 1); Represents the weight matrix of the fully connected layer; Represents the bias vector of the fully connected layer; Represents the activation function. If it is a regression task, tanh can be used to obtain the probability in the range of [-1, 1]. If it is a classification task, sigmoid may be used to obtain the probability in the range of [0, 1]. Then, the emotion category with the highest probability is determined as the emotion category of the feedback information, that is, , where C represents the sentiment category of the feedback information, It represents the probability that the feedback information belongs to the emotion category c in the emotion category set.

[0104] For the first weight, if the first emotion category is positive, it means that the user is satisfied with the first context information, and then the first adjustment method is determined to be to increase the first weight; if the first emotion category is negative, it means that the user is dissatisfied with the first context information, and then the first adjustment method is determined to be to reduce the first weight; if the first emotion category is neutral, then the first adjustment method is determined to be not to adjust the first weight.

[0105] For the second weight, if the second emotion category is positive, it means that the user is satisfied with the first knowledge information, and the second adjustment method is determined to be to increase the second weight; if the second emotion category is negative, it means that the user is dissatisfied with the first knowledge information, and the second adjustment method is determined to be to reduce the second weight; if the second emotion category is neutral, the second adjustment method is determined to be not to adjust the second weight.

[0106] S2122: Determine a second score of the first response information based on the second feedback information of the first question.

[0107] The second feedback information is feedback information obtained before the first feedback information.

[0108] Specifically, the second score of the first response information includes the second score of the first context information and the second score of the first knowledge information.

[0109] S2123: Determine a first adjustment range corresponding to the first weight and a second adjustment range corresponding to the second weight based on the first score and the second score.

[0110] As an example, the above S2123 includes the following steps: determining the first coefficient of the first weight based on the mean and standard deviation of the first score of the first context information; determining the second coefficient of the second weight based on the mean and standard deviation of the first score of the first knowledge information; determining the sum of the first score of the first context information and the second score of the first context information to obtain the third score, and obtaining the first adjustment range of the first weight based on the product of the third score and the first coefficient; determining the sum of the first score of the first knowledge information and the second score of the first knowledge information to obtain the fourth score, and obtaining the second adjustment range of the second weight based on the product of the fourth score and the second coefficient.

[0111] For example, is the first weight, is the second weight, is the basic learning rate, which is used to control the magnitude of each adjustment, is the first score of the first context information, is the first score of the first knowledge information, and the value range can be [-1, 1], where a negative value indicates a decrease in weight, and a positive value indicates an increase in weight. is the current adjusted time step, is the attenuation factor, which is used to reduce the weight of earlier feedback information. is a sequence of multiple second feedback scores, including the previous The second score of the step, is the coefficient used to adjust the weight (the first coefficient and the second coefficient can be different), and the basic learning rate is adjusted according to the standard deviation of the current feedback change, that is, ,in, represents the mean, The first coefficient and the second coefficient can be obtained by the following formula (11), and the first adjustment range is , the second service is .

[0112] S2123: Based on the first adjustment method and the first adjustment range, adjust the first weight to obtain a third weight.

[0113] Specifically, the third weight can be determined by the following formula (11).

[0114] (11) in, Represents the third weight.

[0115] S2124: Based on the second adjustment method and the second adjustment range, adjust the second weight to obtain a fourth weight.

[0116] Specifically, the fourth weight can be determined by the following formula (12).

[0117] (12) in, Represents the fourth weight.

[0118] Through the above implementation, fine-grained and targeted adjustment of the first weight and the second weight can be achieved, which helps to improve user satisfaction with the first context information and the first knowledge information.

[0119] S214 , performing weighted processing on the first vector and the second vector based on the third weight and the fourth weight to obtain a fourth vector.

[0120] Among them, the specific implementation of S214 is similar to the specific implementation of S2083 above, and will not be repeated here.

[0121] S216: Decode the fourth vector to obtain second response information for the first question.

[0122] Among them, the specific implementation of S216 is similar to the specific implementation of S2084 above, and will not be repeated here.

[0123] The knowledge question-answering method provided by the above embodiment not only generates accurate and natural responses but also continuously optimizes based on user feedback, ensuring the knowledge question-answering system's self-learning and adaptability. This feedback-based optimization mechanism helps form a virtuous cycle. This closed-loop design ensures the long-term improvement of the knowledge question-answering system and increased user satisfaction.

[0124] One or more embodiments of the present application provide a knowledge question-answering method that helps a question-answering system accurately understand user intent by extracting time information and a first keyword from a first question, thereby making the generated answer information more tailored to user needs and reducing the possibility of misunderstandings and incorrect answers. A temporal knowledge graph is used to store knowledge information and its effective time. The first knowledge information obtained from the temporal knowledge graph based on the time information and the first keyword has high timeliness and strong relevance, which means that no matter what type of question the first question is, the question-answering system can provide the latest and most relevant information. Furthermore, the first question and the first knowledge information are concatenated and input into a large language model, which can fully utilize the semantic understanding and generation capabilities of the large language model to generate first context information. The first context information effectively integrates the first knowledge information, has coherence and readability, and can be used to answer the first question, providing reliable data support for improving the accuracy of the answer. Finally, the first knowledge information and the first context information are fused to obtain the first answer information for the first question. This not only improves the accuracy of the answer, but also ensures the readability and coherence of the first answer information, allowing users to easily understand complex information and understand the source and basis of the first knowledge information while obtaining it.

[0125] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] Based on the same inventive concept, this embodiment of the application also provides a knowledge question answering device. Figure 4 , is a structural diagram of a knowledge question and answer device 400 provided in an embodiment of the present application. The device 400 includes: an extraction module 410, a first acquisition module 420, a generation module 430 and a fusion module 440.

[0127] The extraction module 410 is configured to extract the time information and the first keyword from the first question.

[0128] The first acquisition module 420 is used to acquire first knowledge information corresponding to the first question from the temporal knowledge graph based on the time information and the first keyword.

[0129] The generation module 430 is used to splice the first question and the first knowledge information and input them into a large language model to obtain first context information of the first knowledge information.

[0130] The fusion module 440 is configured to fuse the first context information and the first knowledge information to obtain first answer information for the first question.

[0131] In another embodiment, the extraction module performs the following steps when extracting the time information from the first question: Encode the words in the first question to obtain word vectors for the words; predicting, based on the word vector of the word, a first probability that the word belongs to a first part of a first entity and a second probability that the word belongs to a second part of the first entity, where the first entity is an entity of type time; Time information in the first question is determined based on a first word in the first question having a first probability greater than a probability threshold and a second word in the first question having a second probability greater than the probability threshold.

[0132] In another embodiment, the temporal knowledge graph includes knowledge information and the effective time of the knowledge information, the knowledge information includes entities and the relationships between the entities; the time information includes a first time range; The first acquisition module is used for: Performing named entity recognition on the first keyword to obtain a second entity in the first keyword; Acquire second knowledge information from the time-series knowledge graph, wherein a third entity included in the second knowledge information matches the second entity, and the validity period of the second knowledge information is within the first time range; Determine that the second knowledge information is the first knowledge information corresponding to the first question.

[0133] In another embodiment, the fusion module is configured to: Embedding the first context information to obtain a first vector; Embedding the first knowledge information to obtain a second vector; performing weighted processing on the first vector and the second vector based on a first weight of the first vector and a second weight of the second vector to obtain a third vector; The third vector is decoded to obtain first response information for the first question.

[0134] In another embodiment, the knowledge question answering device further includes: a second acquisition module and an adjustment module; The second obtaining module is configured to obtain first feedback information regarding the first question; The adjustment module is configured to adjust the first weight to obtain a third weight, and adjust the second weight to obtain a fourth weight based on the first feedback information; The fusion module is further configured to perform weighted processing on the first vector and the second vector based on the third weight and the fourth weight to obtain a fourth vector, and to decode the fourth vector to obtain second response information for the first question.

[0135] In another embodiment, when the adjustment module adjusts the first weight to obtain a third weight and adjusts the second weight to obtain a fourth weight based on the first feedback information, the adjustment module performs the following steps: Determining, based on the first feedback information, a first score of the first response information, a first adjustment method corresponding to the first weight, and a second adjustment method corresponding to the second weight; determining a second score of the first response information based on second feedback information of the first question, where the second feedback information is feedback information obtained before the first feedback information; Determining, based on the first score and the second score, a first adjustment range corresponding to the first weight and a second adjustment range corresponding to the second weight; Adjusting the first weight based on the first adjustment method and the first adjustment range to obtain a third weight; Based on the second adjustment method and the second adjustment range, the second weight is adjusted to obtain a fourth weight.

[0136] In another embodiment, the adjustment module performs the following steps when determining the first adjustment method corresponding to the first weight and the second adjustment method corresponding to the second weight: determining, from the first feedback information, third feedback information for the first context information and fourth feedback information for the first knowledge information; Performing emotion classification on the third feedback information to obtain a first emotion category, and determining a first adjustment method corresponding to the first weight based on the first emotion category; Performing emotion classification on the fourth feedback information to obtain a second emotion category, and determining a second adjustment method corresponding to the second weight based on the second emotion category.

[0137] In another embodiment, the first score of the first response information includes the first score of the first context information and the first score of the first knowledge information, and the second score includes the second score of the first context information and the second score of the first knowledge information; When the adjustment module determines a first adjustment range corresponding to the first weight and a second adjustment range corresponding to the second weight based on the first score and the second score, the adjustment module performs the following steps: determining a first coefficient of the first weight based on a mean and a standard deviation of the first scores of the first context information; determining a second coefficient of the second weight based on a mean and a standard deviation of the first scores of the first knowledge information; determining a sum of a first score of the first context information and a second score of the first context information to obtain a third score, and obtaining a first adjustment magnitude of the first weight based on a product of the third score and the first coefficient; Determine the sum of the first score of the first knowledge information and the second score of the first knowledge information to obtain a fourth score, and obtain a second adjustment range of the second weight based on the product of the fourth score and the second coefficient.

[0138] Obviously, the knowledge question answering device 400 provided in the embodiment of the present application can be used as the above Figure 2 The execution subject of the knowledge question answering method shown in FIG can realize the knowledge question answering device in Figure 2 Since the principle is the same, the functions realized will not be described in detail.

[0139] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 At the hardware level, the electronic device includes a processor and, optionally, an internal bus, a network interface, and memory. The memory may include internal memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its services.

[0140] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0141] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.

[0142] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a knowledge question-answering device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: Extracting time information and the first keyword from the first question; Based on the time information and the first keyword, obtaining first knowledge information corresponding to the first question from a time series knowledge graph; splicing the first question and the first knowledge information and inputting the resultant information into a large language model to obtain first context information of the first knowledge information; The first context information and the first knowledge information are integrated to obtain first answer information for the first question.

[0143] The above application Figure 2The methods performed by the knowledge question-answering device disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be performed by hardware integrated logic circuits within the processor or by software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0144] The electronic device may also perform Figure 2 Method, and realize the knowledge question answering device in Figure 2 、 Figure 3 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0145] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0146] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, can enable the electronic device to execute Figure 2 The method of the embodiment shown is specifically used to perform the following operations: Extracting time information and the first keyword from the first question; Based on the time information and the first keyword, obtaining first knowledge information corresponding to the first question from a time series knowledge graph; splicing the first question and the first knowledge information and inputting the resultant information into a large language model to obtain first context information of the first knowledge information; The first context information and the first knowledge information are integrated to obtain first answer information for the first question.

[0147] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps in the knowledge question and answer method provided in the embodiment of the present application.

[0148] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

[0149] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0150] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0151] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0152] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

Claims

1. A knowledge question answering method, characterized in that: include: Extracting time information and the first keyword from the first question; Based on the time information and the first keyword, obtaining first knowledge information corresponding to the first question from a time series knowledge graph; splicing the first question and the first knowledge information and inputting the resultant information into a large language model to obtain first context information of the first knowledge information; The first context information and the first knowledge information are integrated to obtain first answer information for the first question.

2. The method according to claim 1, characterized in that Extract the time information from the first question, including: Encode the words in the first question to obtain word vectors for the words; predicting, based on the word vector of the word, a first probability that the word belongs to a first part of a first entity and a second probability that the word belongs to a second part of the first entity, where the first entity is an entity of type time; Time information in the first question is determined based on a first word in the first question having a first probability greater than a probability threshold and a second word in the first question having a second probability greater than the probability threshold.

3. The method according to claim 1, characterized in that The temporal knowledge graph includes knowledge information and the effective time of the knowledge information, the knowledge information includes entities and the relationships between the entities; the time information includes a first time range; The acquiring, based on the time information and the first keyword, first knowledge information corresponding to the first question from the time series knowledge graph includes: Performing named entity recognition on the first keyword to obtain a second entity in the first keyword; Acquire second knowledge information from the time-series knowledge graph, wherein a third entity included in the second knowledge information matches the second entity, and the validity period of the second knowledge information is within the first time range; Determine that the second knowledge information is the first knowledge information corresponding to the first question.

4. The method according to claim 1, wherein The fusing the first context information and the first knowledge information to obtain first answer information for the first question includes: Embedding the first context information to obtain a first vector; Embedding the first knowledge information to obtain a second vector; performing weighted processing on the first vector and the second vector based on a first weight of the first vector and a second weight of the second vector to obtain a third vector; The third vector is decoded to obtain first response information for the first question.

5. The method according to claim 4, characterized in that After fusing the first context information and the first knowledge information to obtain first answer information for the first question, the method further includes: Obtaining first feedback information regarding the first question; Based on the first feedback information, adjusting the first weight to obtain a third weight, and adjusting the second weight to obtain a fourth weight; Performing weighted processing on the first vector and the second vector based on the third weight and the fourth weight to obtain a fourth vector; The fourth vector is decoded to obtain second response information for the first question.

6. The method according to claim 5, characterized in that The adjusting the first weight to obtain a third weight based on the first feedback information, and adjusting the second weight to obtain a fourth weight, includes: Determining, based on the first feedback information, a first score of the first response information, a first adjustment method corresponding to the first weight, and a second adjustment method corresponding to the second weight; determining a second score of the first response information based on second feedback information of the first question, where the second feedback information is feedback information obtained before the first feedback information; Determining, based on the first score and the second score, a first adjustment range corresponding to the first weight and a second adjustment range corresponding to the second weight; Adjusting the first weight based on the first adjustment method and the first adjustment range to obtain a third weight; Based on the second adjustment method and the second adjustment range, the second weight is adjusted to obtain a fourth weight.

7. The method according to claim 6, characterized in that Determining a first adjustment method corresponding to the first weight and a second adjustment method corresponding to the second weight includes: determining, from the first feedback information, third feedback information for the first context information and fourth feedback information for the first knowledge information; Performing emotion classification on the third feedback information to obtain a first emotion category, and determining a first adjustment method corresponding to the first weight based on the first emotion category; Performing emotion classification on the fourth feedback information to obtain a second emotion category, and determining a second adjustment method corresponding to the second weight based on the second emotion category.

8. The method according to claim 6, characterized in that The first score of the first response information includes a first score of the first context information and a first score of the first knowledge information, and the second score includes a second score of the first context information and a second score of the first knowledge information; The determining, based on the first score and the second score, a first adjustment range corresponding to the first weight and a second adjustment range corresponding to the second weight includes: determining a first coefficient of the first weight based on a mean and a standard deviation of the first scores of the first context information; determining a second coefficient of the second weight based on a mean and a standard deviation of the first scores of the first knowledge information; determining a sum of a first score of the first context information and a second score of the first context information to obtain a third score, and obtaining a first adjustment magnitude of the first weight based on a product of the third score and the first coefficient; Determine the sum of the first score of the first knowledge information and the second score of the first knowledge information to obtain a fourth score, and obtain a second adjustment range of the second weight based on the product of the fourth score and the second coefficient.

9. A knowledge question-answering device, characterized in that: include: an extraction module, configured to extract time information and a first keyword from the first question; A first acquisition module, configured to acquire first knowledge information corresponding to the first question from a time series knowledge graph based on the time information and the first keyword; a generation module, configured to concatenate the first question and the first knowledge information and input the concatenated information into a large language model to obtain first context information of the first knowledge information; A fusion module is used to fuse the first context information and the first knowledge information to obtain first answer information for the first question.

10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the knowledge question answering method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the knowledge question answering method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps in the knowledge question answering method according to any one of claims 1 to 8.