Question and answer processing method and device
By building a multimodal knowledge graph in the Q&A system and generating target Q&A pairs, the traditional Q&A method solves the problem of poor answering accuracy when dealing with natural language, and achieves more efficient and personalized Q&A services.
Patent Information
- Application Number
- CN202411553266.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-11-01
AI Technical Summary
Traditional question-and-answer methods are difficult to dig deep into the complex semantic relationships and contextual information behind the text when dealing with natural language, resulting in unsatisfactory answer accuracy and difficult to adapt to dynamic changes in knowledge and user preferences.
By obtaining multimodal data in the target field, knowledge fusion is carried out according to the weights of different modes, a target knowledge graph is constructed, and a target Q&A pair is generated based on this, responding to the user's Q&A request to determine the target answer.
It improves the accuracy and efficiency of the Q&A system, enhances the personalization and adaptability of Q&A, and can better understand user intentions and explore user preferences.
Smart Images

Figure CN119494392A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a question-answering processing method and device. Background Art
[0002] With the explosive growth of information, traditional question-answering methods based on content and collaborative filtering are unable to cope with large amounts of information. The methods provided in related technologies are difficult to accurately filter out the information that users really need from massive amounts of information, resulting in information overload. At the same time, due to the sparsity of data, there is often a lack of sufficient basis for result recommendation, making the recommendation results fail to meet the actual needs of technical personnel in this field. In addition, traditional question-answering methods can only understand surface text information when processing natural language, and it is difficult to deeply explore the complex semantic relationships and contextual information behind the text, resulting in limitations in understanding user intentions and mining user preferences. These methods cannot meet users' needs for personalized recommendations, are difficult to adapt to the dynamic changes in knowledge and user preferences, and have the problem of unsatisfactory accuracy in providing answers.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a question and answer processing method and device to at least solve the technical problem of unsatisfactory question and answer accuracy existing in the related art.
[0005] According to one aspect of an embodiment of the present application, a question and answer processing method is provided, comprising: acquiring target data of a target domain, wherein a modality of the target data is included in a plurality of predetermined modalities; performing knowledge fusion on the target data according to modality weights corresponding to the plurality of predetermined modalities, and constructing a target knowledge graph corresponding to the target domain; generating a plurality of target question and answer pairs in the target domain based on the target knowledge graph and a plurality of initial question and answer pairs, wherein the plurality of initial question and answer pairs are obtained based on historical questions in the target domain, and historical answers corresponding to the historical questions; and determining, in response to a question and answer request for the target domain, a target answer corresponding to the question and answer request based on the plurality of target question and answer pairs.
[0006] Optionally, generating multiple target question and answer pairs for the target domain based on the target knowledge graph includes: for a first question and answer pair among the multiple initial question and answer pairs, when a historical question included in the first question and answer pair corresponds to multiple historical answers, processing based on the target knowledge graph to determine behavioral preference information of the target domain; determining preference weights corresponding to the multiple historical answers respectively based on the behavioral preference information; updating the first question and answer pair according to the historical questions, the multiple historical answers, and the preference weights corresponding to the multiple historical answers respectively, to obtain a target question and answer pair corresponding to the first question and answer pair; and obtaining the multiple target question and answer pairs based on the multiple initial question and answer pairs by adopting a method of obtaining a target question and answer pair based on the update of the first question and answer pair.
[0007] Optionally, the target knowledge graph includes entities, relationships, and attributes, wherein the relationships represent the interactions between multiple entities and the attributes represent the properties of the entities. Processing is performed based on the target knowledge graph to determine the behavioral preference information of the target domain, including: obtaining historical behavioral data of the target domain; based on the historical behavioral data, performing interaction analysis on the relationships and entities to determine the preference pattern of the target domain; performing path analysis based on the entities, the relationships, and the attributes to determine the association relationships of the target domain; and determining the behavioral preference information based on the preference pattern and the association relationships.
[0008] Optionally, determining the preference weights corresponding to the multiple historical answers respectively based on the behavioral preference information includes: determining an initial preference model, wherein the preference model adopts a predetermined loss function, and the predetermined loss function is used to enhance the weight of the preferred answer and reduce the weight of the non-preferred answer; using the behavioral preference information to update the predetermined loss function to obtain an updated loss function; based on the updated loss function, obtaining an updated preference model; using the updated preference model to process the multiple historical answers to determine the preference weights corresponding to the multiple historical answers respectively.
[0009] Optionally, in response to a question and answer request for the target domain, a target answer corresponding to the question and answer request is determined based on the multiple target question and answer pairs, including: determining a request question that matches the question and answer request among the target questions corresponding to the multiple target question and answer pairs; when there are multiple candidate answers corresponding to the request question, determining the target answer among the multiple candidate answers according to the preference weights corresponding to the multiple candidate answers; or, determining a predetermined number of candidate answers among the multiple candidate answers according to the preference weights corresponding to the multiple candidate answers; and obtaining the target answer by combining the predetermined number of candidate answers.
[0010] Optionally, the target data is subjected to knowledge fusion according to the modal weights corresponding to the multiple predetermined modalities to construct a target knowledge graph corresponding to the target field, including: when the modality of the target data includes text modality and image modality, a feature embedding method is used to process the target data to obtain text features; a convolutional neural network is used to process the target data to obtain image features; and knowledge fusion is performed based on the text features, the modal weights corresponding to the text modality, the image features, and the modal weights corresponding to the image modality to obtain the target knowledge graph.
[0011] Optionally, acquiring the target data in the target field includes: extracting based on the data source of the target field to obtain structured data, semi-structured data, and unstructured data, wherein the structured data is data according to a preset organizational structure, the semi-structured data is data that dynamically changes according to a predetermined structure, and the unstructured data is multimodal data in multiple data formats; preprocessing is performed based on the structured data, the semi-structured data, and the unstructured data to obtain the target data, wherein the preprocessing includes cleaning processing and / or conversion processing.
[0012] Optionally, the target data is subjected to knowledge fusion according to the modal weights respectively corresponding to the multiple predetermined modalities to construct a target knowledge graph corresponding to the target field, including: in the case of the structured data included in the target data, the target data is extracted to determine entities, relationships, and attributes, wherein the attributes are used to represent the properties of the entities, and the relationships are used to represent the interactions between multiple entities; and the target knowledge graph is determined by using a weighted average method to perform knowledge fusion based on the entities, the relationships, the attributes, and the modal weights respectively corresponding to the multiple predetermined modalities.
[0013] Optionally, the target data is subjected to knowledge fusion according to the modal weights respectively corresponding to the multiple predetermined modalities to construct a target knowledge graph corresponding to the target domain, including: when the target data includes semi-structured and / or structured data, the target data is extracted to determine entities; semantic features are determined based on the entities; attributes are determined based on the feature categories of the semantic features, wherein the attributes are used to represent the properties of the entities; relationships are determined based on the grammatical structure and contextual information included in the semantic features using a natural language processing method, wherein the relationships are used to represent the interactions between multiple entities; and knowledge fusion is performed based on the entities, the relationships, the attributes, and the modal weights respectively corresponding to the multiple predetermined modalities using a weighted average method to determine the target knowledge graph.
[0014] According to another aspect of an embodiment of the present application, a question and answer processing device is provided, including: a data acquisition module, used to acquire target data of a target domain, wherein the modality of the target data is included in multiple predetermined modalities; a graph module, used to perform knowledge fusion on the target data according to the modality weights corresponding to the multiple predetermined modalities, and construct a target knowledge graph corresponding to the target domain; a question and answer pair generation module, used to generate multiple target question and answer pairs in the target domain based on the target knowledge graph and multiple initial question and answer pairs, wherein the multiple initial question and answer pairs are obtained based on historical questions in the target domain and historical answers corresponding to the historical questions; an answer module, used to respond to a question and answer request for the target domain, and determine a target answer corresponding to the question and answer request based on the multiple target question and answer pairs.
[0015] In an embodiment of the present application, an adaptive question-answer processing method based on a knowledge graph is adopted, by obtaining target data of a target domain, wherein the modality of the target data is included in a plurality of predetermined modalities; performing knowledge fusion on the target data according to the modality weights corresponding to the plurality of predetermined modalities, and constructing a target knowledge graph corresponding to the target domain; generating a plurality of target question-answer pairs of the target domain based on the target knowledge graph and a plurality of initial question-answer pairs, wherein the plurality of initial question-answer pairs are obtained based on historical questions of the target domain and historical answers corresponding to the historical questions; in response to a question-answer request for the target domain, determining a target answer corresponding to the question-answer request based on the plurality of target question-answer pairs. The purpose of improving the accuracy of the answers of the question-answer system is achieved, and the technical effect of performing knowledge fusion and question-answer generation by focusing on data of different modalities in a specific domain is realized, thereby solving the technical problem of unsatisfactory question-answer accuracy existing in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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:
[0017] Figure 1 is a flowchart of an optional question-answering processing method provided according to an embodiment of the present application;
[0018] Figure 2 is a diagrammatic diagram of an optional question-answering processing method provided according to an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of a question-and-answer interface of an optional question-and-answer processing method provided according to an embodiment of the present application;
[0020] Figure 4It is a flowchart of an optional question-and-answer processing method provided according to an embodiment of the present application;
[0021] Figure 5 It is a principle block diagram of an optional question-answer processing method provided according to an embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of an optional question and answer processing device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] According to an embodiment of the present application, an embodiment of a method for question and answer processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] Figure 1 is a flowchart of an optional question-answering processing method provided according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0027] Step S102, acquiring target data in a target field, wherein the modality of the target data is included in the plurality of predetermined modalities;
[0028] It can be understood that the target field to be processed (such as power construction field, defect detection field, etc.) is determined, and then the relevant data in the field is collected as the target data, which can come from a variety of different sources, such as databases, documents, images, videos, etc., which together constitute the knowledge base of the target field. By collecting data in the target field, comprehensive knowledge information in the field can be obtained, providing necessary data support for the subsequent knowledge graph construction and question-answering system generation.
[0029] In an optional embodiment, target data in a target domain is obtained, including: extracting based on a data source of the target domain to obtain structured data, semi-structured data, and unstructured data, wherein structured data is data according to a preset organizational structure, semi-structured data is data that dynamically changes according to a predetermined structure, and unstructured data is multimodal data in multiple data formats; preprocessing is performed based on the structured data, semi-structured data, and unstructured data to obtain target data, wherein the preprocessing includes cleaning processing and / or conversion processing.
[0030] It can be understood that according to the characteristics of the target field, data is extracted from the corresponding data source, including structured data, semi-structured data and unstructured data. Structured data is usually stored according to a preset organizational structure, such as data in a relational database, and semi-structured data is data that is stored according to a predetermined structure but has dynamic changes, such as data in XML or JSON format; unstructured data refers to data without a fixed structure, such as text, images, audio, video, etc., which may exist in multiple data formats and constitute multimodal data. After the raw data is extracted, preprocessing operations can be performed, and the data can be cleaned and converted according to the requirements, so that knowledge fusion and knowledge graph construction can be carried out more effectively in the future. Through the above processing, by distinguishing structured, semi-structured and unstructured data, and performing corresponding preprocessing according to different data types, the accuracy and availability of the data can be ensured, and the data support that can be obtained can be provided for the subsequent knowledge graph construction and question-answering system generation.
[0031] Optionally, cleaning processing may include removing duplicate data, correcting erroneous data, filling missing values, etc., and conversion processing may include data format conversion, data normalization or standardization, etc. Through data cleaning and conversion processing, noise and errors in the original data can be removed to improve the accuracy and reliability of the data. Special preprocessing operations can also be performed for different types of data to optimize the data processing process and improve data processing efficiency.
[0032] In an optional embodiment, knowledge fusion is performed on the target data according to the modal weights corresponding to multiple predetermined modalities to construct a target knowledge graph corresponding to the target field, including: in the case of structured data included in the target data, the target data is extracted to determine entities, relationships, and attributes, wherein attributes are used to represent the properties of entities and relationships are used to represent the interactions between multiple entities; and a weighted average method is used to perform knowledge fusion based on entities, relationships, attributes, and modal weights corresponding to multiple predetermined modalities to determine the target knowledge graph.
[0033] It can be understood that in order to construct the knowledge graph corresponding to a specific field, a method based on multimodal data fusion is adopted. If the acquired data contains structured information, the structured information includes key elements such as entities, relationships and attributes. Entities represent the basic building blocks in the knowledge graph and are objects with clear characteristics and identities. Relationships reveal the interactions and connections between multiple entities; and attributes are used to describe the specific characteristics or signs of entities. In the data processing stage, these entities, relationships and attributes are identified and extracted from the acquired data, and natural language processing technology, rule matching and other means can be used. Since the acquired data may come from multiple modalities (such as text, images, sounds, etc.), and each modality has its value and importance in constructing the knowledge graph. Therefore, a corresponding modal weight is assigned to each modality, and the modal weight can be adjusted according to specific application requirements and scenarios, thereby reflecting the importance of different modalities in the construction process. In the fusion process, a weighted average strategy is adopted. Combining each entity, relationship, and attribute with the weight of its corresponding modality and aggregating the results under all modalities not only integrates the rich information in multimodal data, but also reasonably balances the importance of information through the introduction of weights, thereby ensuring the accuracy and completeness of the knowledge graph.
[0034] It should be noted that by integrating data from multiple modalities, various information sources can be fully utilized, thereby reducing the errors that may be caused by missing information or a single data source. At the same time, by assigning specific modal weights to each modality, the fusion of multimodal data brings richer information to the knowledge graph, which is not limited to text data, but also includes image features, sound features, etc., providing more comprehensive and richer content for the construction of the knowledge graph. By applying the knowledge graph construction to multiple fields, adjusting the data source and modal weight according to the characteristics and needs of specific fields, strong adaptability and flexibility can be achieved.
[0035] In an optional embodiment, knowledge fusion is performed on the target data according to the modal weights corresponding to multiple predetermined modalities to construct a target knowledge graph corresponding to the target field, including: when the target data includes semi-structured and / or structured data, the target data is extracted to determine entities; semantic features are determined based on the entities; attributes are determined based on the feature categories of the semantic features, wherein the attributes are used to represent the properties of the entities; relationships are determined based on the grammatical structure and contextual information included in the semantic features using natural language processing, wherein the relationships are used to represent the interactions between multiple entities; and knowledge fusion is performed based on entities, relationships, attributes, and the modal weights corresponding to multiple predetermined modalities using a weighted average method to determine the target knowledge graph.
[0036] It can be understood that for the processing of semi-structured and / or structured data, entities are extracted from the target data, and the above entities are the basic elements of the knowledge graph. Subsequently, based on the extracted entities, the semantic features of the entities are further analyzed and determined. The above semantic features are a detailed description of the meaning of the entities in the knowledge field. The attributes of the entity are determined according to the feature categories of the semantic features. The attributes are metadata that describe the properties of the entity. After the attributes and entities are determined, the grammatical structure and contextual information in the semantic features are analyzed using natural language processing technology to determine the relationship between multiple entities. The relationship represents the interaction and connection between entities and is the connecting link in the knowledge graph. The weighted average method is used to combine the modal weights corresponding to multiple predetermined modalities to perform knowledge fusion on entities, relationships, and attributes. This step comprehensively considers the importance of different modal data and ensures the accuracy and comprehensiveness of the knowledge graph finally constructed.
[0037] Step S104, performing knowledge fusion on the target data according to the modality weights corresponding to the plurality of predetermined modalities, and constructing a target knowledge graph corresponding to the target domain;
[0038] It can be understood that after the target data is acquired, it is processed separately according to the different modalities of the data (such as text, image, video, etc.). Each modality corresponds to a modal weight, which reflects the importance of the modality in the knowledge graph. According to the modal weight, the target data is fused to construct a structured target knowledge graph for the target field. By performing modal weighted fusion on the target data, the knowledge structure and characteristics of the target field can be more accurately reflected. At the same time, since the importance of different modalities is taken into account, the constructed knowledge graph is more in line with the needs of practical applications, which improves the accuracy and efficiency of the question-answering system.
[0039] Optionally, Figure 2It is a diagrammatic illustration of an optional question-and-answer processing method provided according to an embodiment of the present application. A diagram is established for the field of power construction, which includes multiple entities such as construction safety specifications, defect detection, power calculation methods, etc. Arrows represent relationships. The specific content in the diagram is for illustration only and can be set according to specific needs.
[0040] In an optional embodiment, knowledge fusion is performed on the target data according to the modal weights corresponding to multiple predetermined modalities to construct a target knowledge graph corresponding to the target field, including: when the modality of the target data includes text modality and image modality, a feature embedding method is used to process the target data to obtain text features; a convolutional neural network is used to process the target data to obtain image features; and knowledge fusion is performed based on the text features, the modal weights corresponding to the text modality, the image features, and the modal weights corresponding to the image modality to obtain the target knowledge graph.
[0041] It can be understood that different technical strategies are used to extract and fuse information for multimodal data such as text modalities and image modalities. For text modal data, feature embedding is used for processing. Feature embedding is a method of converting text data into numerical representation, making it easier for programs to process and understand text information. Through feature embedding, key information in the text, such as keywords, phrases or sentences, can be extracted and converted into calculable feature vectors, namely text features. For image modal data, convolutional neural network (CNN) is used for processing, which can automatically extract feature information in the image, such as edges, textures, shapes, etc., and convert these feature information into image features. After obtaining text features and image features, knowledge fusion is performed according to the modal weights corresponding to the text modality and image modality respectively. Through weighted averaging, the text features and image features are combined to form a knowledge graph that integrates multimodal information.
[0042] By processing text and image data simultaneously, we can more accurately extract key information from text and images and integrate it into the knowledge graph, making full use of the rich information in multimodal data. This can not only improve the accuracy and completeness of the knowledge graph, but also provide more dimensions and details for the knowledge graph.
[0043] Optionally, when performing knowledge fusion, considering that the importance of different modal knowledge in the question-answering system is inconsistent in multimodal knowledge, a soft attention mechanism (SoftAttention) is used to calculate the weight of each modality according to the importance and relevance of different modalities, and the modal features are weighted averaged and fused. The convolutional neural network can set intermediate layers and hidden layers, use sigmoid activation functions and weight matrices to learn and represent high-level features of the data, and generate the final fusion features. Among them, a suitable loss function is used for back propagation and parameter update of the neural network model. After the multimodal knowledge is fused, it is mapped based on the traditional triple trans model to construct a knowledge graph for power construction questions and answers.
[0044] Step S106, generating multiple target question-answer pairs in the target field based on the target knowledge graph and the multiple initial question-answer pairs, wherein the multiple initial question-answer pairs are obtained based on historical questions in the target field and historical answers corresponding to the historical questions;
[0045] It can be understood that after the target knowledge graph is constructed, the target knowledge graph and the existing initial question-answer pairs are used to generate new target question-answer pairs. The target question-answer pairs will serve as the core resource of the question-answering system to answer users' questions. By generating new target question-answer pairs based on the target knowledge graph and the initial question-answer pairs, the coverage of the question-answering system can be automatically expanded and the answer quality can be improved, making the question-answering system more comprehensive, accurate and practical.
[0046] Step S108, in response to a question and answer request for a target domain, determining a target answer corresponding to the question and answer request based on a plurality of target question and answer pairs.
[0047] It can be understood that when a user asks the system a question about the target field, the system matches and infers the user's question with the existing target question-answer pairs, thereby finding the target answer that best matches the question and returning it to the user. Through the above processing, accurate and practical answers can be provided quickly. The question-answer method based on the knowledge graph not only improves the accuracy and efficiency of the answers, but also enhances the explainability and maintainability of the questions and answers. At the same time, since the question-answer pairs are generated based on the knowledge graph of the target field, they can better understand and deal with the user's questions in a targeted manner, which helps to provide more personalized services.
[0048] Optionally, Figure 3 is a schematic diagram of a question-and-answer interface of an optional question-and-answer processing method provided in an embodiment of the present application, such as Figure 3As shown in the figure, the Q&A interface is only a schematic method. By entering the question "What aspects should be paid attention to in the safety inspection of personnel at the power construction site", the target answer can be obtained, including personal protective equipment inspection and electrical safety inspection related content. According to the specific answer of the target answer, feedback opinions such as "recommended", "average", and "poor" can be fed back, which helps to improve the efficiency of model optimization. You can also set a "tell me more" feedback component to interact with this component to obtain more content related to the request question and improve the efficiency of question and answer.
[0049] In an optional embodiment, multiple target question-answer pairs in a target domain are generated based on a target knowledge graph, including: for a first question-answer pair among multiple initial question-answer pairs, when a historical question included in the first question-answer pair corresponds to multiple historical answers, processing is performed based on the target knowledge graph to determine behavioral preference information of the target domain; based on the behavioral preference information, preference weights corresponding to the multiple historical answers are determined; according to the historical questions, the multiple historical answers, and the preference weights corresponding to the multiple historical answers, the first question-answer pair is updated to obtain a target question-answer pair corresponding to the first question-answer pair; multiple target question-answer pairs are obtained based on multiple initial question-answer pairs by adopting a method of obtaining a target question-answer pair based on the update of the first question-answer pair.
[0050] It can be understood that when processing an initial question-answer pair, if the question has multiple different answers in the historical data, the system will use the constructed target knowledge graph to analyze and determine the behavioral preference information in the target field. Behavioral preference information can include the preferences, tendencies or trends of user groups for a certain question or topic. Based on the behavioral preference information, a preference weight is assigned to each historical answer. The preference weight represents the degree of match or importance of the answer to the behavioral preference of the target field. Based on the historical questions, multiple historical answers and their respective preference weights, the initial question-answer pair is updated to generate a target question-answer pair that better matches the behavioral preference of the target field.
[0051] By introducing the target knowledge graph and behavioral preference information, we can more accurately grasp the real needs and expected answers of users for questions in the target field, which helps to generate question-answer pairs that are more relevant and accurate to the target field, and then provide answers that are more in line with user expectations, thereby optimizing the user experience and enhancing the intelligence and adaptability of the system.
[0052] In an optional embodiment, the target knowledge graph includes entities, relationships, and attributes, wherein relationships represent interactions between multiple entities and attributes represent properties of entities. Processing is performed based on the target knowledge graph to determine behavioral preference information in the target domain, including: obtaining historical behavioral data of the target domain; performing interaction analysis on relationships and entities based on the historical behavioral data to determine preference patterns in the target domain; performing path analysis based on entities, relationships, and attributes to determine association relationships in the target domain; and determining behavioral preference information based on preference patterns and association relationships.
[0053] It can be understood that historical behavior data of the target domain will be collected to record various operations and behaviors of users or systems within a specific time, such as the processing records of users performing power maintenance, the search history of keywords related to power safety protection, etc. Based on the collected historical behavior data, the relationships and entities in the target knowledge graph are interactively analyzed to determine the interactions between different entities and the specific patterns or trends formed, which helps to understand the user or system preferences in the target domain. Path analysis is performed on the entities, relationships, and attributes in the target knowledge graph. Path analysis identifies the associations between different entities and attributes by tracing the connection paths in the knowledge graph, which is conducive to a deeper understanding of the structure and internal laws of the target domain. Based on the results of interaction analysis and path analysis, combined with the specific needs and background knowledge of the target domain, the behavioral preference information in the domain is determined, including user preferences for specific products or services, operating trends or potential risks of the power system, etc.
[0054] By using the target knowledge graph for interaction analysis and path analysis, we can explore the inherent laws and knowledge structure of the target domain, which helps to determine the characteristics and needs of the entities included in the target domain.
[0055] In an optional embodiment, preference weights corresponding to multiple historical answers are determined based on behavioral preference information, including: determining an initial preference model, wherein the preference model uses a predetermined loss function, and the predetermined loss function is used to enhance the weight of the preferred answer and reduce the weight of the non-preferred answer; using the behavioral preference information to update the predetermined loss function to obtain an updated loss function; based on the updated loss function, an updated preference model is obtained; using the updated preference model to process multiple historical answers to determine the preference weights corresponding to the multiple historical answers.
[0056] It can be understood that an initial preference model is determined and a predetermined loss function is used to enhance the weights of answers that match the behavioral preferences (i.e., preferred answers) and reduce the weights of answers that do not match the behavioral preferences (i.e., non-preferred answers). The predetermined loss function is updated using behavioral preference information so that the loss function is more consistent with the actual preferences of the target domain, thereby more accurately evaluating the quality of the answer. Based on the updated loss function, an updated updated preference model can be obtained. The updated preference model can more accurately reflect the preferences of the target domain and provide feedback on the answers accordingly. Use the updated preference model to process multiple historical answers and assign a preference weight to each answer based on the degree of match between the answer and the behavioral preference. It reflects the preference level of the answer in the target domain and provides weight support for subsequent question-answer pair generation and recommendation.
[0057] By introducing behavioral preference information and updating the loss function, we can ensure that the preference model reflects the preferences of the target field more accurately. When determining the preference weights of historical answers, we can more accurately evaluate the degree of match between answers and behavioral preferences, thereby improving the accuracy of weight allocation. And because the updated preference model is determined based on the actual preferences of the target field, it improves adaptability to the target field.
[0058] Optionally, when the preference situation in the target domain changes, it is necessary to re-collect the behavior preference information and update the loss function, and update the preference model again to adapt to the new preference situation.
[0059] Optionally, a preference model is constructed using the user's historical behavior and preference data, and the reasoning and association analysis capabilities of the graph are used to discover hidden associations and user preference patterns. After debugging, a language answer style that conforms to the normal word order is obtained, thereby providing more accurate and diverse recommendation results.
[0060] Manually collect and annotate initial question-answer pairs with expert experience in power construction, and optimize the model L through autoregressive loss after template packaging. a (i.e. the above preference model) for optimization, which can be characterized by:
[0061]
[0062] Among them, a i is the ith answer marked, q i is the ith question marked; a i,j is the jth answer to the ith question marked; P M is the probability predicted by model M; I is the packaging template of the question-answer pair.
[0063] At the same time, a preferred answer set is designed, and a preference weight is designed for each answer in the question-answer pair. A higher weight indicates that the answer is more in line with the requirements of personnel in the power construction field. Combining the model M and the preference set, a preference loss function L is designed p (i.e., the above loss function) aims to enhance the weight of preferred answers and reduce the probability of non-preferred answers. Therefore, the overall loss function L for model training is loss Expressed as: L loss =L a +L p .
[0064] In an optional embodiment, in response to a question and answer request for a target domain, a target answer corresponding to the question and answer request is determined based on multiple target question and answer pairs, including: determining a request question that matches the question and answer request among the target questions corresponding to the multiple target question and answer pairs; when there are multiple candidate answers corresponding to the request question, determining the target answer among the multiple candidate answers according to the preference weights corresponding to the multiple candidate answers; or determining a predetermined number of candidate answers among the multiple candidate answers according to the preference weights corresponding to the multiple candidate answers; and obtaining the target answer by combining the predetermined number of candidate answers.
[0065] It can be understood that among the target questions corresponding to multiple target question-answer pairs, a request question that matches the question in the current question-answer request is searched. If there is only one candidate answer corresponding to the request question, then this candidate answer becomes the target answer. If there are multiple candidate answers corresponding to the request question, the target answer is determined based on the preference weights of these candidate answers. The candidate answers are sorted from high to low according to the preference weights, and the answer with the highest weight is selected as the target answer. A combined answer containing multiple answers can be provided as the target answer. At this time, the system can select a predetermined number of answers with higher weights according to the preference weights of the candidate answers, and combine these answers to form a comprehensive target answer. This combined answer may be more comprehensive and accurate, and can better meet the needs of users.
[0066] Optionally, natural language processing (NLP) technology, such as text similarity calculation, can be used to ensure that the target question that is most similar or identical to the request question can be accurately found.
[0067] Through the above step S102, the target data of the target field is obtained, wherein the modality of the target data is included in the multiple predetermined modalities; step S104, according to the modal weights corresponding to the multiple predetermined modalities, the target data is fused with knowledge to construct the target knowledge graph corresponding to the target field; step S106, based on the target knowledge graph and multiple initial question-answer pairs, multiple target question-answer pairs of the target field are generated, wherein the multiple initial question-answer pairs are based on historical questions in the target field and historical answers corresponding to the historical questions; step S108, in response to the question-answer request for the target field, the target answer corresponding to the question-answer request is determined based on the multiple target question-answer pairs. The purpose of improving the accuracy of the answer of the question-answer system can be achieved, and the technical effect of knowledge fusion and question-answer generation by focusing on data of different modalities in a specific field is achieved, thereby solving the technical problem of unsatisfactory question-answer accuracy existing in the related technology.
[0068] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation mode: Figure 4 is a flowchart of an optional question-answering processing method provided according to an embodiment of the present application, such as Figure 4 As shown, equipment operation and maintenance manuals, technical specification operation documents, construction form data, etc. are collected, and the data is preprocessed. Data is collected from various data sources, and data is preprocessed according to different data types to exclude low-quality, duplicate and problematic data.
[0069] Figure 5 is a principle block diagram of an optional question-answer processing method provided according to an embodiment of the present application, such as Figure 5 As shown in the figure, structured and unstructured knowledge representations are extracted from various data such as text, tables, and images, and key semantics and relationships of different modalities are extracted based on natural language processing, data mining and other technologies. Semantic preference mining is performed to collect and annotate common questions and interpretation pairs in the field of power construction, and at the same time, in-depth preference mining is performed based on the user's historical behavior and preferences.
[0070] Based on the knowledge fusion technology, multimodal knowledge is fused to build a rich and preferred knowledge graph, and a question-answering module for question answering is generated based on the target knowledge graph.
[0071] The above optional implementations achieve at least the following effects: By utilizing the structured knowledge and association analysis capabilities of the knowledge graph, it is possible to more accurately understand user needs and mine hidden associations, thereby providing more accurate and personalized recommendation results. Through multi-source data fusion and context-aware recommendations, it is possible to provide users with more comprehensive and diverse recommendation content to meet the needs of users in different scenarios and interests. By deeply mining user interests and semantic associations, it is possible to better understand user preferences and needs, provide users with personalized recommendation results that meet their preferences, and improve user satisfaction and usage experience.
[0072] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0073] In this embodiment, a question-answer processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0074] According to an embodiment of the present application, a device embodiment for implementing the question-answer processing method is also provided. Figure 6 is a schematic diagram of a question-answering processing device according to an embodiment of the present application, such as Figure 6 As shown, the question and answer processing device includes: a data acquisition module 602, a graph module 604, a question and answer pair generation module 606, and an answer module 608. The device is described below.
[0075] A data acquisition module 602 is used to acquire target data in a target field, wherein the plurality of predetermined modalities include a modality of the target data;
[0076] The graph module 604 is connected to the data acquisition module 602 and is used to perform knowledge fusion on the target data according to the modality weights corresponding to the multiple predetermined modalities, and construct a target knowledge graph corresponding to the target field;
[0077] A question-answer pair generation module 606, connected to the graph module 604, is used to generate a plurality of target question-answer pairs in a target domain based on the target knowledge graph and the plurality of initial question-answer pairs, wherein the plurality of initial question-answer pairs are obtained based on historical questions in the target domain and historical answers corresponding to the historical questions;
[0078] The answering module 608 is connected to the question-answer pair generating module 606 and is used to respond to a question-answer request for a target domain and determine a target answer corresponding to the question-answer request based on a plurality of target question-answer pairs.
[0079] In a question-and-answer processing device provided by an embodiment of the present application, a data acquisition module is set up to acquire target data in a target field, wherein the modality of the target data is included in multiple predetermined modalities; a graph module is used to perform knowledge fusion on the target data according to the modal weights corresponding to the multiple predetermined modalities, and construct a target knowledge graph corresponding to the target field; a question-and-answer pair generation module is used to generate multiple target question-and-answer pairs in the target field based on the target knowledge graph and multiple initial question-and-answer pairs, wherein the multiple initial question-and-answer pairs are obtained based on historical questions in the target field and historical answers corresponding to the historical questions; an answer module is used to respond to a question-and-answer request for the target field, and determine the target answer corresponding to the question-and-answer request based on multiple target question-and-answer pairs. The purpose of improving the accuracy of the answer of the question-and-answer system is achieved, and the technical effect of performing knowledge fusion and question-and-answer generation by focusing on data of different modalities in a specific field is realized, thereby solving the technical problem of unsatisfactory question-and-answer accuracy existing in the related technology.
[0080] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0081] It should be noted that the above data acquisition module 602, graph module 604, question-answer pair generation module 606, and answer module 608 correspond to steps S102 to S108 in the embodiment, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules can be run in a computer terminal as part of the device.
[0082] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0083] The above-mentioned question and answer processing device may also include a processor and a memory. The data acquisition module 602, the graph module 604, the question and answer pair generation module 606, the answer module 608, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0084] The processor includes a kernel, which retrieves the corresponding program unit from the memory. There can be one or more kernels. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0085] An embodiment of the present application provides a non-volatile storage medium on which a program is stored, and when the program is executed by a processor, a question and answer processing method is implemented.
[0086] The embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining target data in a target field, wherein the modality of the target data is included in a plurality of predetermined modalities; performing knowledge fusion on the target data according to the modality weights corresponding to the plurality of predetermined modalities, and constructing a target knowledge graph corresponding to the target field; generating a plurality of target question-answer pairs in the target field based on the target knowledge graph and a plurality of initial question-answer pairs, wherein the plurality of initial question-answer pairs are obtained based on historical questions in the target field and historical answers corresponding to the historical questions; in response to a question-answer request for the target field, determining a target answer corresponding to the question-answer request based on the plurality of target question-answer pairs. The device in this article may be a server, a PC, etc.
[0087] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: obtaining target data of a target domain, wherein the modality of the target data is included in multiple predetermined modalities; performing knowledge fusion on the target data according to the modality weights corresponding to the multiple predetermined modalities, and constructing a target knowledge graph corresponding to the target domain; generating multiple target question-answer pairs in the target domain based on the target knowledge graph and multiple initial question-answer pairs, wherein the multiple initial question-answer pairs are obtained based on historical questions in the target domain and historical answers corresponding to the historical questions; and determining, in response to a question-answer request for the target domain, a target answer corresponding to the question-answer request based on the multiple target question-answer pairs.
[0088] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0089] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0092] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0093] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0094] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape 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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0095] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0096] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0097] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A question-answering processing method, characterized in that: include: Acquire target data in a target field, wherein a modality of the target data is included in a plurality of predetermined modalities; According to the modality weights corresponding to the multiple predetermined modalities, respectively, knowledge fusion is performed on the target data to construct a target knowledge graph corresponding to the target field; Based on the target knowledge graph and the multiple initial question-answer pairs, a multiple target question-answer pairs in the target domain are generated, wherein the multiple initial question-answer pairs are obtained based on historical questions in the target domain and historical answers corresponding to the historical questions; In response to a question and answer request for the target domain, a target answer corresponding to the question and answer request is determined based on the multiple target question and answer pairs.
2. The method according to claim 1, characterized in that The step of generating a plurality of target question-answer pairs in the target domain based on the target knowledge graph includes: For a first question-answer pair among the multiple initial question-answer pairs, when a historical question included in the first question-answer pair corresponds to multiple historical answers, processing is performed based on the target knowledge graph to determine the behavior preference information of the target domain; Based on the behavior preference information, determining preference weights corresponding to the multiple historical answers respectively; According to the historical question, the multiple historical answers, and the preference weights respectively corresponding to the multiple historical answers, the first question-answer pair is updated to obtain a target question-answer pair corresponding to the first question-answer pair; The target question-answer pairs are updated based on the first question-answer pairs, and the multiple target question-answer pairs are obtained based on the multiple initial question-answer pairs.
3. The method according to claim 2, characterized in that The target knowledge graph includes entities, relationships, and attributes, wherein the relationships represent the interactions between multiple entities, and the attributes represent the properties of the entities. Processing based on the target knowledge graph to determine the behavior preference information of the target domain includes: Obtaining historical behavior data of the target domain; Based on the historical behavior data, interactively analyzing the relationships and entities to determine a preference pattern for the target domain; Performing path analysis based on the entities, the relationships, and the attributes to determine the association relationship of the target domain; Based on the preference pattern and the association relationship, the behavior preference information is determined.
4. The method according to claim 2, characterized in that: The determining, based on the behavior preference information, preference weights corresponding to the plurality of historical answers respectively includes: Determining an initial preference model, wherein the preference model adopts a predetermined loss function, and the predetermined loss function is used to increase the weight of the preferred answer and reduce the weight of the non-preferred answer; Using the behavior preference information, updating the predetermined loss function to obtain an updated loss function; Based on the updated loss function, an updated preference model is obtained; The updated preference model is used to process the multiple historical answers to determine the preference weights corresponding to the multiple historical answers respectively.
5. The method according to claim 2, characterized in that: The step of responding to the question-and-answer request for the target domain and determining a target answer corresponding to the question-and-answer request based on the multiple target question-and-answer pairs includes: Determining a request question that matches the question and answer request among the target questions corresponding to the multiple target question and answer pairs; In the case where there are multiple candidate answers corresponding to the request question, determining the target answer from the multiple candidate answers according to the preference weights respectively corresponding to the multiple candidate answers; or, According to the preference weights respectively corresponding to the multiple candidate answers, a predetermined number of candidate answers are determined from the multiple candidate answers; and the target answer is obtained by combining the predetermined number of candidate answers.
6. The method according to any one of claims 1 to 5, characterized in that The step of performing knowledge fusion on the target data according to the modality weights respectively corresponding to the plurality of predetermined modalities to construct a target knowledge graph corresponding to the target domain includes: In the case where the modality of the target data includes a text modality and an image modality, a feature embedding method is adopted to process the target data to obtain a text feature; Using a convolutional neural network to process the target data to obtain image features; Based on the text features, the modal weights corresponding to the text modality, the image features, and the modal weights corresponding to the image modality, knowledge fusion is performed to obtain the target knowledge graph.
7. The method according to any one of claims 1 to 5, characterized in that The step of acquiring target data in a target field includes: Extracting data sources based on the target domain to obtain structured data, semi-structured data, and unstructured data, wherein the structured data is data in a preset organizational structure, the semi-structured data is data that changes dynamically in a predetermined structure, and the unstructured data is multimodal data in multiple data formats; Preprocessing is performed based on the structured data, the semi-structured data, and the unstructured data to obtain the target data, wherein the preprocessing includes cleaning processing and / or conversion processing.
8. The method according to claim 7, characterized in that The step of performing knowledge fusion on the target data according to the modality weights respectively corresponding to the plurality of predetermined modalities to construct a target knowledge graph corresponding to the target domain includes: In the case where the structured data is included in the target data, extracting the target data to determine entities, relationships, and attributes, wherein the attributes are used to represent properties of the entities, and the relationships are used to represent interactions between multiple entities; A weighted average method is adopted to perform knowledge fusion based on the entity, the relationship, the attribute, and the modal weights corresponding to the multiple predetermined modalities to determine the target knowledge graph.
9. The method according to claim 7, characterized in that: The step of performing knowledge fusion on the target data according to the modality weights respectively corresponding to the plurality of predetermined modalities to construct a target knowledge graph corresponding to the target domain includes: When the target data includes semi-structured data and / or structured data, extracting the target data to determine entities; Based on the entity, determining a semantic feature; Determining an attribute based on a feature category of the semantic feature, wherein the attribute is used to represent a property of the entity; Determining a relationship based on the grammatical structure and context information included in the semantic features by using a natural language processing method, wherein the relationship is used to represent the interaction between multiple entities; A weighted average method is adopted to perform knowledge fusion based on the entity, the relationship, the attribute, and the modal weights corresponding to the multiple predetermined modalities to determine the target knowledge graph.
10. A question-answer processing device, characterized in that: include: A data acquisition module, used for acquiring target data in a target field, wherein a plurality of predetermined modalities include a modality of the target data; A graph module, used to perform knowledge fusion on the target data according to the modality weights respectively corresponding to the multiple predetermined modalities, and construct a target knowledge graph corresponding to the target field; A question-answer pair generation module, configured to generate a plurality of target question-answer pairs in the target domain based on the target knowledge graph and a plurality of initial question-answer pairs, wherein the plurality of initial question-answer pairs are obtained based on historical questions in the target domain and historical answers corresponding to the historical questions; The answering module is used to respond to a question and answer request for the target domain and determine a target answer corresponding to the question and answer request based on the multiple target question and answer pairs.
Citation Information
Patent Citations
Intelligent interaction method based on rich media knowledge graph multi-modal sentiment analysis model
CN114969282A
Data processing method and device, equipment and storage medium
CN116089573A
Multimodal knowledge graph construction method and information retrieval method based on media field
CN116108192A
Visual question and answer method and system, electronic equipment and storage medium
CN117271818A
Question and answer method and device based on multi-modal input and knowledge graph
CN117521814A
Cited By
Answer generation method and device, electronic equipment and storage medium
CN120821834A
A method, apparatus, electronic device, and storage medium for generating answers.
CN120821834B
Test set construction method and device based on multi-modal knowledge tree, equipment and medium
CN121278391A