CN113886556B - Question answering method and device and electronic equipment - Google Patents

Question answering method and device and electronic equipment Download PDF

Info

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
Application number
CN202111479666.6A
Other languages
Chinese (zh)
Other versions
CN113886556A (en
Inventor
张献涛
林小俊
支涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yunji Technology Co Ltd
Original Assignee
Beijing Yunji Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Yunji Technology Co Ltd filed Critical Beijing Yunji Technology Co Ltd
Priority to CN202111479666.6A priority Critical patent/CN113886556B/en
Publication of CN113886556A publication Critical patent/CN113886556A/en
Application granted granted Critical
Publication of CN113886556B publication Critical patent/CN113886556B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution

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

Question answering method and device and electronic equipment
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 corpus
Figure 977883DEST_PATH_IMAGE001
The storage is carried out and the storage is carried out,
Figure 621354DEST_PATH_IMAGE001
the question and the corresponding answer in (1) can be expressed as
Figure 894204DEST_PATH_IMAGE002
}, each of which is
Figure 623125DEST_PATH_IMAGE003
Are composed of questions and corresponding answers, e.g.
Figure 433431DEST_PATH_IMAGE001
The ith in
Figure 72354DEST_PATH_IMAGE004
Can be expressed as
Figure 844001DEST_PATH_IMAGE005
. Thereby obtaining usable training corpora.
Wherein the content of the first and second substances,
Figure 732322DEST_PATH_IMAGE006
all respectively have text and limit conditionsType (b). For example
Figure 614828DEST_PATH_IMAGE007
Can be expressed as
Figure 701732DEST_PATH_IMAGE008
(ii) a Wherein
Figure 644281DEST_PATH_IMAGE009
Can be prepared from
Figure 223161DEST_PATH_IMAGE009
Is expressed as
Figure 643778DEST_PATH_IMAGE010
And 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.
Figure 850768DEST_PATH_IMAGE011
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,
Figure 964218DEST_PATH_IMAGE012
also have the following effects
Figure 30394DEST_PATH_IMAGE007
Similar definitions
Figure 192385DEST_PATH_IMAGE013
. 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) }
Figure 253882DEST_PATH_IMAGE014
"clean up before seven am";
Figure 275583DEST_PATH_IMAGE015
time limit type); the direct answer qualification type can be labeled as (
Figure 688110DEST_PATH_IMAGE016
: "how the hotel provided the wake service";
Figure 857054DEST_PATH_IMAGE017
: 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 text
Figure 38637DEST_PATH_IMAGE014
Obtaining answer types of answers
Figure 165993DEST_PATH_IMAGE018
. Training the obtained second limiting condition model according to the answer text
Figure 65816DEST_PATH_IMAGE019
Obtaining answer types of answers
Figure 366347DEST_PATH_IMAGE018
And 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:
step 100, when a question proposed by a user is acquired, processing the question to obtain a plurality of candidate answers to the question.
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.
Step 102, processing the question and the candidate answers, and determining the answer type of the answer answering the question.
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:
Figure 668015DEST_PATH_IMAGE020
wherein the content of the first and second substances,
Figure 169535DEST_PATH_IMAGE021
indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;
Figure 556654DEST_PATH_IMAGE022
representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;
Figure 660876DEST_PATH_IMAGE023
represents the maximum value of the answer coefficient;
Figure DEST_PATH_IMAGE024
the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;
Figure 692417DEST_PATH_IMAGE025
representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;
Figure 489472DEST_PATH_IMAGE026
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.
The above-mentioned
Figure 35991DEST_PATH_IMAGE026
Any value between 0 and 1 can be set, and is not described in detail here.
In one embodiment of the method of the present invention,
Figure 209483DEST_PATH_IMAGE026
is set to 1.
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:
Figure 951656DEST_PATH_IMAGE020
wherein the content of the first and second substances,
Figure 919612DEST_PATH_IMAGE021
indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;
Figure 156689DEST_PATH_IMAGE022
representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;
Figure 805976DEST_PATH_IMAGE023
represents the maximum value of the answer coefficient;
Figure 671164DEST_PATH_IMAGE024
the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;
Figure 810021DEST_PATH_IMAGE025
representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;
Figure 127870DEST_PATH_IMAGE026
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:
Figure DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE004
indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;
Figure DEST_PATH_IMAGE006
representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;
Figure DEST_PATH_IMAGE008
represents the maximum value of the answer coefficient;
Figure DEST_PATH_IMAGE010
the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;
Figure DEST_PATH_IMAGE012
representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;
Figure DEST_PATH_IMAGE014
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:
Figure 696697DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 613838DEST_PATH_IMAGE004
indicating the adjusted answer coefficient of the candidate answer inconsistent with the answer type of the answer;
Figure 331258DEST_PATH_IMAGE006
representing the answer coefficient before the adjustment of the candidate answer inconsistent with the answer type of the answer;
Figure 664150DEST_PATH_IMAGE008
represents the maximum value of the answer coefficient;
Figure 478523DEST_PATH_IMAGE010
the answer coefficient represents a candidate answer positioned in the middle of the candidate answer sequence;Rrepresenting the number of candidate answers;
Figure 238668DEST_PATH_IMAGE012
representing a probability value of a candidate answer that is inconsistent with an answer type of the answer;
Figure DEST_PATH_IMAGE016
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.
CN202111479666.6A 2021-12-07 2021-12-07 Question answering method and device and electronic equipment Active CN113886556B (en)

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)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN113886556A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
CN110457675B (en) Predictive model training method and device, storage medium and computer equipment
CN108763535B (en) Information acquisition method and device
EP4156176A1 (en) Speech recognition method, apparatus and device, and storage medium
CN106528845A (en) Artificial intelligence-based searching error correction method and apparatus
CN111708873A (en) Intelligent question answering method and device, computer equipment and storage medium
CN109376222A (en) Question and answer matching degree calculation method, question and answer automatic matching method and device
JP2015075706A (en) Error correction model learning device and program
US11481646B2 (en) Selecting answer spans from electronic documents using neural networks
CN110990555B (en) End-to-end retrieval type dialogue method and system and computer equipment
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
CN113297366B (en) Emotion recognition model training method, device, equipment and medium for multi-round dialogue
CN108959556A (en) Entity answering method, device and terminal neural network based
CN110909145A (en) Training method and device for multi-task model
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
CN110598210A (en) Entity recognition model training method, entity recognition device, entity recognition equipment and medium
CN113886556B (en) Question answering method and device and electronic equipment
CN113569017A (en) Model processing method and device, electronic equipment and storage medium
CN116127049A (en) Model training method, text generation method, terminal device and computer medium
CN112016281B (en) Method and device for generating wrong medical text and storage medium
CN112989046B (en) Real-time speech prejudging method, device, computer equipment and storage medium
CN113850383A (en) Text matching model training method and device, electronic equipment and storage medium
CN113934825B (en) Question answering 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