Question and answer method, device, equipment and storage medium
By encoding and labeling candidate entities and relations in natural language question answering, a third text vector is generated, which solves the problem of insufficient answer accuracy in existing technologies and achieves more accurate question answering results.
Patent Information
- Application Number
- CN202211175960.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-09-26
AI Technical Summary
Existing technologies in natural language question answering have poor accuracy and cannot effectively distinguish textual features of candidate entities and relationships.
By identifying candidate entities and their relationships based on the question text, first and second text vectors are obtained by encoding them respectively, and then labels are added for encoding to generate a third text vector, in order to distinguish candidate entities and relationships and improve the accuracy of the answer.
It improves the accuracy of question-answering methods, ensuring that the textual features of candidate entities and relationships are correctly represented, thereby more accurately determining the answer text.
Smart Images

Figure CN115455168B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more particularly to a question-answering method, apparatus, device, and storage medium. Background Technology
[0002] In the field of human-computer interaction, natural language question answering (NLE) is a very mainstream task. NLE refers to providing answers directly to natural language questions posed by users using various technologies and data. Currently, when performing question answering, the general approach is to search for answers related to the user's question in a knowledge base, directly encode the relevant answers to obtain the final answer, which results in a relatively poor accuracy. Summary of the Invention
[0003] According to a first aspect of the embodiments of this application, a question-and-answer method is provided, including:
[0004] Based on the question text, candidate entities and corresponding candidate relationships are determined.
[0005] The candidate entities and the candidate relationships are encoded respectively to obtain a first text vector corresponding to the candidate entity and a second text vector corresponding to the candidate relationship;
[0006] The first text vector, the second text vector, the first label, and the second label are encoded to obtain a third text vector; wherein the first label is used to label the candidate entity, and the second label is used to label the candidate relationship;
[0007] Using the third text vector, determine the answer text corresponding to the question text.
[0008] According to a second aspect of the embodiments of this application, a question-answering device is provided, characterized in that it includes:
[0009] The determination module is used to determine candidate entities and candidate relationships corresponding to the candidate entities based on the question text;
[0010] The encoding module is used to encode the candidate entity and the candidate relationship respectively, so as to obtain the first text vector corresponding to the candidate entity and the second text vector corresponding to the candidate relationship respectively;
[0011] The processing module is used to encode the first text vector, the second text vector, the first label, and the second label to obtain a third text vector; wherein the first label is used to mark the candidate entity, and the second label is used to mark the candidate relationship;
[0012] The question-and-answer module is used to determine the answer text corresponding to the question text using the third text vector.
[0013] The third aspect of the application provides an electronic device, comprising:
[0014] Memory and processor;
[0015] The memory is connected to the processor and is used to store programs;
[0016] The processor implements the above-described question-and-answer method by running the program in the memory.
[0017] The eighth aspect of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described question-and-answer method.
[0018] An embodiment of the above application has the following advantages or beneficial effects: Based on the question text, candidate entities and corresponding candidate relationships are determined. The candidate entities and their corresponding relationships are encoded to obtain a first text vector corresponding to the candidate entity and a second text vector corresponding to the candidate relationship, thereby preserving the textual features of different texts. Then, the first text vector, the second text vector, the first label, and the second label are encoded to obtain a third text vector. Since the first label is used to mark candidate entities and the second label is used to mark candidate relationships, the third text vector distinguishes between candidate entities and candidate relationships, preventing the differences in data distribution from being weakened. Therefore, the third text vector more accurately represents the question text, making the determination of the answer text corresponding to the question text more accurate. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0021] Figure 2 A flowchart illustrating a question-and-answer method provided in another embodiment of this application;
[0022] Figure 3 A flowchart illustrating a question-and-answer method provided in another embodiment of this application;
[0023] Figure 4 A schematic diagram illustrating the determination of the target entity and its category representation vector provided in an embodiment of this application;
[0024] Figure 5 A schematic diagram illustrating the splicing of problem text based on a matrix of target entities and categories provided in the embodiments of this application;
[0025] Figure 6 A schematic diagram of the representation vectors for determining candidate entities and candidate relationships provided in an embodiment of this application;
[0026] Figure 7 This is a schematic diagram of the structure of a question-and-answer device provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] Exemplary methods
[0030] Figure 1 This is a flowchart of a question-and-answer method according to an embodiment of this application. In an exemplary embodiment, a question-and-answer method is provided, including:
[0031] S110. Determine candidate entities and candidate relationships corresponding to the candidate entities based on the question text;
[0032] S120. Encode the candidate entity and the candidate relationship respectively to obtain the first text vector corresponding to the candidate entity and the second text vector corresponding to the candidate relationship;
[0033] S130. Encode the first text vector, the second text vector, the first label, and the second label to obtain a third text vector; wherein, the first label is used to mark the candidate entity, and the second label is used to mark the candidate relationship;
[0034] S140. Using the third text vector, determine the answer text corresponding to the question text.
[0035] It should be noted that this application proposes a question-and-answer method, which is generally used in human-computer interaction scenarios. Human-computer interaction scenarios refer to users asking questions to terminal devices. The execution entity of this question-and-answer method can be the terminal device or a cloud server. In this application embodiment, the terminal device can be a mobile phone, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal device in industrial control, wireless terminal device in self-driving, wireless terminal device in remote medical care, wireless terminal device in smart grid, wireless terminal device in transportation safety, wireless terminal device in smart city, or wireless terminal device in smart home, etc.
[0036] By way of example and not limitation, in this embodiment, the terminal device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0037] In step S110, for example, the question text is used to reflect the question raised by the user to the terminal device in a human-computer interaction scenario. The question text can be text obtained from the user's voice or text. Optionally, when the user sends voice, the voice needs to be converted into text. Optionally, the question text can include one or more entities, where an entity is an abstract object of a person or thing. Optionally, the entity can be extracted from a dictionary or be custom-defined. The candidate entity represents an entity related to the question text. The candidate entity can be an entity directly found in the database based on the question text, or it can be a candidate entity obtained by first extracting entities from the question text and then finding them in the database. Therefore, each question text can correspond to one or more candidate entities.
[0038] For example, a candidate relation represents a relationship related to a candidate entity in a knowledge graph, where the knowledge graph describes various entities and concepts existing in the real world, and the relationships between them. Entities and relations in the knowledge graph are stored in the form of triples, i.e., (head entity, relation, tail entity), for example, (front air conditioner, turn-on method: turn the fan speed button to 1 or higher to turn on the air conditioner). The knowledge graph can be a general knowledge graph pre-generated for any scenario, or it can be a knowledge graph generated for a specific scenario. Optionally, the knowledge graph can pre-store the correspondence between each candidate entity and its candidate relations. It can be one candidate entity corresponding to one candidate relation, or one candidate entity corresponding to multiple candidate relations. For example, based on user-input voice information, the voice information is converted into question text, and candidate entities obtained directly from the question text are used to determine the corresponding candidate relations in the knowledge graph.
[0039] In step S120, for example, the first text vector is a representation vector of the candidate entity, and the first text vector is encoded into a matrix (length * encoding dimension) by the candidate entity through an encoding model. The second text vector is a representation vector of the candidate relation, and the second text vector is encoded into a matrix (length * encoding dimension) by the candidate relation through an encoding model. Optionally, the encoding model may include: BERT model (Bidirectional Encoder Representations from Transformer), long short-term memory model (LSTM), etc.
[0040] For example, when multiple entities are extracted from the question text, candidate entities and their corresponding candidate relations are determined based on each extracted entity. The candidate entities and relations can be concatenated separately according to the order of the extracted entities. Furthermore, since the text distribution of entities and relations differs—entities may be more specialized and knowledge-based, while candidate relations are more colloquial and open—directly encoding both entity and relation texts uniformly would disrupt the encoding model's ability to encode different texts. Therefore, the concatenated candidate entities and concatenated candidate relations are encoded separately to obtain a first text vector and a second text vector, ensuring that the first and second text vectors retain the textual features of different texts.
[0041] In step S130, exemplarily, the third text vector is a representation vector of candidate entities and candidate relations. Therefore, the third text vector is obtained from the first text vector corresponding to the candidate entity and the second text vector corresponding to the candidate relation. To distinguish between candidate entities and candidate relations in the third text vector, a first label for marking candidate entities and a second label for marking candidate relations are added during the encoding process. Optionally, the first label is a sequence or vector composed of first identifiers, and the second label is a sequence or vector composed of second identifiers. To ensure that the first and second labels can be encoded together with the first and second text vectors, the length of the sequence or vector corresponding to the first label can be the same as the number of characters in the candidate entity, and the length of the sequence or vector corresponding to the second label can be the same as the number of characters in the candidate relation. For example, the first text vector, the second text vector, the first label, and the second label can be directly encoded together using an encoding model to obtain the third text vector. Alternatively, the first and second text vectors can be concatenated or merged to obtain a processed text vector, and the first and second labels can be concatenated or merged to obtain a processed label vector. Then, the processed text vector and the processed label vector are encoded by an encoder to obtain the third text vector.
[0042] In step S140, for example, the question text and the third text vector can be compared to determine whether the candidate entities and candidate relations in the third text vector match the question text. Based on the matching result, the answer text corresponding to the question text can be determined. Optionally, if a match is found, the tail entity corresponding to the candidate entity and candidate relation can be searched in the knowledge graph, and the tail entity can be used as the answer text corresponding to the question text. If no match is found, the answer text corresponding to the question text cannot be determined.
[0043] In the technical solution of this application, candidate entities and corresponding candidate relationships are determined based on the question text. The candidate entities and their corresponding relationships are then encoded to obtain a first text vector corresponding to the candidate entity and a second text vector corresponding to the candidate relationship, thus preserving the textual features of different texts. The first text vector, the second text vector, the first label, and the second label are then encoded to obtain a third text vector. Since the first label is used to mark candidate entities and the second label is used to mark candidate relationships, the third text vector distinguishes between candidate entities and candidate relationships, preventing the differences in data distribution from being weakened. Therefore, the third text vector more accurately represents the question text, making the determination of the answer text corresponding to the question text more accurate.
[0044] In one implementation, when there are multiple sets of candidate entities and candidate relations corresponding to the candidate entities, the third text vector is used to determine the answer text corresponding to the question text, including:
[0045] Using the third text vector corresponding to each group of candidate entities and their corresponding candidate relations, and the question text, the target candidate entity and its corresponding target candidate relation corresponding to the question text are determined from the multiple groups of candidate entities and their corresponding candidate relations.
[0046] Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
[0047] For example, since at least one entity can be extracted from the question text, each extracted entity can correspond to multiple candidate entities, and each candidate entity can correspond to multiple candidate relations. Therefore, each question text can have multiple sets of candidate entities and candidate relations corresponding to the candidate entities. Optionally, the multiple sets of candidate relations are encoded separately to obtain multiple second text vectors. For each second text vector, it is encoded by combining a first text vector, a first label, and a second label to obtain a corresponding third text vector. It can be understood that encoding multiple second text vectors separately can obtain multiple third text vectors. The question text can be matched with each third text vector, and the target text vector is determined from the multiple third text vectors based on the matching results. Optionally, text similarity can be used to judge the matching results, or a pre-trained text matching model can be used to judge the matching results. Optionally, the matching results between the question text and each third text vector can be scored, and the target text vector can be determined based on the score; or the matching results can be directly compared to directly determine the target text vector. Then, based on the target text vector, the corresponding candidate entities and their corresponding candidate relations are determined as the target candidate entities and their corresponding target candidate relations, thus more accurately identifying the target candidate entities and their corresponding target candidate relations. Furthermore, based on the target candidate entities and their corresponding target candidate relations, the corresponding tail entities can be found in the knowledge graph, and these tail entities are used as the answer text corresponding to the question text.
[0048] In one implementation, when there is a set of candidate entities and candidate relations corresponding to the candidate entities, the answer text corresponding to the question text is determined using the third text vector, including:
[0049] If the third text vector and the question text satisfy a preset condition, the candidate entity and its corresponding candidate relationship are determined as the target candidate entity and its corresponding target candidate relationship corresponding to the question text;
[0050] Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
[0051] For example, preset conditions are used to represent the matching result between the third text vector and the question text. Preset conditions may include whether the similarity between the third text vector and the question text exceeds a preset first threshold. The preset first threshold can be set according to actual circumstances and is not limited here.
[0052] Specifically, when only one set of candidate entities and their corresponding candidate relations are identified, it is only necessary to determine whether the similarity between the third text vector and the question text exceeds a first threshold. If so, the candidate entities corresponding to the third text and their corresponding candidate relations are taken as the target candidate entities and their corresponding target candidate relations. Then, based on the target candidate entities and their corresponding target candidate relations, the corresponding tail entities are searched in the knowledge graph, and the tail entities are taken as the answer text corresponding to the question text.
[0053] In one implementation, such as Figure 2 As shown, the first text vector, the second text vector, the first tag, and the second tag are encoded to obtain the third text vector, which includes:
[0054] S210. Concatenate the first label and the second label to obtain the first vector;
[0055] S220. Concatenate the first text vector and the second text vector to obtain the fourth text vector;
[0056] S230. The first vector and the fourth text vector are concatenated to obtain the third text vector.
[0057] For example, candidate entities and candidate relations are encoded separately according to the encoding model, resulting in a first text vector and a second text vector. The first and second text vectors are concatenated along the first dimension to obtain a fourth text vector, which is a matrix of length * encoding dimension. The first and second labels are then concatenated to form a first vector, which is a vector of length * 1. For example, 0 represents each character in a candidate entity and 1 represents characters and separators in a candidate relation. The first and fourth text vectors are then concatenated along the second dimension to obtain a third text vector, which is a matrix of length * encoding dimension + 1. This ensures that the resulting third text vector better represents the question text.
[0058] Furthermore, the third text vector can be compressed through a fully connected layer to obtain the final third text vector, which is a matrix of (length * encoding dimension). This maintains the encoding dimension unchanged, making it easier to compare the question text with the third text vector.
[0059] In one implementation, using a third text vector corresponding to each group of candidate entities and their corresponding candidate relationships, and the question text, the target candidate entity and its corresponding target candidate relationship corresponding to the question text are determined from the plurality of groups of candidate entities and their corresponding candidate relationships, including:
[0060] The fifth text vector is obtained by encoding the question text and the third tag; wherein the third tag is used to mark the question text.
[0061] Calculate the similarity between the third text vector and the fifth text vector corresponding to each group of candidate entities and their corresponding candidate relationships;
[0062] Based on the similarity corresponding to each of the third text vectors, the target candidate entity and its corresponding target candidate relationship corresponding to the question text are determined from the multiple sets of candidate entities and their corresponding candidate relationships.
[0063] For example, the third label is a sequence or vector composed of third identifiers. Since the third label is not in the same matrix as the first and second labels, the third identifier used to represent the third label can be the same as the first identifier used to represent the first label and the second identifier used to represent the second label. To facilitate similarity comparison between the question text and the third text vector, after encoding the question text in the first dimension, the encoded question text and the third label are concatenated in the second dimension to obtain the fifth text vector, which is a matrix of length * (encoding dimension + 1)). Further, the fifth text vector can be compressed through a fully connected layer to obtain the final fifth text vector, which is a matrix of length * encoding dimension. When there are multiple sets of candidate entities and their corresponding candidate relations, the cosine similarity between the third text vector and the fifth text vector corresponding to each set of candidate entities and their corresponding candidate relations is calculated to obtain a similarity score between each third text vector and the fifth text vector. The third text vector with the highest similarity score is then used as the target text vector. Based on the target text vector, the corresponding candidate entities and their corresponding candidate relations are determined, thereby determining the answer text corresponding to the question text.
[0064] In one implementation, such as Figure 3 As shown, determining candidate entities and their corresponding candidate relationships based on the question text includes:
[0065] S310. Determine the target entity in the question text and the category of the target entity based on the question text;
[0066] S320. Using the question text, the target entity, and the category of the target entity, determine the candidate entity in the database;
[0067] S330. Determine the corresponding candidate relationship based on the candidate entity.
[0068] For example, the target entity represents an entity extracted from the question text. The category of the target entity represents the category corresponding to the entity extracted from the question text, such as component, function, location, condition, maintenance, etc. Optionally, the target entity and its category can be extracted using a pre-trained neural network model. Alternatively, after identifying the target entity from the question text, its corresponding category can be determined.
[0069] For example, a database is used to store candidate entities. The database can be a database that only stores entities, or it can store a knowledge graph of entities and their various relationships. Optionally, the database can be initially screened using the question text to obtain preliminary entities, and then further screened using the target entity and its category to obtain candidate entities. First, preliminary entities are obtained by initial screening in the database based on the target entity and its category. Then, the preliminary entities are further screened using the question text to obtain candidate entities. The knowledge graph is then invoked to determine the candidate relationships corresponding to the candidate targets. It is evident that by incorporating the category of the target entity into the screening process, the selected candidate entities are more accurate, thus leading to more accurate candidate relationships.
[0070] In one implementation, determining the target entity and its category within the question text based on the question text includes:
[0071] Based on the application scenario of the problem text, determine the corresponding neural network model;
[0072] The neural network model is used to process the question text to obtain the target entity and the category of the target entity.
[0073] For example, application scenarios can include automotive, medical, and educational scenarios. A neural network model, such as a Named Entity Recognition (NER) model, can be trained for each scenario. This allows the trained neural network model to identify the target entities and their categories in the question text for different application scenarios, more accurately representing the user's question and thus more accurately selecting candidate entities.
[0074] In this embodiment, taking the automotive scenario as an example, in the automotive field, the following categories are defined: Components, corresponding to entities such as engine and steering wheel; Functions, corresponding to entities such as cruise control and economy mode; Locations, corresponding to entities such as front and rear seats; Conditions, corresponding to entities such as while driving, when the engine is off, winter, and summer; Maintenance, corresponding to entities such as first maintenance, major maintenance, and second maintenance; Insurance Types, corresponding to entities such as self-ignition insurance and mandatory insurance; and Emission Standards, corresponding to entities such as China V and China VI. Based on this, automotive information can be collected through the above classification methods, and the collected automotive information can be used to train a named entity recognition model. For example, the named entity recognition model can adopt a sequence labeling model framework, such as a bidirectional long-short-term memory network (Bi-LSTM) combined with a conditional random field (CRF). The input layer takes user text, and each character is represented by a 256-dimensional vector. A BiLSTM layer is then used as the feature encoding layer to extract contextual features for each character. These bidirectional features are then concatenated, and the features for each character are output. Next, a CRF layer multiplies the output of the LSTM at each time step by a state transition matrix for probability transition. Finally, the probability of each character on each label is obtained, thus revealing the target entity and its category in the question text.
[0075] In one implementation, candidate entities are determined in a database using the question text, the target entity, and the category of the target entity, including:
[0076] The target entity and the category are encoded to obtain a sixth text vector;
[0077] The question text is encoded to obtain the seventh text vector;
[0078] The sixth text vector and the seventh text vector are concatenated to obtain the eighth text vector;
[0079] The candidate entity is determined in the database by using the similarity between the vector corresponding to the entity in the database and the eighth text vector.
[0080] For example, the sixth text vector is a representation vector of the target entity and its category. Optionally, the sixth text vector can be obtained by concatenating the target entity and category after encoding them separately, or by encoding the target entity and category together. The seventh text vector is a representation vector of the question text. Optionally, when concatenating the seventh text vector with other vectors, in order to maintain consistency with the dimensions of other vectors, a vector with the same number of characters as the question text is concatenated into the seventh text vector. For example, a vector represented by the character 0 is concatenated with the seventh text vector. The eighth text vector is a representation vector of the entity and the user's question. Optionally, the eighth text vector can be obtained by concatenating the sixth text vector after the seventh text vector, or by concatenating the seventh text vector after the sixth text vector.
[0081] For example, each entity in the database is encoded using an encoding model to obtain a representation vector for each entity, with a size of (entity text length * encoding dimension). Then, a cosine similarity calculation is performed between each entity's representation vector and the eighth text vector; the result is a decimal between 0 and 1. Entities whose similarity score is greater than a preset second threshold are identified as candidate entities. The preset second threshold can be set according to actual conditions.
[0082] In one implementation, concatenating the sixth text vector and the seventh text vector to obtain an eighth text vector includes:
[0083] The sixth text vector, the seventh text vector, the third tag, and the fourth tag are encoded to obtain the eighth text vector; wherein the third tag is used to mark the question text, and the fourth tag is used to mark the target entity.
[0084] For example, since the eighth text vector includes both the target entity and the question text, and the text distribution of the target entity differs from that of the colloquial question text, a third label for labeling the question text and a fourth label for labeling the target entity are introduced to distinguish these different text distributions so that the model can learn different representations. Optionally, the third label is a sequence or vector composed of third identifiers, and the length of the sequence or vector corresponding to the third label is the same as the number of characters in the question text; the fourth label is a sequence or vector composed of fourth identifiers, and the length of the sequence or vector corresponding to the fourth label is the same as the number of characters in the target entity. For example, the third identifier can be 0, and the fourth identifier can be 1. In this way, by encoding based on the sixth text vector, the seventh text vector, the third label, and the fourth label, the eighth text vector can distinguish the differences in the distribution of different texts.
[0085] Preferably, the sixth text vector, the seventh text vector, the third tag, and the fourth tag are encoded to obtain the eighth text vector, including:
[0086] The third label and the fourth label are concatenated to obtain the second vector;
[0087] The sixth text vector and the seventh text vector are concatenated to obtain the ninth text vector;
[0088] The second vector and the ninth text vector are concatenated to obtain the eighth text vector.
[0089] For example, since the sixth text vector is the representation vector of the target entity and its category, optionally, when the sixth text vector has two dimensions, that is, the representation vector of the target entity's category is concatenated to the representation vector of the target entity. Then, the seventh text vector needs to be concatenated with a vector to maintain the consistency of the dimensions of the sixth and seventh text vectors. Therefore, a vector with all characters equal to the length of the encoding result corresponding to the question text and the encoding result corresponding to the question text can be concatenated in the second dimension to obtain the ninth text vector, where the ninth text vector is a matrix of ((entity length + question length) * (encoding dimension + 1)). Then, the third and fourth labels are concatenated to form the second vector, where the second vector is a vector of ((entity length + question length) * 1). For example, 0 represents characters in the target entity and 1 represents characters in the question text. The second vector is then concatenated with the ninth text vector in the second dimension to obtain the eighth text vector, where the eighth text vector is a matrix of ((entity length + question length) * (encoding dimension + 2)). By adding third and fourth labels to represent the target entity and the question's representation vector (i.e., the eighth text vector), we can better distinguish the textual features between the entity and question texts, and find more accurate candidate entities in the database.
[0090] Furthermore, the eighth text vector can be compressed through a fully connected layer to obtain the final third text vector, which is a matrix of ((entity length + question length) * encoding dimension).
[0091] In one implementation, the target entity and the category are encoded to obtain a sixth text vector, including:
[0092] Determine the category number corresponding to each of the categories;
[0093] The target entity is encoded to obtain the tenth text vector;
[0094] Using the encoding order of the target entities, the category numbers of the target entities are concatenated to obtain a third vector;
[0095] The tenth text vector and the third vector are concatenated to obtain the sixth text vector.
[0096] For example, for each entity category, a list of numbers needs to be defined first, with each category corresponding to a category number, i.e., a single number. For example, Component: 1, Function: 2, Condition: 3, Fault: 4, Displacement: 5, etc.
[0097] For example, the encoding model encodes the target entity to obtain a tenth text vector, which is a matrix of (entity length * encoding dimension). The category corresponding to the target entity is then determined, and each target entity is represented by a corresponding category number, with the category number having the same length as the target entity. Thus, a third vector is formed based on the category numbers, which is a vector of (entity length * 1). This third vector is then concatenated onto the tenth text vector along the second dimension to obtain the representation vector of the target entity and its category (i.e., the sixth text vector), thereby enabling more accurate differentiation of the target entity.
[0098] In one application example, a question-and-answer method may include:
[0099] A set of protocols is pre-defined based on requirements. These protocols include the entities needed in the target scenario and their corresponding types. Taking the automotive scenario as an example, the entities and types mentioned above are extracted from the automotive domain to train the NER model, resulting in a trained NER model.
[0100] like Figure 4 As shown, the user's question text is taken as input to the NER model, and the NER model outputs the target entities in the question text. For example, in the question "What should I do if the engine makes abnormal noise when the air conditioner is on?", the target entities are extracted as: air conditioner, engine, abnormal noise. First, the text of the target entities is concatenated, and then the concatenated target entities are encoded into a matrix of (entity length * encoding dimension) using a BERT or LSTM encoder. Then, for each entity category, a list of numbers needs to be defined, with each category corresponding to a number. For example, parts: 1, function: 2, condition: 3, fault: 4, displacement: 5, etc. Then, each word of the target entity is represented as the corresponding number, thus forming a vector of (entity length * 1). For example, condition: air conditioner on, parts: engine, fault: abnormal noise. The resulting vector is 333 111 44. Then, the representation vector of the target entities and the representation vector of the categories are concatenated in the second dimension to obtain a matrix of (entity length * (encoding dimension + 1)), that is, the matrix of target entities and categories.
[0101] like Figure 5As shown, the question text needs to be concatenated onto the target entity and category matrices. However, to maintain dimensional consistency during concatenation, the second dimension of the question text is filled with 0s. At this point, the size of the target entity and question text representation matrix becomes ((entity length + question length) * (encoding dimension + 1)). Since the text distribution of the target entity differs from that of the colloquial question text, a token type ID is introduced to differentiate them so the model can learn different representations. 0 represents characters in the target entity (i.e., the fourth label), and 1 represents characters in the question text (i.e., the third label). Based on these characters, a vector of ((entity length + question length) * 1) is obtained. This ((entity length + question length) * 1) vector is then concatenated onto the previous target entity and question text representation matrix. The size of the concatenated target entity and question text representation matrix becomes ((entity length + question length) * (encoding dimension + 2)). Then, a fully connected layer is used to compress the above matrix, making its size ((entity length + question length) * encoding dimension). This matrix is the final representation matrix of the target entity and question text in the entity linking process.
[0102] Next, we encode each entity in the knowledge graph using the BERT model, obtaining a representation vector for each entity, with a size of (entity text length * encoding dimension). Then, we calculate the cosine similarity between each entity's representation vector and the final representation matrices of the target entity and the question text, resulting in a decimal between 0 and 1. Entities whose similarity score is greater than a preset second threshold are selected as candidate entities, while those whose score is not greater than the preset second threshold are eliminated. The preset second threshold can be set to 0.7, or other values, which are not limited here. Candidate entities are the head entities in the knowledge graph; therefore, using the knowledge graph, we can determine the candidate relations corresponding to each candidate entity, that is, what relational knowledge this entity contains. This process yields all candidate entity-relation pairs.
[0103] like Figure 6As shown, the question text is first encoded using the BERT model to obtain its representation vector. To maintain dimensionality consistency, 1 represents the question text, and a vector of 1 is concatenated after the question text's representation vector to obtain the final representation matrix. Then, each candidate entity and candidate relation is encoded using the BERT model separately. The encoded results of the candidate entities and candidate relations are then concatenated to obtain the representation matrix of the candidate entities and candidate relations, which is a matrix of length * encoding dimension. Each candidate entity and its corresponding candidate relation are connected by a special character. A token type id is introduced, with 0 representing the characters of each candidate entity (i.e., the first label) and 1 representing the characters of each candidate relation and the separator (i.e., the second label), forming a vector of length * 1. This vector is then concatenated with the representation matrix of the candidate entities and candidate relations in the second dimension to obtain a matrix of length * (encoding dimension + 1). This matrix is then passed through a fully connected layer to obtain a matrix of length * encoding dimension, which is the final representation matrix of each candidate entity and candidate relation. Then, the cosine similarity between the final representation matrix of each candidate entity and candidate relation and the final representation matrix of the question text is calculated. The result will be a decimal between 0 and 1. The candidate entity and candidate relation with the highest calculated result are selected. Based on the above candidate entities and candidate relations, the tail entity is determined in the knowledge graph and used as the answer text. Optionally, if the highest calculated result is less than a preset first threshold, then it can be considered that there is no correct answer to the question text in this knowledge graph.
[0104] Exemplary device
[0105] Correspondingly, Figure 7 This is a schematic diagram of a question-and-answer device according to an embodiment of this application. In an exemplary embodiment, a question-and-answer device is provided, including:
[0106] The determination module 710 is used to determine candidate entities and candidate relationships corresponding to the candidate entities based on the question text;
[0107] The encoding module 720 is used to encode the candidate entity and the candidate relationship respectively, so as to obtain the first text vector corresponding to the candidate entity and the second text vector corresponding to the candidate relationship respectively.
[0108] Processing module 730 is used to encode the first text vector, the second text vector, the first label, and the second label line to obtain a third text vector; wherein the first label is used to mark the candidate entity, and the second label is used to mark the candidate relationship;
[0109] The question-and-answer module 740 is used to determine the answer text corresponding to the question text using the third text vector.
[0110] In one implementation, when there are multiple sets of candidate entities and candidate relationships corresponding to the candidate entities, the question-answering module 740 includes:
[0111] Using the third text vector corresponding to each group of candidate entities and their corresponding candidate relations, and the question text, the target candidate entity and its corresponding target candidate relation corresponding to the question text are determined from the multiple groups of candidate entities and their corresponding candidate relations.
[0112] Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
[0113] In one implementation, when there is a set of candidate entities and candidate relationships corresponding to the candidate entities, the question-answering module 740 includes:
[0114] If the third text vector and the question text satisfy a preset condition, the candidate entity and its corresponding candidate relationship are determined as the target candidate entity and its corresponding target candidate relationship corresponding to the question text;
[0115] Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
[0116] In one embodiment, the processing module 730 includes:
[0117] The first label and the second label are concatenated to obtain the first vector;
[0118] The first text vector and the second text vector are concatenated to obtain the fourth text vector;
[0119] The first vector and the fourth text vector are concatenated to obtain the third text vector.
[0120] In one implementation, determining the target candidate entity and its corresponding target candidate relationship from the multiple sets of candidate entities and their corresponding candidate relationships using a third text vector corresponding to each set of candidate entities and their corresponding candidate relationships and the question text includes:
[0121] The fifth text vector is obtained by encoding the question text and the third tag; wherein the third tag is used to mark the question text.
[0122] Calculate the similarity between the third text vector and the fifth text vector corresponding to each group of candidate entities and their corresponding candidate relationships;
[0123] Based on the similarity corresponding to each of the third text vectors, the target candidate entity and its corresponding target candidate relationship corresponding to the question text are determined from the multiple sets of candidate entities and their corresponding candidate relationships.
[0124] In one embodiment, the determining module 710 further includes:
[0125] Based on the question text, determine the target entity in the question text and the category of the target entity;
[0126] Using the question text, the target entity, and the category of the target entity, the candidate entity is determined in the database;
[0127] Based on the candidate entities, the corresponding candidate relationships are determined.
[0128] In one implementation, determining the target entity and its category in the question text based on the question text includes:
[0129] Based on the application scenario of the problem text, determine the corresponding neural network model;
[0130] The neural network model is used to process the question text to obtain the target entity and the category of the target entity.
[0131] In one implementation, determining candidate entities in a database using the question text, the target entity, and the category of the target entity includes:
[0132] The target entity and the category are encoded to obtain a sixth text vector;
[0133] The question text is encoded to obtain the seventh text vector;
[0134] The sixth text vector and the seventh text vector are concatenated to obtain the eighth text vector;
[0135] The candidate entity is determined in the database by using the similarity between the vector corresponding to the entity in the database and the eighth text vector.
[0136] In one implementation, obtaining the eighth text vector based on the sixth text vector and the seventh text vector includes:
[0137] The sixth text vector, the seventh text vector, the third tag, and the fourth tag are encoded to obtain the eighth text vector; wherein the third tag is used to mark the question text, and the fourth tag is used to mark the target entity.
[0138] In one implementation, concatenating the sixth text vector and the seventh text vector to obtain an eighth text vector includes:
[0139] The third label and the fourth label are concatenated to obtain the second vector;
[0140] The sixth text vector and the seventh text vector are concatenated to obtain the ninth text vector;
[0141] The second vector and the ninth text vector are concatenated to obtain the eighth text vector.
[0142] In one implementation, wherein,
[0143] The first label is a sequence or vector composed of a first identifier, and the length of the sequence or vector corresponding to the first label is the same as the number of characters in the candidate entity;
[0144] The second label is a sequence or vector composed of a second identifier, and the length of the sequence or vector corresponding to the second label is the same as the number of candidate relation characters;
[0145] The third label is a sequence or vector composed of a third identifier, and the length of the sequence or vector corresponding to the third label is the same as the number of characters in the question text.
[0146] The fourth label is a sequence or vector composed of a fourth identifier, and the length of the sequence or vector corresponding to the fourth label is the same as the number of characters in the target entity.
[0147] In one implementation, encoding the target entity and the category to obtain a sixth text vector includes:
[0148] Determine the category number corresponding to each of the categories;
[0149] The target entity is encoded to obtain the tenth text vector;
[0150] Using the encoding order of the target entities, the category numbers of the target entities are concatenated to obtain a third vector;
[0151] The tenth text vector and the third vector are concatenated to obtain the sixth text vector.
[0152] The apparatus provided in this embodiment belongs to the same concept as the method provided in the above embodiments of this application, and can execute the method provided in any of the above embodiments of this application, possessing the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the specific processing content of the method provided in the above embodiments of this application, and will not be repeated here.
[0153] Exemplary electronic devices
[0154] Another embodiment of this application also provides an electronic device, see [link to relevant documentation] Figure 8 As shown, the device includes:
[0155] Memory 800 and processor 810;
[0156] The memory 800 is connected to the processor 810 and is used to store programs;
[0157] The processor 810 is configured to implement the question-and-answer method disclosed in any of the above embodiments by running the program stored in the memory 800.
[0158] Specifically, the aforementioned electronic device may also include: a bus, a communication interface 820, an input device 830, and an output device 840.
[0159] The processor 810, memory 800, communication interface 820, input device 830, and output device 840 are interconnected via a bus. Among them:
[0160] A bus can include a pathway for transmitting information between various components of a computer system.
[0161] The processor 810 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0162] The processor 810 may include a main processor, as well as a baseband chip, modem, etc.
[0163] The memory 800 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 800 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0164] Input device 830 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0165] Output device 840 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0166] The communication interface 820 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0167] The processor 810 executes the program stored in the memory 800 and calls other devices, which can be used to implement the various steps of any of the question-and-answer methods provided in the above embodiments of this application.
[0168] Exemplary computer program products and storage media
[0169] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the question-and-answer methods according to various embodiments of this application as described in the "Exemplary Methods" section of this specification.
[0170] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0171] Furthermore, embodiments of this application may also be storage media storing a computer program, which is executed by a processor in the question-and-answer methods according to various embodiments of this application described in the "Exemplary Methods" section above.
[0172] The specific working content of the aforementioned electronic device, as well as the specific working content of the aforementioned computer program product and the computer program on the storage medium being run by the processor, can all be found in the content of the aforementioned method embodiments, and will not be repeated here.
[0173] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0174] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0175] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0176] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.
[0177] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0178] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0179] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0180] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0181] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0182] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0183] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A question-and-answer method, characterized in that, include: Based on the question text, candidate entities and corresponding candidate relationships are determined. The candidate entities and the candidate relationships are encoded respectively to obtain a first text vector corresponding to the candidate entity and a second text vector corresponding to the candidate relationship; The first text vector, the second text vector, the first label, and the second label are encoded to obtain a third text vector; wherein the first label is used to mark the candidate entity, and the second label is used to mark the candidate relation, so as to distinguish the text distribution of the candidate entity and the candidate relation in the third text vector; Using the third text vector, determine the answer text corresponding to the question text; The step of determining candidate entities and corresponding candidate relationships based on the question text includes: Based on the question text, determine the target entity in the question text and the category of the target entity; Using the question text, the target entity, and the category of the target entity, the candidate entity is determined in the database; Based on the candidate entities, determine the corresponding candidate relationships; The step of determining candidate entities in the database using the question text, the target entity, and the category of the target entity includes: The target entity and the category are encoded to obtain a sixth text vector; The question text is encoded to obtain the seventh text vector; The sixth text vector and the seventh text vector are concatenated to obtain the eighth text vector; The candidate entity is determined in the database by using the similarity between the vector corresponding to the entity in the database and the eighth text vector.
2. The method according to claim 1, characterized in that, When there are multiple sets of candidate entities and candidate relations corresponding to the candidate entities, the third text vector is used to determine the answer text corresponding to the question text, including: Using the third text vector corresponding to each group of candidate entities and their corresponding candidate relations, and the question text, the target candidate entity and its corresponding target candidate relation corresponding to the question text are determined from the multiple groups of candidate entities and their corresponding candidate relations. Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
3. The method according to claim 1, characterized in that, When there is a pair of candidate entities and candidate relations corresponding to the candidate entities, the answer text corresponding to the question text is determined using the third text vector, including: If the third text vector and the question text satisfy a preset condition, the candidate entity and its corresponding candidate relationship are determined as the target candidate entity and its corresponding target candidate relationship corresponding to the question text; Based on the target candidate entities and their corresponding target candidate relationships, the answer text corresponding to the question text is determined in a preset knowledge graph.
4. The method according to any one of claims 1-3, characterized in that, The process of encoding the first text vector, the second text vector, the first tag, and the second tag to obtain the third text vector includes: The first label and the second label are concatenated to obtain the first vector; The first text vector and the second text vector are concatenated to obtain the fourth text vector; The first vector and the fourth text vector are concatenated to obtain the third text vector.
5. The method according to claim 2, characterized in that, The step of determining the target candidate entity and its corresponding target candidate relationship from the multiple sets of candidate entities and their corresponding candidate relationships by using the third text vector corresponding to each set of candidate entities and their corresponding candidate relationships and the question text includes: The fifth text vector is obtained by encoding the question text and the third tag; wherein the third tag is used to mark the question text. Calculate the similarity between the third text vector and the fifth text vector corresponding to each group of candidate entities and their corresponding candidate relationships; Based on the similarity corresponding to each of the third text vectors, the target candidate entity and its corresponding target candidate relationship corresponding to the question text are determined from the multiple sets of candidate entities and their corresponding candidate relationships.
6. The method according to claim 1, characterized in that, The step of determining the target entity and its category in the question text based on the question text includes: Based on the application scenario of the problem text, determine the corresponding neural network model; The neural network model is used to process the question text to obtain the target entity and the category of the target entity.
7. The method according to claim 1, characterized in that, The concatenation of the sixth and seventh text vectors to obtain the eighth text vector includes: The sixth text vector, the seventh text vector, the third tag, and the fourth tag are encoded to obtain the eighth text vector; wherein the third tag is used to mark the question text, and the fourth tag is used to mark the target entity.
8. The method according to claim 7, characterized in that, The process of encoding the sixth text vector, the seventh text vector, the third tag, and the fourth tag to obtain the eighth text vector includes: The third label and the fourth label are concatenated to obtain the second vector; The sixth text vector and the seventh text vector are concatenated to obtain the ninth text vector; The second vector and the ninth text vector are concatenated to obtain the eighth text vector.
9. The method according to claim 8, characterized in that, in, The first label is a sequence or vector composed of a first identifier, and the length of the sequence or vector corresponding to the first label is the same as the number of characters in the candidate entity; The second label is a sequence or vector composed of a second identifier, and the length of the sequence or vector corresponding to the second label is the same as the number of candidate relation characters; The third label is a sequence or vector composed of a third identifier, and the length of the sequence or vector corresponding to the third label is the same as the number of characters in the question text. The fourth label is a sequence or vector composed of a fourth identifier, and the length of the sequence or vector corresponding to the fourth label is the same as the number of characters in the target entity.
10. The method according to claim 1, characterized in that, The encoding of the target entity and the category to obtain the sixth text vector includes: Determine the category number corresponding to each of the categories; The target entity is encoded to obtain the tenth text vector; Using the encoding order of the target entities, the category numbers of the target entities are concatenated to obtain a third vector; The tenth text vector and the third vector are concatenated to obtain the sixth text vector.
11. A question-and-answer device, characterized in that, include: The determination module is used to determine candidate entities and candidate relationships corresponding to the candidate entities based on the question text; The encoding module is used to encode the candidate entity and the candidate relationship respectively, so as to obtain the first text vector corresponding to the candidate entity and the second text vector corresponding to the candidate relationship respectively; The processing module is used to encode the first text vector, the second text vector, the first label, and the second label line to obtain a third text vector; wherein the first label is used to mark the candidate entity, and the second label is used to mark the candidate relation, so as to distinguish the text distribution of the candidate entity and the candidate relation in the third text vector; The question-and-answer module is used to determine the answer text corresponding to the question text using the third text vector; The step of determining candidate entities and corresponding candidate relationships based on the question text includes: Based on the question text, determine the target entity in the question text and the category of the target entity; Using the question text, the target entity, and the category of the target entity, the candidate entity is determined in the database; Based on the candidate entities, determine the corresponding candidate relationships; The step of determining candidate entities in the database using the question text, the target entity, and the category of the target entity includes: The target entity and the category are encoded to obtain a sixth text vector; The question text is encoded to obtain the seventh text vector; The sixth text vector and the seventh text vector are concatenated to obtain the eighth text vector; The candidate entity is determined in the database by using the similarity between the vector corresponding to the entity in the database and the eighth text vector.
12. An electronic device, characterized in that, include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor implements the question-answering method as described in any one of claims 1 to 10 by running the program in the memory.
13. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the question-and-answer method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
End-to-end context-based knowledge base question and answer method and device
CN110059160A
Method and device for training entity recognition model, electronic equipment and storage medium
CN113221564A