Intelligent question answering system and method based on knowledge graph, knowledge base and large model
By integrating external knowledge graphs and knowledge base information, the understanding and answering ability of large-scale language models to understand and answer question texts is improved, and the limitations of existing models in providing depth and context-related answers are solved, achieving more efficient and accurate question-and-answer effects.
Patent Information
- Application Number
- CN202410704568.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-05-31
AI Technical Summary
Existing large-scale language models have limitations in understanding the deep meaning of querying problem texts, handling a large number of diverse data sources, and providing context-related and in-depth information, resulting in the inability to give comprehensive, in-depth and context-related answers.
When the user uses the question and answer model, he uses the external knowledge graph and knowledge base to obtain the external information of the question text asked by the user, and integrates the external information with the converted question text information, and inputs the integrated target question text into the question and answer model, thus providing the question and answer model with more comprehensive question text that contains multi-level context information.
The accuracy of the question and answer model's understanding of the question and answer model is improved, and the high correlation and high accuracy answers corresponding to the question and answer text are output, which significantly improves the effectiveness and accuracy of the question and answer model.
Smart Images

Figure CN118821939B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and specifically to an intelligent question-answering system and method based on a knowledge graph, a knowledge base and a large model. Background Art
[0002] At present, with the rise of AIGC (AI generated content) and LLM (Large Language Model) technologies, a variety of AI tools have emerged to assist users in creation. For example, ChatGPT (Chat Generative Pre-trained Transformer) is a language model that can respond to user input (text, images, voice, etc.). More and more users use this type of content-generated pre-trained language model for question-and-answer interaction to obtain the generated content they need. Summary of the invention
[0003] The embodiments of the present application provide an intelligent question-answering system and method based on a knowledge graph, a knowledge base and a large model.
[0004] In a first aspect, an embodiment of the present application provides a question-answering method, the question-answering method comprising the following steps:
[0005] Get the text information of the initial question to be answered;
[0006] Converting the initial question text information to obtain converted text information;
[0007] The converted text information and the external knowledge information associated with the initial question text information are integrated and input into a target question-answering model to obtain target question-answering information corresponding to the initial question text information.
[0008] In a second aspect, the present application provides an intelligent question-answering system, the intelligent question-answering system comprising:
[0009] A question acquisition module is configured to acquire text information of an initial question to be answered;
[0010] A question conversion module is configured to convert the initial question text information to obtain converted text information;
[0011] The question integration module is configured to integrate the external knowledge information of the converted text information and the initial question text information and input them into the target question-answering model to obtain the target question-answering information corresponding to the initial question text information.
[0012] In a third aspect, the present application further provides a text processing device, the text processing device comprising:
[0013] one or more processors;
[0014] Memory; and
[0015] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the question-answering method.
[0016] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the question-and-answer method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of a scenario of a question-and-answer method according to an embodiment of the present application;
[0019] Figure 2 A flowchart of an embodiment of the question-answering method in the embodiment of the present application;
[0020] Figure 3 A schematic diagram of a process for obtaining knowledge graph information corresponding to initial question text information in a question-answering method provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a process for obtaining knowledge base information corresponding to initial question text information in a question-answering method provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of an embodiment of the intelligent question-answering system provided in the embodiments of the present application;
[0023] Figure 6 A schematic diagram of the structure of an embodiment of a text processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0025] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0026] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0027] To facilitate understanding of the question-and-answer method provided in the embodiment of the present application, the application scenario of the question-and-answer method provided in the embodiment of the present application is first described. Specifically, the question-and-answer method provided in the embodiment of the present application is mainly applied to the scenario where the user uses a large-scale language model, wherein the user usually enters the text information that the user wants to process in the input bar, that is, the chat box when using a large-scale language model, and the text information is input into ChatGPT for processing, and ChatGPT generates the corresponding response content in the corresponding answer bar in a generative manner. For example, for the question-type text information raised by the user, the language model can generate the corresponding answer content, or for the request-type text information raised by the user, the language model can generate the content corresponding to the request.
[0028] However, existing large-scale language models are still limited in understanding the deep meaning of query text, processing a large number of diverse data sources, and providing contextual and in-depth information. This results in the large-scale language model being unable to give comprehensive, in-depth, and contextual answers when answering user questions about specific fields, and failing to accurately meet the user's query needs. For example, when a user enters "Why is polarity reversal needed" in the input field corresponding to the large-scale language model, the baseline answer given by the large-scale language model is: "Polarity reversal is commonly used in electronic circuits to change the direction of current or signal. This operation is necessary in many electronic devices and systems to ensure correct function and performance. For example, in AC circuits, polarity reversal helps achieve alternating flow of current." This baseline answer fails to understand the user's query intent more comprehensively, resulting in a relatively simple answer that fails to meet the user's query needs.
[0029] Precisely to solve the above-mentioned problems, an embodiment of the present application provides a question-answering method, which uses an external knowledge graph and a knowledge base to obtain external information of the question text asked by the user when the user uses the question-answering model, integrates the external information with the converted question text information, and inputs the integrated target question text into the question-answering model, thereby providing the question-answering model with a more comprehensive question text containing multi-level contextual information, so as to improve the accuracy of the question-answering model's understanding of the question text, and then output a highly relevant and highly accurate answer corresponding to the question text, which can significantly improve the performance and accuracy of the question-answering model.
[0030] like Figure 1 As shown, Figure 1 This is a scenario diagram of the question-and-answer method in an embodiment of the present application. The text processing scenario in the embodiment of the present invention includes a text processing device 100 (an intelligent question-and-answer system is integrated in the text processing device 100), and a computer-readable storage medium corresponding to the question-and-answer method runs in the text processing device 100 to execute the steps of the question-and-answer method.
[0031] Understandably, Figure 1 The text processing devices in the question-and-answer method scenario shown, or the devices included in the text processing devices, do not constitute limitations on the embodiments of the present invention, that is, the number of devices and types of devices of the text processing devices included in the question-and-answer method scenario, or the number of devices and types of devices included in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present invention.
[0032] In the embodiment of the present invention, the text processing device 100 is mainly used for: obtaining the initial question text information to be answered; converting the initial question text information to obtain converted text information; integrating the converted text information and the external knowledge information associated with the initial question text information into the target question and answer model to obtain the target question and answer information corresponding to the initial question text information.
[0033] The text processing device 100 in the embodiment of the present invention can be an independent text processing device, such as a smart terminal such as a mobile phone, a tablet computer, a network device, a server, and a smart computer, or it can be a text processing network or text processing cluster composed of multiple text processing devices.
[0034] The embodiments of the present application provide a question-answering method, apparatus, device, and computer-readable storage medium, which are described in detail below.
[0035] It can be understood by those skilled in the art that Figure 1 The application environment shown in is only one of the application scenarios related to the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer text processing devices shown, or text processing network connections, such as Figure 1 Only one text processing device is shown. It can be understood that the scenario of the question-answering method can also include one or more text processing devices, which are not specifically limited here. The text processing device 100 can also include a memory for storing knowledge graphs, knowledge bases and other data.
[0036] It should be noted that Figure 1 The scenario diagram of the question-and-answer method shown is merely an example. The scenario of the question-and-answer method described in the embodiment of the present invention is intended to more clearly illustrate the technical solution of the embodiment of the present invention and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.
[0037] Based on the scenario of the above question-answering method, various embodiments of the question-answering method disclosed in the present invention are proposed.
[0038] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of the question-answering method in the embodiment of the present application. The question-answering method includes the following steps 201 to 203:
[0039] 201. Obtaining initial question text information;
[0040] The question-answering method in this embodiment is applied to a text processing device, and the type and number of the text processing device are not specifically limited, that is, the text processing device can be one or more intelligent terminals or servers. In a specific embodiment, the text processing device is an intelligent terminal such as an intelligent computer that can access a large-scale language model or is equipped with a large-scale language model. Optionally, in a specific embodiment, the large-scale language model can be a large-scale language model such as ChatGPT, BERT, XLNet, Zhipu large model, Claude, Moonshot AI large model, ChatGLM large model, Qianyi Tongwen large model, MiniMax large model, Spark large model, Llama large model, 360GPT large model, Qwen large model, Baichuan large model, Skylark large model, vivoLM large model and Wenxin Yiyan.
[0041] Specifically, the initial question text information to be answered refers to the question text information entered by the user in the input column of the large-scale language model when using the large-scale language model, waiting for the specified question-answering model to answer. For example, when the user enters "Why is polarity reversal required?" in the input column of the large-scale language model, the question text of "Why is polarity reversal required?" is the initial question text information to be answered.
[0042] Optionally, with the popularization of large-scale language models, each smart terminal, or even an application (such as a browser) in a smart terminal may pre-set a large-scale language model. In this case, the question information entered by the user in a designated input bar or other input control that can trigger a response from a large-scale language model also belongs to the initial question text information. For example, in a specific embodiment, a large-scale language model is integrated in a specific browser, and the user enters the question text in the search bar or other input area of the browser. The large-scale language model in the browser can read the question text and trigger the question-answering process. In this case, the question text is the initial question text information to be answered.
[0043] 202. Convert the initial question text information to obtain converted text information;
[0044] Specifically, in order to eliminate the inaccurate answers given by subsequent large-scale language models due to different differentiated expressions of the initial question text information, and to enable the subsequent large-scale language model to obtain more comprehensive input questions, the text processing device, after obtaining the initial question text information, also converts the initial question text information to obtain converted text information.
[0045] Specifically, the conversion process is to perform a unified semantic representation conversion operation on the initial question text information, that is, the conversion process is to convert the initial question text information in different expressions into the conversion text information in a specified standardized expression. This operation can reduce the difficulty of understanding of the subsequent target question-answering model, and can also improve the robustness and answering efficiency of the target question-answering model.
[0046] Specifically, after obtaining the initial question text information, the text processing device also performs entity extraction on the initial question text information through a preset entity extraction function, thereby obtaining the first entity information and the first predicate information in the initial question text information. Among them, the first entity information is an entity or concept text with important meaning or information value in the initial question text information. In a specific embodiment, the first entity information can be a specific entity matter such as a person, a place, an organization, a time, a product name, etc. In another specific embodiment, the first entity information can also be an abstract concept or a proper noun in a specific field. For example, in the initial question text information "Why is polarity reversal needed", the first entity information of the initial question text information is an abstract concept: "polarity reversal". Among them, the central predicate is the predicate expressing the action in the initial question text information. Optionally, in a specific embodiment, the entity extraction function is E(q)=Dependency_Parsing_or_NER(q).
[0047] Specifically, before the text processing device performs entity extraction on the initial question text information, it also performs conversion processing on the initial question text information in advance, that is, it identifies punctuation marks and / or other noise characters in the initial question text information, and filters the punctuation marks and / or noise characters in the initial question text information to obtain filtered initial question text information.
[0048] Specifically, the text processing device also performs text segmentation and classification processing on the filtered initial question text information to obtain question vocabulary information. The text processing device breaks down the initial question text information into question vocabulary information in vocabulary units. That is, the text processing device uses a pre-trained word segmentation model to perform text segmentation processing on the initial question text information, and obtains the word segmentation result output by the word segmentation model, wherein the word segmentation result is the question vocabulary information. In a specific embodiment, the word segmentation model can be an NLTK (Natural Language Toolkit) model and a spaCy library, etc.
[0049] Specifically, after obtaining the question vocabulary information, the text processing device also performs vocabulary classification and recognition on the question vocabulary information according to the entity extraction function, that is, performs key entity recognition and predicate recognition on the question text to obtain the first entity information and the first predicate information in the question vocabulary information.
[0050] Specifically, the text processing device performs entity extraction on the question vocabulary information based on the entity extraction function to obtain the first entity information in the question vocabulary information. That is, the text processing device calls a pre-trained entity extraction model based on the entity extraction function to identify the question vocabulary information, thereby determining the named entity text in the question vocabulary information, and determining the named entity text as the first entity information of the initial question text information.
[0051] Specifically, the text processing device also performs central predicate extraction on the question vocabulary information based on the entity extraction function to obtain the first predicate information in the question vocabulary information. That is, the text processing device calls the pre-trained predicate extraction model based on the entity extraction function to perform dependency syntax analysis on the question vocabulary information, analyzes the dependency structure of the question vocabulary information and the initial question text information, and determines the first predicate information in the question vocabulary information.
[0052] Optionally, in a specific example, after acquiring the first entity information and the first predicate information, the text processing device further determines whether the first entity information and / or the first predicate information are the first entity information and / or the first predicate information with a special part of speech, and when determining that the first entity information and / or the first predicate information are the first entity information and / or the first predicate information with a distinctive part of speech, the text processing device further performs word-level conversion processing on the first entity information and / or the first predicate information to obtain the converted first entity information and / or the first predicate information.
[0053] Specifically, after acquiring the first entity information and the first predicate information, the text processing device further performs conversion processing on the initial question text information according to the first entity information and the first predicate information to obtain converted text information.
[0054] Optionally, in a specific embodiment, the text processing device pre-sets a question conversion model trained based on machine learning to convert the initial question text information. That is, after obtaining the first entity information and the first predicate information, the text processing device inputs the first entity information and the first predicate information into the question conversion model to convert the initial question text information to obtain converted text information with a more unified question form.
[0055] Optionally, in other embodiments, the text processing device can also pre-set different conversion question templates based on different question domains and / or question types. After acquiring the initial question text information, and the first entity information and the first predicate information corresponding to the initial question text information, the text processing device further determines the question type and question domain of the initial question text information corresponding to the initial question text information based on the first entity information and the first predicate information.
[0056] Specifically, after obtaining the first entity information of the initial question text information, the text processing device further determines the entity text domain to which the first entity information belongs, and matches the entity text domain with the problem domain of each conversion question template, and / or matches the question type corresponding to the first predicate information with the question type of the conversion question template, thereby determining a conversion question template that is compatible with the question type and problem domain of the initial question text information.
[0057] Optionally, in other embodiments, the text processing device can also determine the conversion question template corresponding to the initial question text information according to the question identification information of the initial question text information. Wherein, the question identification information is the identification information constructed by the text processing device for the initial question text information based on the question type and / or the question field. When the text processing device converts the initial question text information, it obtains the question type and / or the question field corresponding to the initial question text information by parsing the question identification information of the initial question text information, and then determines the conversion question template that is the same as the question type and / or the same as the question field. Wherein, the question identification information can only represent a single type of question type or question field, or can also represent the question type and the question field at the same time. When the question identification information only represents a single type of question type or question field, the text processing device obtains the conversion question template that belongs to the same question type or question field as the question identification information. When the question identification information is the question identification information that simultaneously represents the question type and the question field, the text processing device obtains the conversion question template that belongs to the same question type and the question field as the question identification information.
[0058] Specifically, after obtaining the conversion text information associated with the initial question text information, the text processing device fills the first entity information and / or the first predicate information into the conversion question template to obtain the conversion text information. That is, the text processing device inputs the first entity information into the key entity field in the conversion question template to generate conversion text information with a more unified question form. This ensures that even if the original expression of the initial question text information is vague or has multiple ways of understanding, it can be converted into a conversion query request with clear semantics to eliminate the differences in understanding caused by different expressions.
[0059] Optionally, when there are only key entity fields to be filled in the conversion question template corresponding to a specific question type and question field, the text processing device only fills the first entity information device into the key entity fields in the conversion question template to obtain conversion text information to eliminate the differences in understanding caused by different expressions.
[0060] For example, in a specific embodiment, after the text processing device obtains the initial question text information as "Paris is what in France?", the text processing device identifies the first entity information in the initial question text information as "Paris" and "France", and the first predicate information in the initial question text information is "yes". The text processing device determines that the question domain is a geographical domain based on the first entity information, and determines that the question type is an inquiry type. Then the text processing device obtains the conversion question template corresponding to the initial question text information as "What is the relationship between [ ] and [ ]?", and inputs the first entity information into the conversion question template to obtain the conversion text information of the initial question text information "What is the relationship between France and Paris?".
[0061] For example, in another specific embodiment, the text processing device obtains the initial question text information as "Why is polarity reversal needed?" The text processing device identifies the first entity information in the initial question text information as "polarity reversal", and the first predicate information in the initial question text information as "need". The text processing device determines that the problem domain is the field of electronic engineering based on the first entity information, and determines that the question type is an inquiry type. Then the text processing device obtains the conversion question template corresponding to the initial question text information as "Explore the technical necessity of [ ]?", and inputs the first entity information into the conversion question template to obtain the conversion text information of the initial question text information "Explore the technical necessity of polarity reversal?".
[0062] 203. Input the converted text information into a target processing model to obtain target question and answer information.
[0063] Specifically, after obtaining the processed converted text information, the text processing device also integrates the converted text information and external knowledge information associated with the initial question text information and inputs them into the target question and answer model to obtain the target question and answer information corresponding to the initial question text information.
[0064] Among them, the external knowledge information is the external knowledge graph information associated with the initial question text information obtained by performing a knowledge graph retrieval based on a designated external knowledge graph system, and / or the external knowledge base information associated with the initial question text information recalled through a designated external knowledge base.
[0065] Specifically, after obtaining the initial question text information, the text processing device also performs a knowledge graph search based on the target knowledge graph and the initial question text information, thereby obtaining the knowledge graph information in the target knowledge graph corresponding to the initial question text information.
[0066] Based on this knowledge graph information, the text processing model can more deeply mine the key concepts in the initial question text information and understand the association path information between the key concepts.
[0067] Among them, the target knowledge graph is an external knowledge graph belonging to the same knowledge field as the initial question text information.
[0068] Specifically, after obtaining the initial question text information, the text processing device also matches the initial question text information according to the target knowledge base, that is, matches the target knowledge information in the target knowledge base with the initial question text information to obtain the target matching knowledge information corresponding to the initial question text information stored in the external knowledge base.
[0069] Based on the target matching knowledge information, the text processing model can identify multiple knowledge points associated with the initial question text information, thereby enhancing the target question-answering model's understanding of the user's questions in the subsequent question-answering process.
[0070] The target knowledge base is a knowledge database or other data storage form that stores information, facts, concepts and rules that belong to the same knowledge domain as the initial question text information.
[0071] Specifically, after acquiring the knowledge graph information and the target matching knowledge information, the text processing device also determines the knowledge graph information and the knowledge base information as external knowledge information associated with the initial question text information.
[0072] Specifically, the text processing device also integrates the acquired external knowledge information and the converted text information to obtain a target question text containing rich context information, and inputs the target question text into the target question and answer model to obtain target question and answer information with higher accuracy output by the target question and answer model.
[0073] Specifically, after acquiring the external knowledge information, the text processing device also generates question prompt information of the initial question text information according to the knowledge graph information and the target matching knowledge information in the external knowledge information. The question prompt information is prompt word information used to guide the target question-answering model to output answer information according to the specified answer direction.
[0074] Specifically, after generating the question prompt information, the text processing device also integrates the question according to the question type, question prompt information and converted text information of the initial question text information to obtain the target question text information, so that the target question answering model can obtain richer and multi-level context information from the target question text, thereby understanding the question more accurately and quickly, and providing more accurate answer information.
[0075] Specifically, after determining the question type of the initial question text information, the text processing device selects a corresponding target question template, and inputs the question prompt information and the converted text information into the target question template to obtain the target question text information. The question types include basic fact query, explanation or cause analysis, process or step description, comparison and contrast, application and practice suggestions, and prediction and trend analysis.
[0076] Optionally, if the question type is a basic fact query type, the text processing device determines that the target question template of the initial question text information is "for the question [converted text information], use known information [question prompt information] to directly provide an accurate and factual answer." The text processing device inputs the converted text information and question prompt information into the target question template to obtain the target question text information.
[0077] Optionally, if the question type is an explanatory or cause analysis type, the text processing device determines that the target question template of the initial question text information is "Faced with the problem [conversion text information] and related background information [question prompt information], explain in detail the principles or reasons behind it. Please include key factors, processes or events in your answer, and explain how they interact to lead to the current results." The text processing device inputs the conversion text information and question prompt information into the target question template to obtain the target question text information.
[0078] Optionally, if the question type is a process or step description type, the text processing device determines that the target question template of the initial question text information is "For the inquiry [converted text information], based on the information we obtained [question prompt information], describe the relevant steps, processes or methods. Please make sure to clearly outline each step in a logical order and explain its importance." The text processing device inputs the converted text information and question prompt information into the target question template to obtain the target question text information.
[0079] Optionally, if the question type is a comparison and contrast type, the text processing device determines that the target question template of the initial question text information is "For the proposed comparison question [conversion text information], based on the data we collected [question prompt information], conduct a detailed comparison and contrast analysis. Point out the main similarities and differences, and when possible, provide suggestions or conclusions for selection." The text processing device inputs the conversion text information and question prompt information into the target question template to obtain the target question text information.
[0080] Optionally, if the question type is application and practice suggestions, the text processing device determines that the target question template of the initial question text information is "Taking into account the problem [conversion text information] and related information [question prompt information], provide practical suggestions or solutions. Explain why these suggestions are effective and how to implement them to help users achieve their goals." The text processing device inputs the conversion text information and question prompt information into the target question template to obtain the target question text information.
[0081] Optionally, if the question type is prediction and trend analysis, the text processing device determines that the target question template of the initial question text information is "Based on the question [conversion text information] and existing knowledge [question prompt information], analyze future trends or possible developments. Discuss the logic and evidence behind these predictions, and their possible significance to related fields or users." The text processing device inputs the conversion text information and question prompt information into the target question template to obtain the target question text information.
[0082] Specifically, after obtaining the target question text information, the text processing device inputs the target question text information into the target question answering model, and obtains the target question answering information output by the target question answering model. Compared with the baseline answer information obtained by directly inputting the initial question text information into the target question answering model, the target question answering information can more accurately meet the user's query needs and can provide rich background knowledge and technical details.
[0083] It should be noted that in addition to the ChatGPT provided above, the target question-answering model here can also be other large-scale language models that can realize human-computer dialogue provided by other Internet manufacturers in an open source or non-open source manner.
[0084] Optionally, the method is illustrated by taking the initial question text information as "Why is polarity reversal required?" as an example:
[0085] The text processing device converts the initial question text information "Why is polarity reversal needed?" to obtain converted text information: "Explore the technical necessity of polarity reversal."
[0086] The text processing device also performs a knowledge graph search on the first entity information "polarity reversal" in the initial question text information to obtain knowledge graph information: basic physical concepts related to "polarity reversal", application scenarios in electronic engineering, and related scientific and technological development history.
[0087] The text processing device also recalls similar information of the first entity information "polarity reversal" in the initial question text information to obtain knowledge base information in the target knowledge base: multiple knowledge points related to "polarity reversal", such as "charge flow in semiconductors", "polarity conversion of DC circuits", and "application of polarity reversal in signal processing".
[0088] The text processing device integrates the external knowledge information and the converted text information to obtain the target question text: Provide a comprehensive explanation of the importance of "polarity reversal" in electronic engineering, including its role in changing signal direction, protecting electronic equipment, and optimizing circuit design. In addition, it also includes the historical background and future application prospects of polarity reversal in the development of modern electronic technology.
[0089] The text processing device obtains the target question text, inputs the target question text into the target question answering model, and obtains the output answer of the target question answering model: "In electronic engineering, polarity reversal is an important technology, which refers to changing the direction of current or signal flow in a circuit. This process plays a key role in a variety of electronic systems. For example, polarity reversal is used in signal processing to adjust signal waveforms to suit specific processing needs or conversions. In semiconductor devices, polarity reversal helps control the flow of charge carriers, thereby affecting the conductivity characteristics of the device. Historically, the development of polarity reversal technology has been closely linked to advances in electronic technology, especially in the design of digital circuits and communication systems, which makes signal processing more flexible and efficient. In the future, as electronic technology continues to evolve, the application of polarity reversal may find more innovative uses in emerging fields such as quantum computing."
[0090] In this embodiment, the text processing device obtains the initial question text information to be answered; converts the initial question text information to obtain converted text information; integrates the converted text information and the external knowledge information associated with the initial question text information and inputs them into the target question-answering model to obtain the target question-answering information corresponding to the initial question text information. Before the question text is input into a question-answering model such as ChatGPT, the initial question text information is converted in advance, and the external knowledge information associated with the initial question text information is also obtained. The converted question text and external knowledge information are integrated to form a new question text, and the new question text is input into the question-answering model to be input, thereby providing the question-answering model with a more comprehensive question text containing multi-level context information, so as to improve the accuracy of the question-answering model's understanding of the question text, and then output a highly relevant and highly accurate answer corresponding to the question text, which can significantly improve the effectiveness and accuracy of the question-answering model.
[0091] like Figure 3 As shown, Figure 3 A flowchart of an embodiment of obtaining knowledge graph information corresponding to initial question text information in the question-answering method provided in an embodiment of the present application. Specifically, based on the above embodiment, in this embodiment, the question-answering method further includes steps 301 to 304:
[0092] 301. Perform word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information;
[0093] 302. Perform part-of-speech tagging on the question vocabulary information based on the tagging pre-training model to obtain part-of-speech tagging information of the question vocabulary information;
[0094] 303. Determine the question vocabulary information having the same part-of-speech tag as the target part-of-speech tag as the keyword information of the initial question text information;
[0095] 304. Query the target knowledge graph for graph entities and graph information associated with the keyword information, and determine the graph entities and the graph information as the knowledge graph information of the initial question text information.
[0096] Based on the above embodiments, in this embodiment, in order to systematically obtain information related to the initial question text information, after obtaining the initial question text information, the text processing device also performs a knowledge graph search based on the target knowledge graph and the initial question text information, thereby obtaining the knowledge graph information corresponding to the initial question text information in the target knowledge graph. Among them, the knowledge graph information is entities or information related to the keywords in the initial question text information. In a specific embodiment, the target knowledge graph can be one or more of the Wikidata knowledge graph, the Google knowledge graph, the DBpedia knowledge graph, and the YAGO knowledge graph.
[0097] Specifically, after acquiring the initial question text information, the text processing device performs word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information. That is, the text processing device performs denoising preprocessing on the initial question text information in advance, filters punctuation marks and special characters in the initial question text information, and performs preprocessing such as word form restoration and / or stem extraction on the filtered initial question text information to perform text conversion.
[0098] Specifically, after obtaining the converted initial question text information, the text processing device also performs word segmentation processing on the initial question text information, splitting the initial question text information into separate question vocabulary information, so that in subsequent steps, the initial question text information can be tagged with parts of speech and keyword information in the initial question text information can be identified.
[0099] Specifically, after obtaining the question vocabulary information of the initial question text information, the text processing device also performs part-of-speech tagging on the question vocabulary information based on the annotation pre-training model to determine the part-of-speech tags of each question vocabulary information. That is, the text processing device identifies the part-of-speech of each question vocabulary information through the annotation pre-training model, and generates a part-of-speech tag for each question vocabulary information based on the part-of-speech. Among them, the annotation pre-training model can be a spaCy model and an NLTK model. The part-of-speech tag includes a noun tag, a verb tag, an adjective tag, and other part-of-speech tags. Optionally, in other embodiments, the part-of-speech tag also includes a proper noun part-of-speech tag.
[0100] Specifically, after obtaining the part-of-speech tag of each question vocabulary information, the text processing device also compares the part-of-speech tag with the target part-of-speech tag to determine the keyword information in the initial question text information. The target part-of-speech tag is a noun part-of-speech tag and a proper noun part-of-speech tag.
[0101] Optionally, if the part-of-speech tag of the question vocabulary information is different from the target part-of-speech tag, that is, the part-of-speech tag of the question vocabulary information is different from the noun part-of-speech tag and the proper noun part-of-speech tag, the text processing device determines that the question vocabulary is non-keyword information.
[0102] Optionally, the part-of-speech tag of the question vocabulary information is different from the target part-of-speech tag, that is, the part-of-speech tag of the question vocabulary information is the same as the noun part-of-speech tag or the proper noun part-of-speech tag. The text processing device determines that the question vocabulary information is a noun or a proper noun, and sets the question vocabulary information as the keyword information of the initial question text information.
[0103] Specifically, after obtaining the keyword information of the initial question text information, the text processing device also queries the graph entity and graph information associated with the keyword information in the target knowledge graph, and sets the graph entity and the graph information as the knowledge graph information of the initial question text information. That is, the text processing device calls a pre-set retrieval function to extract the target knowledge graph specified by the keyword information query, obtains the graph entity and graph information associated with the keyword information in the target knowledge graph, and sets the graph entity and the graph information as the knowledge graph information of the initial question text information. Thus, in the subsequent question-answering process, the target question-answering model can deeply explore the key concepts of the initial question text information and understand the key path information between the key concepts.
[0104] Optionally, in a specific example of this embodiment, the expression of the search function is R(k)=Graph_Database_Query(k), where k is the keyword information in the initial question text information.
[0105] In this embodiment, the text processing device obtains the question vocabulary information of the initial question text information by performing word segmentation preprocessing on the initial question text information; performs part-of-speech tagging on the question vocabulary information based on the tagging pre-training model to obtain the part-of-speech tag of the question vocabulary information; sets the question vocabulary information with the same part-of-speech tag as the target part-of-speech tag as the keyword information of the initial question text information; queries the graph entity and graph information associated with the keyword information in the target knowledge graph, and sets the graph entity and the graph information as the knowledge graph information of the initial question text information. This is achieved by extracting the keyword information in the initial question text information, and querying the external knowledge graph for other entity information associated with the keyword information, thereby generating knowledge graph information representing the path information associated with each keyword information, so that the target question-answering model can more accurately determine the core of the question in the subsequent question-answering process, thereby improving the accuracy of the answer and providing a more accurate information retrieval service.
[0106] like Figure 4 As shown, Figure 4 A flowchart of an embodiment of obtaining knowledge base information corresponding to initial question text information in the question-answering method provided in an embodiment of the present application. Specifically, based on the above embodiment, in this embodiment, the question-answering method further includes steps 401 to 404:
[0107] 401. Perform feature extraction on the initial question text information to obtain initial question feature information of the initial question text information;
[0108] 402. For each initial question feature information in the initial question text information, calculate the correlation between the initial question feature information and each target knowledge feature information in the target knowledge base information based on the feature calculation model to obtain feature correlation information corresponding to the initial question feature;
[0109] 403. The feature correlation in the feature correlation information is greater than the correlation threshold, and is determined as the target feature correlation;
[0110] 404. Determine the target knowledge feature information corresponding to each target feature correlation degree as the target sub-matching knowledge information in the target matching knowledge information of the initial question text information.
[0111] Based on the above embodiments, in this embodiment, after acquiring the initial question text information, the text processing device also performs associated information matching on the initial question text information according to the target knowledge base to obtain target matching knowledge information corresponding to the initial question text information stored in the external knowledge base, wherein the target matching knowledge information includes at least one target sub-matching knowledge information, which is external knowledge information associated with the initial question feature information corresponding to the initial question text information.
[0112] Specifically, the text processing device pre-sets a pre-trained feature extraction model for extracting features from the initial question text information, and extracts features from the initial question text information through the feature extraction model to obtain initial question feature information of the initial question text information, that is, the text processing model converts the initial question text information into a feature vector representation through the feature extraction model. The word embedding model can be a pre-trained word embedding model such as Word2Vec, GloVe, FastText, and BERT.
[0113] Specifically, the text processing device performs word segmentation preprocessing on the acquired initial question text information, and removes stop words, punctuation marks, and special characters from the segmented initial question text information to obtain question vocabulary information of the initial question text information. Optionally, the text processing device can further perform preprocessing operations such as stemming or part-of-speech restoration on the initial question text information.
[0114] Specifically, after obtaining the question vocabulary information, the text processing device also uses the feature extraction model to find the word embedding representation corresponding to the question vocabulary information to determine the question vocabulary features corresponding to the question vocabulary information, and performs feature combination processing on the question vocabulary features of the initial question text information to obtain the initial question feature information.
[0115] Specifically, the text processing model also pre-accesses the target knowledge base in the same knowledge field as the initial question text information, and obtains the target knowledge feature information corresponding to each target knowledge information in the target knowledge base, and calculates the correlation between the initial question feature information and each target knowledge feature information, and obtains the feature correlation information corresponding to the initial question feature. Among them, the target knowledge feature information is the information feature data corresponding to the specific target knowledge base information in the target knowledge base. The feature correlation information includes several feature correlations, each feature correlation corresponds to a target knowledge feature information. That is, each feature correlation is the correlation between the target knowledge feature information characterizing each target knowledge base information and the initial question text information. Specifically, the calculation formula of the feature correlation is as follows:
[0116]
[0117] Among them, D(V, U) is the feature correlation in the feature correlation information, a, b, c are the first similarity coefficient, the second similarity coefficient and the third similarity coefficient respectively, V is the initial question feature information expressed in vector form, and U is the target knowledge feature information of the target knowledge base information expressed in vector form.
[0118] Optionally, the first similarity coefficient, the second similarity coefficient and the third similarity coefficient may be user-defined or given by the terminal system, wherein the first similarity coefficient, the second similarity coefficient and the third similarity coefficient are all values not less than 0 and not greater than 1.
[0119] Among them, the first similarity coefficient, the second similarity coefficient and the third similarity coefficient are the correlation weight coefficients corresponding to the target correlation algorithm in the correlation calculation model, and the first similarity coefficient, the second similarity coefficient and the third similarity coefficient can be the default weight values set by the text processing device. In addition, the first similarity coefficient, the second similarity coefficient and the third similarity coefficient can also be the weight coefficients set by the user. For example, the user can customize the similarity coefficients of different target correlation algorithms in the correlation calculation model according to actual needs, so as to realize the fusion of multiple different correlation algorithms to calculate the knowledge correlation information, so as to improve the accuracy and reliability of the knowledge correlation information.
[0120] In addition, the user can also use the first similarity coefficient, the second similarity coefficient and the third similarity coefficient to select the corresponding target association algorithm, that is, if the user needs to select a specific target association algorithm, the similarity coefficient corresponding to the target association algorithm is adjusted to a specific coefficient in the interval [0, 1]. If the user determines that a specific target association algorithm needs to be turned off, the similarity coefficient corresponding to the target association algorithm is adjusted to 0. If the user determines to only start a specific target association algorithm, the similarity coefficient corresponding to the target association algorithm is set to 1, thereby dynamically adjusting the activation status of each target association algorithm in the association calculation model by adjusting the first similarity coefficient, the second similarity coefficient and the third similarity coefficient.
[0121] Optionally, in other embodiments, the target correlation algorithm in the correlation calculation model may also be a correlation algorithm different from the correlation algorithm in the above-mentioned information correlation calculation method, which is not specifically limited in this embodiment.
[0122] Specifically, after obtaining the feature correlation information between the initial question feature and each target knowledge feature, the text processing device compares each feature correlation in the feature correlation information with a preset correlation threshold, thereby obtaining a target feature correlation whose feature correlation is greater than the similarity threshold, and determines the target knowledge feature information corresponding to each target feature correlation as the target sub-matching knowledge information in the target matching knowledge information of the initial question text information, and the text processing device summarizes each target sub-matching knowledge information to obtain the target matching knowledge information of the initial question text information. Among them, the correlation threshold is the correlation threshold information used to characterize whether the initial question feature is related to the external knowledge feature. Among them, the similarity threshold can be set according to the actual application accuracy.
[0123] Optionally, in other examples, the text processing device can also compare the correlations of the features and recall the target matching knowledge information with the highest correlation. The comparison formula is:
[0124] A=
[0125] Optionally, in other embodiments, in order to more accurately match the initial question text information and the target matching knowledge information in the target knowledge base, the text processing device can also use the converted text information to perform the similar information recall operation, that is, vectorize the converted text information to obtain the initial question features, and match the initial question features with the external knowledge feature information corresponding to each target knowledge in the target knowledge base to obtain the target matching knowledge information in the target knowledge base that is most relevant to the initial question text information.
[0126] Specifically, after acquiring the target matching knowledge information, the text processing device also generates question prompt information for the initial question text information based on the knowledge graph information and the target matching knowledge information.
[0127] Specifically, after generating the question prompt information, the text processing device also integrates the question according to the question type, question prompt information and converted text information of the initial question text information to obtain the target question text information, so that the target question answering model can obtain richer and multi-level context information from the target question text, thereby understanding the question more accurately and quickly, and providing more accurate answer information.
[0128] In this embodiment, the text processing device extracts features from the initial question text information to obtain the initial question features of the initial question text information; calculates the feature correlation between the initial question features and each external knowledge feature in the target knowledge base; recalls the target knowledge base information whose feature correlation is greater than the similarity threshold, and sets the target knowledge base information as the knowledge base information of the initial question text information. When using a large-scale language model for question-answering interaction, by accessing an external knowledge base and vectorizing the question text, the feature correlation between the question feature vector corresponding to the question text and each knowledge feature vector in the external knowledge base is calculated, and based on the feature correlation, the associated knowledge base information in the external knowledge base is recalled, and the question and knowledge information are integrated, thereby providing rich and multi-level context information for the large-scale language model, assisting the large-scale language model in understanding the question, and thereby improving the accuracy and efficiency of the model's answers.
[0129] In order to better implement the question-answering method in the embodiment of the present application, on the basis of the question-answering method, an intelligent question-answering system is also provided in the embodiment of the present application, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of the intelligent question-answering system provided in an embodiment of the present application. Specifically, the intelligent question-answering system 500 includes:
[0130] The question acquisition module 501 is configured to acquire text information of an initial question to be answered;
[0131] The question conversion module 502 is configured to convert the initial question text information to obtain converted text information;
[0132] The question integration module 503 is configured to input the converted text information into a target processing model to obtain target question and answer information.
[0133] In a possible implementation of this embodiment, the intelligent question answering system converts the initial question text information to obtain converted text information, including:
[0134] Performing text segmentation and classification processing on the initial question text information to obtain question vocabulary information;
[0135] The initial question text information is converted according to the question vocabulary information to obtain converted text information.
[0136] In a possible implementation of this embodiment, the intelligent question answering system performs text segmentation and classification processing on the initial question text information to obtain question vocabulary information, including:
[0137] Performing word segmentation processing on the initial question text information to obtain question vocabulary information of the initial question text information;
[0138] The question vocabulary information is subjected to vocabulary classification processing according to the conversion text model to obtain first entity information and first predicate information in the question vocabulary information.
[0139] In a possible implementation of this embodiment, the intelligent question answering system converts the initial question text information according to the question vocabulary information to obtain converted text information, including:
[0140] Determining a conversion question template corresponding to the initial question text information according to the question identification information of the initial question text information;
[0141] The first entity information in the question vocabulary information and / or the first predicate information in the question vocabulary information are filled into the conversion question template to obtain conversion text information.
[0142] In a possible implementation of this embodiment, before inputting the converted text information into the target processing model to obtain the target question and answer information, the intelligent question and answer system further:
[0143] Perform knowledge graph retrieval based on the target knowledge graph and the initial question text information to obtain the knowledge graph information corresponding to the initial question text information;
[0144] Perform information matching processing on the initial question text information according to the target knowledge base information to obtain target matching knowledge information corresponding to the initial question text information, wherein the target matching knowledge information includes at least one target sub-matching knowledge information;
[0145] The step of inputting the converted text information into a target processing model to obtain target question-answer information includes:
[0146] Generate target question text information according to the conversion text information, the target matching knowledge information and the knowledge graph information;
[0147] The target question text information is input into the target processing model to obtain target question and answer information.
[0148] In a possible implementation of this embodiment, the intelligent question answering system performs a knowledge graph search based on the target knowledge graph and the initial question text information to obtain the knowledge graph information corresponding to the initial question text information, including:
[0149] Performing word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information;
[0150] Performing part-of-speech tagging on the question vocabulary information based on the tagging pre-training model to obtain part-of-speech tagging information of the question vocabulary information;
[0151] Setting the question vocabulary information having the same part-of-speech tag as the target part-of-speech tag as the keyword information of the initial question text information;
[0152] Query the target knowledge graph for graph entities and graph information associated with the keyword information, and determine the graph entities and the graph information as the knowledge graph information of the initial question text information.
[0153] In a possible implementation of this embodiment, the intelligent question answering system performs information matching processing on the initial question text information according to the target knowledge base information to obtain target matching knowledge information corresponding to the initial question text information, including:
[0154] Performing feature extraction on the initial question text information to obtain initial question feature information of the initial question text information;
[0155] For each initial question feature information in the initial question text information, the correlation between the initial question feature information and each target knowledge feature information in each target knowledge base information is calculated based on the feature calculation model to obtain feature correlation information corresponding to the initial question feature, wherein the feature correlation information includes a plurality of feature correlations, and each feature correlation corresponds to one target knowledge feature information;
[0156] Among them, the feature correlation is:
[0157] ;
[0158] Wherein, D(V, U) is the feature correlation in the feature correlation information, a, b, c are respectively the first similarity coefficient, the second similarity coefficient and the third similarity coefficient, V is the initial question feature information, and U is the target knowledge feature information of the target knowledge base information;
[0159] The feature correlation in the feature correlation information is greater than the correlation threshold, and is determined as the target feature correlation;
[0160] The target knowledge feature information corresponding to each target feature association degree is determined as the target sub-matching knowledge information in the target matching knowledge information of the initial question text information.
[0161] In a possible implementation of this embodiment, the intelligent question answering system performs feature extraction on the initial question text information to obtain at least one initial question feature information, including:
[0162] Performing word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information;
[0163] Using a feature extraction model to query question vocabulary features associated with the question vocabulary information;
[0164] Perform feature combination processing on the question vocabulary features to obtain initial question feature information.
[0165] In a possible implementation of this embodiment, the intelligent question-answering system inputs the converted text information into a target processing model to obtain target question-answering information, including:
[0166] Generate question prompt information of the initial question text information based on the knowledge graph information corresponding to the initial question text information and / or the target matching knowledge information of the initial question text information;
[0167] Integrate the questions according to the question type of the initial question text information, the question prompt information and the converted text information to obtain target question text information;
[0168] The target question text information is input into the target question answering model to obtain the target question answering information output by the target question answering model.
[0169] In this embodiment, the intelligent question-answering system obtains the initial question text information to be answered; converts the initial question text information to obtain converted text information; integrates the converted text information and the external knowledge information associated with the initial question text information and inputs them into the target question-answering model to obtain the target question-answering information corresponding to the initial question text information. Before the question text is input into a question-answering model such as chatgpt, the initial question text information is converted in advance, and the external knowledge information associated with the initial question text information is also obtained. The converted question text and the external knowledge information are integrated to form a new question text, and the new question text is input into the question-answering model to be input, thereby providing the question-answering model with a more comprehensive question text containing multi-level context information, so as to improve the accuracy of the question-answering model's understanding of the question text, and then output a highly relevant and highly accurate answer corresponding to the question text, which can significantly improve the effectiveness and accuracy of the question-answering model.
[0170] The embodiment of the present invention also provides a text processing device, such as Figure 6 As shown, Figure 6 A schematic diagram of the structure of an embodiment of a text processing device provided in an embodiment of the present application.
[0171] The text processing device integrates any one of the intelligent question-answering systems provided by the embodiments of the present invention, and the text processing device includes:
[0172] one or more processors;
[0173] Memory; and
[0174] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the question-and-answer method described in any of the above-mentioned question-and-answer method embodiments.
[0175] Specifically, the text processing device may include one or more processing core processors 601, one or more computer-readable storage media memories 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will understand that Figure 6 The text processing device structure shown in the figure does not constitute a limitation on the text processing device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0176] The processor 601 is the control center of the text processing device. It uses various interfaces and lines to connect various parts of the entire text processing device. By running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, it executes various functions of the text processing device and processes data, thereby monitoring the text processing device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0177] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the text processing device, etc. In addition, the memory 602 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 can also include a memory controller to provide the processor 601 with access to the memory 602.
[0178] The text processing device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0179] The text processing device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0180] Although not shown, the text processing device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 601 in the text processing device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:
[0181] Get the text information of the initial question to be answered;
[0182] Converting the initial question text information to obtain converted text information;
[0183] The converted text information and the external knowledge information associated with the initial question text information are integrated and input into a target question-answering model to obtain target question-answering information corresponding to the initial question text information.
[0184] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the question-answering methods provided in the embodiment of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:
[0185] Get the text information of the initial question to be answered;
[0186] Converting the initial question text information to obtain converted text information;
[0187] The converted text information and the external knowledge information associated with the initial question text information are integrated and input into a target question-answering model to obtain target question-answering information corresponding to the initial question text information.
[0188] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0189] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0190] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0191] The above is a detailed introduction to a question-and-answer method provided in an embodiment of the present application. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A question-answering method, characterized in that: The question-answering method comprises: Get the initial question text information; Converting the initial question text information to obtain converted text information; Perform knowledge graph retrieval based on the target knowledge graph and the initial question text information to obtain the knowledge graph information corresponding to the initial question text information; Perform information matching processing on the initial question text information according to the target knowledge base information to obtain target matching knowledge information corresponding to the initial question text information; Generate target question text information according to the conversion text information, the target matching knowledge information and the knowledge graph information, input the target question text information into a target processing model, and obtain target question and answer information; Wherein, the target matching knowledge information includes at least one target sub-matching knowledge information; The performing information matching processing on the initial question text information according to the target knowledge base information to obtain the target matching knowledge information corresponding to the initial question text information includes: Performing feature extraction on the initial question text information to obtain at least one initial question feature information; For any of the initial question feature information, the correlation between the initial question feature information and each target knowledge feature information in the target knowledge base information is calculated based on the feature calculation model to obtain feature correlation information corresponding to the initial question feature, wherein the feature correlation information includes a plurality of feature correlations, each of which corresponds to one target knowledge feature information; Among them, the feature correlation is: ; Wherein, D(V, U) is the feature correlation in the feature correlation information, a, b, c are the first similarity coefficient, the second similarity coefficient and the third similarity coefficient respectively, V is the initial question feature information, and U is the target knowledge feature information of the target knowledge base information; the first similarity coefficient, the second similarity coefficient and the third similarity coefficient are all values not less than 0 and not greater than 1; Determine the feature correlation degree greater than the correlation threshold in the feature correlation degree information as the target feature correlation degree; The target knowledge feature information corresponding to each target feature association degree is determined as the target sub-matching knowledge information in the target matching knowledge information of the initial question text information.
2. The method according to claim 1, characterized in that: The converting process of the initial question text information to obtain converted text information includes: Performing text segmentation and classification processing on the initial question text information to obtain question vocabulary information; The initial question text information is converted according to the question vocabulary information to obtain converted text information.
3. The method according to claim 2, characterized in that The question vocabulary information includes first entity information and / or first predicate information; The step of performing text segmentation and classification processing on the initial question text information to obtain question vocabulary information includes: Performing word segmentation processing on the initial question text information to obtain question vocabulary information of the initial question text information; The question vocabulary information is subjected to vocabulary classification processing according to the conversion text model to obtain first entity information and first predicate information in the question vocabulary information.
4. The method according to claim 2, characterized in that: The converting the initial question text information according to the question vocabulary information to obtain the converted text information includes: Determining a conversion question template corresponding to the initial question text information according to the question identification information of the initial question text information; The first entity information in the question vocabulary information and / or the first predicate information in the question vocabulary information are filled into the conversion question template to obtain conversion text information.
5. The method according to claim 1, characterized in that The performing of knowledge graph retrieval according to the target knowledge graph and the initial question text information to obtain the knowledge graph information corresponding to the initial question text information includes: Performing word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information; Performing part-of-speech tagging on the question vocabulary information based on the tagging pre-training model to obtain a part-of-speech tag for the question vocabulary information; Determine the question vocabulary information having the same part-of-speech tag as the keyword information of the initial question text information; Query the target knowledge graph for graph entities and graph information associated with the keyword information, and determine the graph entities and the graph information as the knowledge graph information of the initial question text information.
6. The method according to claim 1, characterized in that The extracting features of the initial question text information to obtain at least one initial question feature information includes: Performing word segmentation preprocessing on the initial question text information to obtain question vocabulary information of the initial question text information; Using a feature extraction model to query question vocabulary features associated with the question vocabulary information; Perform feature combination processing on the question vocabulary features to obtain initial question feature information.
7. The method according to any one of claims 1 to 6, characterized in that: The step of generating target question text information according to the conversion text information, the target matching knowledge information and the knowledge graph information, and inputting the target question text information into a target processing model to obtain target question and answer information includes: Based on the knowledge graph information corresponding to the initial question text information, and / or the target matching knowledge information of the initial question text information, generate question prompt information of the initial question text information; Integrate the questions according to the question type of the initial question text information, the question prompt information and the converted text information to obtain target question text information; The target question text information is input into the target question answering model to obtain the target question answering information output by the target question answering model.
8. An intelligent question-answering system, characterized in that: The intelligent question answering system comprises: A question acquisition module is configured to acquire initial question text information; A question conversion module is configured to convert the initial question text information to obtain converted text information; The question answering module is configured to perform knowledge graph retrieval according to the target knowledge graph and the initial question text information to obtain the knowledge graph information corresponding to the initial question text information, perform information matching processing on the initial question text information according to the target knowledge base information to obtain the target matching knowledge information corresponding to the initial question text information, generate the target question text information according to the converted text information, the target matching knowledge information and the knowledge graph information, input the target question text information into the target processing model to obtain the target question answering information, wherein the target matching knowledge information includes at least one target sub-matching knowledge information; the target matching knowledge information is matched according to the target knowledge base information to obtain the target matching knowledge information corresponding to the initial question text information; the target matching knowledge information is matched according to the target knowledge base information to obtain the target matching knowledge ... The knowledge base information performs information matching processing on the initial question text information to obtain target matching knowledge information corresponding to the initial question text information, including: extracting features from the initial question text information to obtain at least one initial question feature information; for any of the initial question feature information, calculating the correlation between the initial question feature information and each target knowledge feature information in the target knowledge base information based on a feature calculation model to obtain feature correlation information corresponding to the initial question feature, wherein the feature correlation information includes a plurality of feature correlations, each feature correlation corresponding to one target knowledge feature information; wherein the feature correlation is: ; Wherein, D(V, U) is the feature correlation in the feature correlation information, a, b, c are the first similarity coefficient, the second similarity coefficient and the third similarity coefficient respectively, V is the initial question feature information, and U is the target knowledge feature information of the target knowledge base information; the first similarity coefficient, the second similarity coefficient and the third similarity coefficient are all values not less than 0 and not greater than 1; Determine the feature correlation degree greater than the correlation threshold in the feature correlation degree information as the target feature correlation degree; The target knowledge feature information corresponding to each target feature association degree is determined as the target sub-matching knowledge information in the target matching knowledge information of the initial question text information.
9. A text processing device, characterized in that: The text processing device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the question-answering method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of the question-answering method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Auxiliary teaching method and device based on artificial intelligence
CN116662494A
Question and answer method and device, electronic equipment and storage medium
CN117473056A
Generative question answering method and device based on knowledge graph and storage medium
CN118069817A