CN113886556B - Question answering method and device and electronic equipment - Google Patents
Question answering method and device and electronic equipment Download PDFInfo
- Publication number
- CN113886556B CN113886556B CN202111479666.6A CN202111479666A CN113886556B CN 113886556 B CN113886556 B CN 113886556B CN 202111479666 A CN202111479666 A CN 202111479666A CN 113886556 B CN113886556 B CN 113886556B
- Authority
- CN
- China
- Prior art keywords
- answer
- question
- candidate
- answers
- type
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a question answering method, a question answering device and electronic equipment, wherein the method comprises the following steps: when a question proposed by a user is acquired, processing the question to obtain a plurality of candidate answers of the question; processing the question and the plurality of candidate answers, and determining an answer type of an answer to the question; an answer that can answer the question is determined from the plurality of candidate answers using the answer type of the determined answer. By the question answering method, the question answering device and the electronic equipment, answers for answering questions can be obtained from candidate answers in a matching mode through answer types without inquiring in a knowledge base, and the answers are replied to the user, so that the efficiency of answering the questions proposed by the user is greatly improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a question answering method, a question answering device and electronic equipment.
Background
At present, intelligent voice devices, such as intelligent sound boxes, smart phones, intelligent robots and other devices, already support voice answering of questions posed by users.
After the intelligent voice device obtains the problem provided by the user, if the problem provided by the user is inquired in a knowledge base stored in the intelligent voice device, the answer corresponding to the problem in the knowledge base is fed back to the user. However, if the user-posed question is not queried in the knowledge base, the intelligent speech device cannot answer the user-posed question.
Disclosure of Invention
In order to solve the above problems, embodiments of the present invention provide a question answering method, a question answering device, and an electronic device.
In a first aspect, an embodiment of the present invention provides a question answering method, including:
when a question proposed by a user is acquired, processing the question to acquire a plurality of candidate answers of the question;
processing the question and the plurality of candidate answers, and determining an answer type of an answer to the question;
and determining an answer capable of answering the question from the plurality of candidate answers by using the determined answer type of the answer.
In a second aspect, an embodiment of the present invention further provides a question answering device, including:
the processing module is used for processing the question when the question proposed by the user is obtained to obtain a plurality of candidate answers of the question;
a first determining module, configured to process the question and the plurality of candidate answers, and determine an answer type of an answer that answers the question;
and a second determining module, configured to determine, from the plurality of candidate answers, an answer that can answer the question using the determined answer type of the answer.
In a third aspect, the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method in the first aspect.
In a fourth aspect, embodiments of the present invention also provide an electronic device, which includes a memory, a processor, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor to perform the steps of the method according to the first aspect.
In the solutions provided in the first to fourth aspects of the embodiments of the present invention, after a question provided by a user is obtained, the question is processed to obtain a plurality of candidate answers to the question, the question and the plurality of candidate answers are processed, and an answer type of an answer to the question is determined; determining an answer capable of answering the question from a plurality of candidate answers using the determined answer type of the answer; compared with the mode that the answers of the questions put forward by the user can only be inquired in the knowledge base in the related technology, the answers of the answers to the questions can be matched and obtained from the candidate answers through the answer types without inquiring in the knowledge base and can be replied to the user, and the efficiency of answering the questions put forward by the user is greatly improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart showing a question answering method provided in embodiment 1 of the present invention;
fig. 2 is a schematic structural diagram showing a question answering apparatus provided in embodiment 2 of the present invention;
fig. 3 shows a schematic structural diagram of an electronic device provided in embodiment 3 of the present invention.
Detailed Description
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
At present, intelligent voice devices, such as intelligent sound boxes, smart phones, intelligent robots and other devices, already support voice answering of questions posed by users.
After the intelligent voice device obtains the problem provided by the user, if the problem provided by the user is inquired in a knowledge base stored in the intelligent voice device, the answer corresponding to the problem in the knowledge base is fed back to the user. However, if the user-posed question is not queried in the knowledge base, the intelligent speech device cannot answer the user-posed question.
The knowledge base stores the corresponding relation between the known questions and the answers.
Based on this, the following embodiments of the present application provide a question answering method, device and electronic device, where after a question provided by a user is obtained, the question is processed to obtain a plurality of candidate answers to the question, the question and the plurality of candidate answers are processed, and an answer type of an answer to the question is determined; determining an answer capable of answering the question from a plurality of candidate answers using the determined answer type of the answer; therefore, the answers of the answer questions can be obtained from the candidate answers in a matching mode through the answer types without inquiring in a knowledge base, and the answers are replied to the user, and the efficiency of answering the questions proposed by the user is greatly improved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Example 1
In the question answering method provided by the embodiment, the execution main body is an intelligent voice device.
Before executing the question answering method proposed in the present embodiment, the first and second constraint condition models need to be trained.
In order to train the first and second limiting condition models obtained by training, question and answer text data with artificial labels in the speech recognition data set is required to be used as training corpora of the first and second limiting condition models. Such as Switchboard, TIMIT, etc. In addition, video subtitles may also be used as the corpus of the first and second constraint models.
After the corpus is obtained, the questions and corresponding answers in the corpus are summarized and used as a basic corpusThe storage is carried out and the storage is carried out,the question and the corresponding answer in (1) can be expressed as}, each of which isAre composed of questions and corresponding answers, e.g.The ith inCan be expressed as. Thereby obtaining usable training corpora.
Wherein the content of the first and second substances,all respectively have text and limit conditionsType (b). For exampleCan be expressed as(ii) a WhereinCan be prepared fromIs expressed asAnd f, wherein i represents the labeled text of the ith corpus, k is a word sequence number, and max represents the maximum word segmentation number of the allowed sentences.
In one embodiment, max may take the value of 1000.
Then is the question type of the question, for example: a time definition type, a location area definition type, a direct answer definition type, etc. In a corresponding manner, the first and second optical fibers are,also have the following effectsSimilar definitions. Wherein the question type of the question and the answer type of the answer corresponding to the question are identical.
The direct answer restriction type is used for indicating that the answer text is the content for answering the question, and no restriction conditions such as question return, addition, clarification, and attachment are provided.
For example, the time qualified type may be labeled as { ({ (R) }"clean up before seven am";time limit type); the direct answer qualification type can be labeled as (: "how the hotel provided the wake service";: direct answer qualifier type).
After the usable training corpora are obtained, the training corpora are respectively input into the two deep neural network models for training, and a first limiting condition model and a second limiting condition model are respectively obtained.
Wherein, the first limiting condition model obtained by training can be according to the question textObtaining answer types of answers. Training the obtained second limiting condition model according to the answer textObtaining answer types of answersAnd a probability value of the answer.
The specific process of inputting the training corpus into the two deep neural network models respectively for training to obtain the first constraint condition model and the second constraint condition model respectively is the prior art, and is not described herein again.
After the first and second constraint condition models are obtained by training, the question answering method proposed in the present embodiment may be continuously executed.
Referring to a flow chart of a question answering method shown in fig. 1, the present embodiment provides a question answering method, which includes the following specific steps:
In step 100, to process the question and obtain a plurality of candidate answers to the question, the following steps (1) to (4) may be performed:
(1) acquiring the stored corresponding relation between all known questions and answers;
(2) calculating the distance between the problem and each known problem in all known problems;
(3) determining a plurality of known questions of each known question, wherein the distance between the known question and the question is greater than a distance threshold value, as a plurality of similar questions of the question;
(4) and determining answers corresponding to the similar questions in the similar questions as candidate answers of the questions, and determining the distance between each similar question and the question as an answer coefficient of the answer corresponding to each similar question serving as the candidate answer.
In the step (1), the corresponding relations between all known questions and answers stored in the knowledge base are obtained from the knowledge base preset in the intelligent voice device.
In the step (2) above, the distance between the problem and each of all the known problems is calculated, which is used to determine the similarity between the problem and each of the known problems. The problem is respectively proportional to the distance and the acquaintance of each known problem of all the known problems.
In the step (3), the distance threshold may be set to any value between 0.6 and 0.9. A plurality of known questions having a large distance from the question can thus be determined as a plurality of similar questions to the question.
The distance may be, but is not limited to: jaccard distance, euclidean distance, and cosine distance. The Jacard distance, the Euclidean distance, and the cosine distance are all capable of expressing a similarity of a problem to each of all known problems, respectively.
The smaller the distance between the problem and the known problem is calculated to be, the greater the similarity between the problem and the known problem is.
Moreover, the specific process of calculating the jaccard distance, euclidean distance, or cosine distance between the problem and each of the known problems is the prior art, and is not described herein again.
Specifically, in order to process the question and the plurality of candidate answers, and determine an answer type of an answer that answers the question, the following steps (1) to (2) may be performed:
(1) inputting the question into a first defined condition model to obtain an answer type of the answer;
(2) and inputting each candidate answer into a second defined condition model respectively to obtain the answer type and the probability value of each candidate answer.
The specific processing procedures of the first and second limiting condition models are prior art, and are not described herein again.
And 104, determining answers capable of answering the questions from the candidate answers by using the determined answer types of the answers.
Specifically, in order to utilize the determined answer type of the answer, from the plurality of candidate answers. Determining an answer capable of answering the question, and performing the following steps (1) to (3);
(1) sequencing the candidate answers according to the sequence of the answer coefficients from large to small to obtain a candidate answer sequence consisting of the candidate answers and determine the maximum value of the answer coefficients and the number of the candidate answers;
(2) when the answer type of the answer is not consistent with the answer type of the candidate answer, adjusting the answer coefficient of the candidate answer which is not consistent with the answer type of the answer by the following formula:
wherein the content of the first and second substances,indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;represents the maximum value of the answer coefficient;the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;is a preset value;
(3) and when the adjustment of the answer coefficient of the candidate answer which is not consistent with the answer type of the answer in each candidate answer is completed, determining the candidate answer with the maximum answer coefficient in each candidate answer as the answer for answering the question.
In the step (2), when the answer type of the answer is consistent with the answer type of the candidate answer, the step of adjusting the answer coefficient of the candidate answer consistent with the answer type of the answer is not required.
According to the above contents, it can be determined that the answer coefficient of the candidate answer which is inconsistent with the answer type of the answer is adjusted, that is, the answer coefficient of the candidate answer which is inconsistent with the answer type of the answer is reduced, and the candidate answer which is inconsistent with the answer type of the answer is ranked backwards, so that the candidate answer is reordered by using whether the answer type is consistent with the answer type obtained by the question or not; the answer type of the candidate answer determined as the answer to the question is made to coincide as much as possible with the answer type of the answer obtained by the question, so that the determined answer can answer the question posed by the user more accurately.
In summary, in the question answering method provided in this embodiment, after a question provided by a user is obtained, the question is processed to obtain a plurality of candidate answers to the question, the question and the plurality of candidate answers are processed, and an answer type of an answer to the question is determined; determining an answer capable of answering the question from a plurality of candidate answers using the determined answer type of the answer; compared with the mode that the answers of the questions put forward by the user can only be inquired in the knowledge base in the related technology, the answers of the answers to the questions can be matched and obtained from the candidate answers through the answer types without inquiring in the knowledge base and can be replied to the user, and the efficiency of answering the questions put forward by the user is greatly improved.
Example 2
This embodiment proposes a question answering device for executing the question answering method proposed in embodiment 1 above.
Referring to a schematic structural diagram of a question answering device shown in fig. 2, the present embodiment provides a question answering device including:
the processing module 200 is configured to, when a question posed by a user is obtained, process the question to obtain a plurality of candidate answers to the question;
a first determining module 202, configured to process the question and the plurality of candidate answers, and determine an answer type of an answer that answers the question;
a second determining module 204, configured to determine an answer capable of answering the question from the plurality of candidate answers by using the determined answer type of the answer.
Specifically, the processing module 200 is configured to process the question to obtain a plurality of candidate answers to the question, and includes:
acquiring the stored corresponding relation between all known questions and answers;
calculating the distance between the problem and each known problem in all known problems;
determining a plurality of known questions of each known question, wherein the distance between the known question and the question is greater than a distance threshold value, as a plurality of similar questions of the question;
and determining answers corresponding to the similar questions in the similar questions as candidate answers of the questions, and determining the distance between each similar question and the question as an answer coefficient of the answer corresponding to each similar question serving as the candidate answer.
Specifically, the first determining module 202 is specifically configured to:
inputting the question into a first defined condition model to obtain an answer type of the answer;
and inputting each candidate answer into a second defined condition model respectively to obtain the answer type and the probability value of each candidate answer.
Specifically, the second determining module 204 is specifically configured to;
sequencing the candidate answers according to the sequence of the answer coefficients from large to small to obtain a candidate answer sequence consisting of the candidate answers and determine the maximum value of the answer coefficients and the number of the candidate answers;
when the answer type of the answer is not consistent with the answer type of the candidate answer, adjusting the answer coefficient of the candidate answer which is not consistent with the answer type of the answer by the following formula:
wherein the content of the first and second substances,indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;represents the maximum value of the answer coefficient;the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;is a preset value;
and when the adjustment of the answer coefficient of the candidate answer which is not consistent with the answer type of the answer in each candidate answer is completed, determining the candidate answer with the maximum answer coefficient in each candidate answer as the answer for answering the question.
In summary, the question answering device provided in this embodiment processes a question after acquiring a question posed by a user to obtain a plurality of candidate answers to the question, processes the question and the plurality of candidate answers, and determines an answer type of an answer to the question; determining an answer capable of answering the question from a plurality of candidate answers using the determined answer type of the answer; compared with the mode that the answers of the questions put forward by the user can only be inquired in the knowledge base in the related technology, the answers of the answers to the questions can be matched and obtained from the candidate answers through the answer types without inquiring in the knowledge base and can be replied to the user, and the efficiency of answering the questions put forward by the user is greatly improved.
Example 3
The present embodiment proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the question answering method described in embodiment 1 above. For specific implementation, refer to method embodiment 1, which is not described herein again.
In addition, referring to the schematic structural diagram of an electronic device shown in fig. 3, the present embodiment further provides an electronic device, where the electronic device includes a bus 51, a processor 52, a transceiver 53, a bus interface 54, a memory 55, and a user interface 56. The electronic device comprises a memory 55.
In this embodiment, the electronic device further includes: one or more programs stored on the memory 55 and executable on the processor 52, configured to be executed by the processor for performing the following steps (1) to (3):
(1) when a question proposed by a user is acquired, processing the question to acquire a plurality of candidate answers of the question;
(2) processing the question and the plurality of candidate answers, and determining an answer type of an answer to the question;
(3) and determining an answer capable of answering the question from the plurality of candidate answers by using the determined answer type of the answer.
A transceiver 53 for receiving and transmitting data under the control of the processor 52.
Where a bus architecture (represented by bus 51) is used, bus 51 may include any number of interconnected buses and bridges, with bus 51 linking together various circuits including one or more processors, represented by processor 52, and memory, represented by memory 55. The bus 51 may also link various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further in this embodiment. A bus interface 54 provides an interface between the bus 51 and the transceiver 53. The transceiver 53 may be one element or may be multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. For example: the transceiver 53 receives external data from other devices. The transceiver 53 is used for transmitting data processed by the processor 52 to other devices. Depending on the nature of the computing system, a user interface 56, such as a keypad, display, speaker, microphone, joystick, may also be provided.
The processor 52 is responsible for managing the bus 51 and the usual processing, running a general-purpose operating system as described above. And memory 55 may be used to store data used by processor 52 in performing operations.
Alternatively, processor 52 may be, but is not limited to: a central processing unit, a singlechip, a microprocessor or a programmable logic device.
It will be appreciated that the memory 55 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 55 of the systems and methods described in this embodiment is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 55 stores elements, executable modules or data structures, or a subset thereof, or an expanded set thereof as follows: an operating system 551 and application programs 552.
The operating system 551 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application 552 includes various applications, such as a Media Player (Media Player), a Browser (Browser), and the like, for implementing various application services. A program implementing the method of an embodiment of the present invention may be included in the application 552.
In summary, in the computer-readable storage medium and the electronic device provided in this embodiment, after a question provided by a user is obtained, the question is processed to obtain a plurality of candidate answers to the question, the question and the plurality of candidate answers are processed, and an answer type of an answer to the question is determined; determining an answer capable of answering the question from a plurality of candidate answers using the determined answer type of the answer; compared with the mode that the answers of the questions put forward by the user can only be inquired in the knowledge base in the related technology, the answers of the answers to the questions can be matched and obtained from the candidate answers through the answer types without inquiring in the knowledge base and can be replied to the user, and the efficiency of answering the questions put forward by the user is greatly improved.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (6)
1. A method of answering questions, comprising:
when a question proposed by a user is acquired, acquiring the corresponding relation between all stored known questions and answers;
calculating the distance between the problem and each known problem in all known problems;
determining a plurality of known questions of each known question, wherein the distance between the known question and the question is greater than a distance threshold value, as a plurality of similar questions of the question;
determining answers corresponding to similar questions in the similar questions as candidate answers of the questions, and determining the distance between each similar question and the question as an answer coefficient of the answer corresponding to each similar question serving as the candidate answer;
processing the question and the plurality of candidate answers, and determining an answer type of an answer to the question;
sequencing the candidate answers according to the sequence of the answer coefficients from large to small to obtain a candidate answer sequence consisting of the candidate answers and determine the maximum value of the answer coefficients and the number of the candidate answers;
when the answer type of the answer is not consistent with the answer type of the candidate answer, adjusting the answer coefficient of the candidate answer which is not consistent with the answer type of the answer by the following formula:
wherein the content of the first and second substances,indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;represents the maximum value of the answer coefficient;the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;is a preset value;
and when the adjustment of the answer coefficient of the candidate answer which is not consistent with the answer type of the answer in each candidate answer is completed, determining the candidate answer with the maximum answer coefficient in each candidate answer as the answer for answering the question.
2. The method of claim 1, wherein said processing said question and said plurality of candidate answers to determine an answer type for an answer that answers said question comprises:
inputting the question into a first defined condition model to obtain an answer type of the answer;
and inputting each candidate answer into a second defined condition model respectively to obtain the answer type and the probability value of each candidate answer.
3. A question answering device, comprising:
the processing module is used for acquiring the corresponding relation between all stored known questions and answers when the questions proposed by the user are acquired;
calculating the distance between the problem and each known problem in all known problems;
determining a plurality of known questions of each known question, wherein the distance between the known question and the question is greater than a distance threshold value, as a plurality of similar questions of the question;
determining answers corresponding to similar questions in the similar questions as candidate answers of the questions, and determining the distance between each similar question and the question as an answer coefficient of the answer corresponding to each similar question serving as the candidate answer;
a first determining module, configured to process the question and the plurality of candidate answers, and determine an answer type of an answer that answers the question;
the second determining module is used for sequencing the candidate answers according to the descending order of the answer coefficients to obtain a candidate answer sequence consisting of the candidate answers and determining the maximum value of the answer coefficients and the number of the candidate answers;
when the answer type of the answer is not consistent with the answer type of the candidate answer, adjusting the answer coefficient of the candidate answer which is not consistent with the answer type of the answer by the following formula:
wherein the content of the first and second substances,indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;represents the maximum value of the answer coefficient;the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;is a preset value;
and when the adjustment of the answer coefficient of the candidate answer which is not consistent with the answer type of the answer in each candidate answer is completed, determining the candidate answer with the maximum answer coefficient in each candidate answer as the answer for answering the question.
4. The apparatus of claim 3, wherein the first determining module is specifically configured to:
inputting the question into a first defined condition model to obtain an answer type of the answer;
and inputting each candidate answer into a second defined condition model respectively to obtain the answer type and the probability value of each candidate answer.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of the claims 1-2.
6. An electronic device comprising a memory, a processor, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor to perform the steps of the method of any of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111479666.6A CN113886556B (en) | 2021-12-07 | 2021-12-07 | Question answering method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111479666.6A CN113886556B (en) | 2021-12-07 | 2021-12-07 | Question answering method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113886556A CN113886556A (en) | 2022-01-04 |
CN113886556B true CN113886556B (en) | 2022-02-25 |
Family
ID=79015656
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111479666.6A Active CN113886556B (en) | 2021-12-07 | 2021-12-07 | Question answering method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113886556B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105354300B (en) * | 2015-11-05 | 2019-04-05 | 上海智臻智能网络科技股份有限公司 | A kind of information recommendation method and device |
CN105912629B (en) * | 2016-04-07 | 2019-08-13 | 上海智臻智能网络科技股份有限公司 | A kind of intelligent answer method and device |
US10691685B2 (en) * | 2017-06-03 | 2020-06-23 | Apple Inc. | Converting natural language input to structured queries |
CN109033229B (en) * | 2018-06-29 | 2021-06-11 | 北京百度网讯科技有限公司 | Question and answer processing method and device |
CN113342958B (en) * | 2021-07-02 | 2023-06-16 | 马上消费金融股份有限公司 | Question-answer matching method, text matching model training method and related equipment |
-
2021
- 2021-12-07 CN CN202111479666.6A patent/CN113886556B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113886556A (en) | 2022-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11816438B2 (en) | Context saliency-based deictic parser for natural language processing | |
KR102668530B1 (en) | Speech recognition methods, devices and devices, and storage media | |
CN108763535B (en) | Information acquisition method and device | |
CN111708873A (en) | Intelligent question answering method and device, computer equipment and storage medium | |
CN106528845A (en) | Artificial intelligence-based searching error correction method and apparatus | |
JP2015075706A (en) | Error correction model learning device and program | |
US20200265327A1 (en) | Selecting answer spans from electronic documents using neural networks | |
CN113297366B (en) | Emotion recognition model training method, device, equipment and medium for multi-round dialogue | |
US20210279622A1 (en) | Learning with limited supervision for question-answering with light-weight markov models | |
CN111597313B (en) | Question answering method, device, computer equipment and storage medium | |
CN110598210B (en) | Entity recognition model training, entity recognition method, entity recognition device, entity recognition equipment and medium | |
CN113569017B (en) | Model processing method and device, electronic equipment and storage medium | |
CN110990555A (en) | End-to-end retrieval type dialogue method and system and computer equipment | |
CN111882370A (en) | Advertisement recommendation method and device and electronic equipment | |
CN112686051A (en) | Semantic recognition model training method, recognition method, electronic device, and storage medium | |
CN108846125A (en) | Talk with generation method, device, terminal and computer readable storage medium | |
CN111402864A (en) | Voice processing method and electronic equipment | |
CN113850383A (en) | Text matching model training method and device, electronic equipment and storage medium | |
CN117828049A (en) | Data processing method and related device | |
CN113886556B (en) | Question answering method and device and electronic equipment | |
CN116127049A (en) | Model training method, text generation method, terminal device and computer medium | |
CN113672701B (en) | Text matching method, device, equipment and storage medium based on machine learning | |
CN112016281B (en) | Method and device for generating wrong medical text and storage medium | |
CN113934825B (en) | Question answering method and device and electronic equipment | |
CN113707185B (en) | Emotion recognition method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Room 702, 7th floor, NO.67, Beisihuan West Road, Haidian District, Beijing 100080 Patentee after: Beijing Yunji Technology Co.,Ltd. Address before: Room 702, 7th floor, NO.67, Beisihuan West Road, Haidian District, Beijing 100080 Patentee before: BEIJING YUNJI TECHNOLOGY Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |