CN110543558A - question matching method, device, equipment and medium - Google Patents
question matching method, device, equipment and medium Download PDFInfo
- Publication number
- CN110543558A CN110543558A CN201910843848.3A CN201910843848A CN110543558A CN 110543558 A CN110543558 A CN 110543558A CN 201910843848 A CN201910843848 A CN 201910843848A CN 110543558 A CN110543558 A CN 110543558A
- Authority
- CN
- China
- Prior art keywords
- question
- classification
- sample
- model
- sequencing
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000012549 training Methods 0.000 claims abstract description 75
- 238000012163 sequencing technique Methods 0.000 claims abstract description 63
- 238000013145 classification model Methods 0.000 claims abstract description 28
- 230000006870 function Effects 0.000 claims description 23
- 230000015654 memory Effects 0.000 claims description 20
- 230000008569 process Effects 0.000 claims description 20
- 238000012545 processing Methods 0.000 abstract description 7
- 239000013598 vector Substances 0.000 description 14
- 238000010586 diagram Methods 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001151 other effect Effects 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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
- G06F16/3344—Query execution using natural language analysis
-
- 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/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Databases & Information Systems (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Human Computer Interaction (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
the embodiment of the application discloses a problem matching method, a problem matching device and a problem matching medium, and relates to the field of cloud computing and data processing. The specific implementation scheme is as follows: training a basic network layer multiplexed by a problem classification model and a problem sequencing model and a classification output network layer in the problem classification model by using a problem classification sample; and training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample to obtain a trained problem sequencing model for problem matching. The problem matching method, device, equipment and medium provided by the embodiment of the application improve the robustness of the problem sorting model, and further improve the accuracy of problem matching.
Description
Technical Field
The embodiment of the application relates to the field of data processing, in particular to an intelligent search technology. In particular, the present embodiments relate to a problem matching method, apparatus, device, and medium.
Background
existing models applied to problem matching are often trained based on classification tasks or based on ranking tasks. In the classification task, two problems are given, and a model needs to be trained to judge whether the two problems are similar; in the ordering task, given a central problem, a positive example and a negative example, it is desirable that the model gives positive examples a higher score than negative examples.
in the sequencing task, the existing model applied to problem matching has the following defects:
the classification model trained by the classification task ignores the information of the similarity degree, so the effect of sequencing by using the classification model is not ideal.
although the difference of the similarity degrees is considered, a random sampling method is often used in the process of constructing the data set, and the negative sample space covered by the method is small (especially under the conditions of more data and larger negative sample space), so that the trained ranking model has insufficient robustness or has a certain bias.
Disclosure of Invention
the embodiment of the application provides a problem matching method, a problem matching device and a problem matching medium, so that the robustness of a problem sorting model is improved, and the accuracy of problem matching is further improved.
In a first aspect, an embodiment of the present application provides a problem matching method, where the method includes:
Training a basic network layer multiplexed by a problem classification model and a problem sequencing model and a classification output network layer in the problem classification model by using a problem classification sample;
And training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample to obtain a trained problem sequencing model for problem matching.
the embodiment of the application has the following advantages or beneficial effects: on the basis of training the sequencing output network layer in the basic network layer and the problem sequencing model by using the problem sequencing sample, the problem classification sample is used for training the basic network layer multiplexed by the problem classification model and the problem sequencing model. Because training of the problem classification samples to the basic network layer is added, the negative sample space of the problem ranking model can be increased, the robustness of the problem ranking model is improved, and the bias of the problem ranking model is reduced.
optionally, in each round of training, the round of problem classification samples and the round of problem ranking samples are used for training respectively.
based on the technical characteristics, the embodiment of the application has the following advantages or beneficial effects: in each round of training process, the problem classification samples and the problem sorting samples are used for training respectively, so that cross training of the problem sorting models is achieved by using the problem classification samples and the problem sorting samples, and model bias is reduced.
optionally, in the training process using the problem classification sample, a classification loss function is adopted;
in the training process of utilizing the problem ranking samples, a ranking loss function is adopted.
Based on the technical characteristics, the embodiment of the application has the following advantages or beneficial effects: in the training process of utilizing the problem classification samples, a classification loss function is adopted; in the training process of utilizing the problem ranking samples, the ranking loss function is adopted, so that the training accuracy of the problem ranking model is improved, and the robustness of the problem ranking model is further improved.
optionally, the question classification samples include a positive sample question pair and a negative sample question pair;
The problem sorting sample comprises a sample triple, wherein the triple comprises a central question, a positive sample question and a negative sample question, the similarity between the positive sample question and the central question is greater than a first similarity threshold, the similarity between the negative sample question and the central question is less than a second similarity threshold, and the first similarity threshold is greater than or equal to the second similarity threshold.
Based on the technical characteristics, the embodiment of the application has the following advantages or beneficial effects: and performing combined training of classification and sequencing on the basic network layer of the problem sequencing model by using the positive sample question pairs, the negative sample question pairs and the sample triples.
Optionally, the method further includes:
after the trained question sequencing model is obtained, taking a question to be retrieved input by a user and an existing question in an existing question-answer pair as the input of the trained question sequencing model so as to obtain the semantic similarity between the question to be retrieved and the existing question;
and determining a target question matched with the question to be retrieved and a target answer according to the semantic similarity between the question to be retrieved and the existing question.
based on the technical characteristics, the embodiment of the application has the following advantages or beneficial effects: by utilizing the problem sorting model which is subjected to classification and sorting combined training, the semantic similarity between the question to be retrieved and the existing question can be accurately determined, and the determination accuracy of the target question and the target answer can be improved.
Optionally, the problem classification sample is constructed according to general data;
the problem ordering sample is constructed according to target field data.
Based on the technical characteristics, the embodiment of the application has the following advantages or beneficial effects: problem classification samples are constructed according to the general data, so that a problem ordering model trained based on the problem classification samples can learn the semantic relation of the general data. Problem ordering samples are constructed according to the target field data, so that a problem ordering model trained based on the problem ordering samples learns the semantic relation of the target field data, and the ordering accuracy of the problem ordering model is improved.
In a second aspect, an embodiment of the present application provides a problem matching apparatus, including:
The system comprises a problem classification model, a classification training module and a problem sorting module, wherein the problem classification model is used for classifying a problem in a problem classification model;
And the sequencing training module is used for training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample so as to obtain a trained problem sequencing model for problem matching.
In a third aspect, an embodiment of the present application provides an electronic device, including:
At least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the problem matching method of any one of the embodiments of the present application.
in a fourth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium having stored thereon computer instructions for causing a computer to perform a problem matching method as described in any of the embodiments of the present application.
other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flow chart of a problem matching method provided in a first embodiment of the present application;
fig. 2 is a schematic structural diagram of an infrastructure network layer according to a second embodiment of the present application;
FIG. 3 is a schematic diagram of a model structure for classification task training according to a second embodiment of the present application;
FIG. 4 is a schematic diagram of a model structure for training a ranking task according to a second embodiment of the present application;
FIG. 5 is a schematic diagram of a problem matching apparatus according to a third embodiment of the present application;
fig. 6 is a block diagram of an electronic device of a problem matching method according to a fourth embodiment of the present application.
Detailed Description
the following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
First embodiment
fig. 1 is a flowchart of a problem matching method according to a first embodiment of the present application. The present embodiment is applicable to the case of determining the similarity between two questions. Typically, the present embodiment is applicable to a case where the similarity between a search question and an existing question in an existing question-and-answer pair is determined in a search-type question-and-answer system. The method may be implemented in software and/or hardware. Referring to fig. 1, the problem matching method provided by the present embodiment includes:
S110, training a basic network layer for multiplexing the problem classification model and the problem sorting model and a classification output network layer in the problem classification model by using the problem classification sample.
The problem classification sample refers to a sample for performing problem classification task training on the model.
specifically, the question classification samples include a positive sample question pair and a negative sample question pair.
illustratively, a positive sample question pair refers to two questions whose similarity is greater than a third similarity threshold. The negative sample question refers to two questions with the similarity smaller than the fourth similarity threshold. Wherein the fourth similarity threshold is less than or equal to the third similarity threshold.
The problem classification model is a model that classifies problems.
The problem ranking model is a model for determining the similarity of problems, and based on the model, the problems can be ranked according to the similarity between the problem pairs.
The basic network layer for multiplexing the problem classification model and the problem sorting model refers to other network layers except the output network layer, namely the problem classification model and the problem sorting model share other network layers except the output network layer.
Specifically, the method for training the basic network layer multiplexed by the problem classification model and the problem sorting model and the classification output network layer in the problem classification model by using the problem classification sample comprises the following steps:
Inputting the problem classification sample into an input network layer in a basic network layer, and entering a classification output network layer after the problem classification sample is processed by other network layers outside the input network layer in the basic network layer;
And based on the classification loss function, adjusting parameters to be trained in the basic network layer and the classification output network layer according to the output result of the classification output network layer and the classification labels in the problem classification samples.
And S120, training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample to obtain a trained problem sequencing model for problem matching.
the problem ranking sample refers to a sample for performing problem ranking task training on a model.
Specifically, the question ordering sample includes a sample triple, where the triple includes a center question, a positive-like question, and a negative-like question, a similarity between the positive-like question and the center question is greater than a first similarity threshold, a similarity between the negative-like question and the center question is less than a second similarity threshold, and the first similarity threshold is greater than or equal to the second similarity threshold. The first similarity threshold may be equal to the third similarity threshold and the second similarity threshold may be equal to the fourth similarity threshold.
Training the basic network layer and a sequencing output network layer in the problem sequencing model by using a problem sequencing sample, wherein the training comprises the following steps:
inputting the central question and the positive question into an input network layer in a basic network layer, processing the central question and the positive question by other network layers outside the input network layer in the basic network layer, entering a sequencing output network layer, and outputting the similarity of the positive question;
inputting the central question and the negative question into an input network layer in a basic network layer, processing the central question and the negative question by other network layers outside the input network layer in the basic network layer, entering a sequencing output network layer, and outputting the similarity of the negative question;
And based on the sequencing loss function, adjusting the parameters to be trained in the basic network layer and the classified output network layer according to the magnitude relation between the similarity of the output positive sample question and the similarity of the output negative sample question.
According to the technical scheme, the problem classification samples are utilized to train the basic network layer of the problem classification model and the problem classification model multiplexing on the basis of training the problem classification samples on the basic network layer and the sequencing output network layer in the problem sequencing model. Because training of the problem classification samples to the basic network layer is added, the negative sample space of the problem ranking model can be increased, the robustness of the problem ranking model is improved, and the bias of the problem ranking model is reduced.
Optionally, in each round of training, the round of problem classification samples and the round of problem ranking samples are used for training respectively.
That is, the training process is divided into multiple rounds, and each round is trained by using a problem classification sample set and a problem ordering sample set.
The training sequence of the problem classification sample set and the problem ranking sample set is not limited in this embodiment. Optionally, the problem classification sample set may be trained first, or the problem ranking sample set may be trained first.
based on the technical characteristics, in each round of training process, the problem classification samples and the problem sorting samples are used for training respectively, so that cross training of the problem sorting models is achieved by using the problem classification samples and the problem sorting samples, and model bias is reduced.
In order to implement the ranking of the existing question based on the semantic similarity between the question to be retrieved and the existing question to determine the target question, after obtaining the trained problem ranking model, the method of this embodiment further includes:
taking a question to be retrieved input by a user and an existing question in an existing question-answer pair as input of a trained question sequencing model to obtain semantic similarity between the question to be retrieved and the existing question;
And determining a target question matched with the question to be retrieved and a target answer according to the semantic similarity between the question to be retrieved and the existing question.
The target question is a question successfully matched with the question to be retrieved, and the target answer is an answer associated with the target question.
in order to enable a problem ordering model to learn the semantic relation of the general data and the semantic relation of the target field data, the problem classification sample is constructed according to the general data;
The problem ordering sample is constructed according to target field data.
second embodiment
The present embodiment is an alternative proposed on the basis of the above-described embodiments.
Fig. 2 is a schematic structural diagram of a base network layer.
As shown in fig. 2, given two input question sentences, word vectors of words in the question sentences are determined, and the input question sentences are projected as one sentence vector;
And determining a combined vector according to the sentence vectors of the two question sentences, inputting the combined vector into a full link layer, processing the combined vector by the full link layer, and inputting the combined vector into a classified output network layer or a sequencing output network layer.
in order to improve the accuracy of similarity determination, more similarity description elements are blended into the combined vector.
Typically, determining a combined vector from the sentence vectors of two question sentences comprises:
splicing sentence vectors of the two question sentences;
calculating the difference of sentence vectors of two question sentences, and taking a module for the difference value;
Calculating the product of sentence vectors of the two question sentences;
and combining the splicing result, the modulus result and the product result to generate a combined vector.
The basic network layer is provided with two output branches, namely a classification task training branch and a sequencing task training branch, and the two branches share weight.
the specific training task is described as follows:
training classification tasks:
in the classification task, the task is defined as given question 1, question 2, and a classification label (where 0 represents dissimilarity and 1 represents similarity), p (6| x1, x2) needs to be learned through the model.
referring to fig. 3, now the base network layer within the dashed line, the output is a label for model prediction.
Training a sequencing task:
in the sequencing task, the task is defined as follows: given the center problem (denoted as xanchor), positive samples (denoted as xpos), negative samples (denoted as xneg), we get:
y=f(w,x,x)
y=f(w,x,x)
Where f is a distance function. ypos, yneg ∈ (-1,1), representing the similarity of the central question and the positive sample, and the similarity of the central question and the negative sample, respectively. w is a parameter of the distance function.
The training targets are: the distance between the positive samples and the central problem is as small as possible, the distance between the negative samples and the central problem is as large as possible, i.e. ypos > yneg, and the ordering loss function is:
L=max(0,m+y-y)
Wherein Lranking is a ranking loss function, m is a hyper-parameter, and the difference between positive and negative scores is represented.
Referring to fig. 4, now the base network layer is within the dashed line, and the output is the sequenced output network layer.
The method for multi-task combined training is adopted, and the specific process is as follows:
the joint loss function is:
L=L+L
Llastisification is a classification loss function. Because the underlying network layer is parameter-shared for both classification tasks and sequencing tasks, only the output layer is different.
so an alternate update approach is taken: when the current input is a problem classification sample, updating W and Wc through Llastisification, wherein W is a parameter of a basic network layer, and Wc is a parameter of a classification output network layer; when the current input is a problem sort sample, W and Wr are updated by Lranking, where Wr is a parameter of the sort output network layer.
According to the technical scheme of the embodiment of the invention, a classification and sequencing combined training method is adopted to improve the accuracy and robustness of the model. Constructing a classification task by using a classification data set of the general data, aiming at enabling a model to learn a general text semantic relation; and constructing triple data by using the target field data as a problem sequencing sample.
And randomly sampling a plurality of negative samples for each positive sample, and training by using a sequencing loss function, so that the model can learn some information of the similarity degree while learning the general semantic relationship.
Third embodiment
Fig. 5 is a schematic structural diagram of a problem matching apparatus according to a third embodiment of the present application. Referring to fig. 5, the problem matching apparatus 500 provided in the present embodiment includes: a classification training module 501 and an order training module 502.
The classification training module 501 is configured to train a basic network layer in which a problem classification model and a problem ranking model are multiplexed, and a classification output network layer in the problem classification model, by using a problem classification sample;
A ranking training module 502, configured to train the basic network layer and a ranking output network layer in the problem ranking model by using the problem ranking sample, so as to obtain a trained problem ranking model for problem matching.
According to the technical scheme, the problem classification samples are utilized to train the basic network layer of the problem classification model and the problem classification model multiplexing on the basis of training the problem classification samples on the basic network layer and the sequencing output network layer in the problem sequencing model. Because training of the problem classification samples to the basic network layer is added, the negative sample space of the problem ranking model can be increased, the robustness of the problem ranking model is improved, and the bias of the problem ranking model is reduced.
Further, in each round of training process, the round of problem classification samples and the round of problem sorting samples are used for training respectively.
Further, in the training process of utilizing the problem classification samples, a classification loss function is adopted;
in the training process of utilizing the problem ranking samples, a ranking loss function is adopted.
Further, the question classification samples comprise positive sample question pairs and negative sample question pairs;
The problem sorting sample comprises a sample triple, wherein the triple comprises a central question, a positive sample question and a negative sample question, the similarity between the positive sample question and the central question is greater than a first similarity threshold, the similarity between the negative sample question and the central question is less than a second similarity threshold, and the first similarity threshold is greater than or equal to the second similarity threshold.
Further, the apparatus further comprises:
the similarity determination module is used for taking a question to be retrieved input by a user and an existing question in an existing question-answer pair as the input of the trained question sequencing model after the trained question sequencing model is obtained, so as to obtain the semantic similarity between the question to be retrieved and the existing question;
And the target answer determining module is used for determining a target question and a target answer which are matched with the question to be retrieved according to the semantic similarity between the question to be retrieved and the existing question.
Further, the problem classification sample is constructed according to general data;
the problem ordering sample is constructed according to target field data.
Fourth embodiment
according to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 6, it is a block diagram of an electronic device according to the problem matching method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
as shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the problem matching method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the problem matching method provided by the present application.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the problem matching method in the embodiments of the present application (e.g., the classification training module 501 and the ranking training module 502 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 602, that is, implementing the problem matching method in the above-described method embodiment.
the memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the problem-matching electronic device, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory located remotely from the processor 601, and these remote memories may be connected to the problem matching electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the question matching method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the problem-matching electronic apparatus, such as a touch screen, keypad, mouse, track pad, touch pad, pointer stick, one or more mouse buttons, track ball, joystick, or other input device. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
these computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
the computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
according to the technical scheme of the embodiment of the application, the following technical effects can be realized:
1. Problem classification samples are constructed by using general data, so that the model learns better general semantic information;
2. Problem ordering samples are constructed by utilizing data in a specific field, so that the model learns the information of the correlation degree, and a better result is obtained in the reordering process;
3. The joint training enables the model to be more robust, improves the accuracy rate and relieves the overfitting problem on the data in the specific field.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (14)
1. A problem matching method, comprising:
training a basic network layer multiplexed by a problem classification model and a problem sequencing model and a classification output network layer in the problem classification model by using a problem classification sample;
And training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample to obtain a trained problem sequencing model for problem matching.
2. the method of claim 1,
in each round of training process, the problem classification samples and the problem sorting samples are used for training respectively.
3. The method of claim 1,
in the training process of utilizing the problem classification samples, a classification loss function is adopted;
in the training process of utilizing the problem ranking samples, a ranking loss function is adopted.
4. The method of claim 1, wherein the question classification samples comprise a positive sample question pair and a negative sample question pair;
The problem sorting sample comprises a sample triple, wherein the triple comprises a central question, a positive sample question and a negative sample question, the similarity between the positive sample question and the central question is greater than a first similarity threshold, the similarity between the negative sample question and the central question is less than a second similarity threshold, and the first similarity threshold is greater than or equal to the second similarity threshold.
5. The method of claim 1, after obtaining the trained problem ranking model, further comprising:
taking a question to be retrieved input by a user and an existing question in an existing question-answer pair as input of a trained question sequencing model to obtain semantic similarity between the question to be retrieved and the existing question;
And determining a target question matched with the question to be retrieved and a target answer according to the semantic similarity between the question to be retrieved and the existing question.
6. The method of claim 1,
The problem classification sample is constructed according to general data;
the problem ordering sample is constructed according to target field data.
7. A problem matching apparatus, comprising:
The system comprises a problem classification model, a classification training module and a problem sorting module, wherein the problem classification model is used for classifying a problem in a problem classification model;
and the sequencing training module is used for training the basic network layer and the sequencing output network layer in the problem sequencing model by using the problem sequencing sample so as to obtain a trained problem sequencing model for problem matching.
8. The apparatus of claim 7,
In each round of training process, the problem classification samples and the problem sorting samples are used for training respectively.
9. the apparatus of claim 7,
In the training process of utilizing the problem classification samples, a classification loss function is adopted;
In the training process of utilizing the problem ranking samples, a ranking loss function is adopted.
10. The apparatus of claim 7, wherein the question classification samples comprise a positive sample question pair and a negative sample question pair;
the problem sorting sample comprises a sample triple, wherein the triple comprises a central question, a positive sample question and a negative sample question, the similarity between the positive sample question and the central question is greater than a first similarity threshold, the similarity between the negative sample question and the central question is less than a second similarity threshold, and the first similarity threshold is greater than or equal to the second similarity threshold.
11. The apparatus of claim 7, further comprising:
The similarity determination module is used for taking a question to be retrieved input by a user and an existing question in an existing question-answer pair as the input of the trained question sequencing model after the trained question sequencing model is obtained, so as to obtain the semantic similarity between the question to be retrieved and the existing question;
and the target answer determining module is used for determining a target question and a target answer which are matched with the question to be retrieved according to the semantic similarity between the question to be retrieved and the existing question.
12. the apparatus of claim 7,
the problem classification sample is constructed according to general data;
The problem ordering sample is constructed according to target field data.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the problem matching method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the problem matching method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910843848.3A CN110543558B (en) | 2019-09-06 | 2019-09-06 | Question matching method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910843848.3A CN110543558B (en) | 2019-09-06 | 2019-09-06 | Question matching method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110543558A true CN110543558A (en) | 2019-12-06 |
CN110543558B CN110543558B (en) | 2023-01-17 |
Family
ID=68712875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910843848.3A Active CN110543558B (en) | 2019-09-06 | 2019-09-06 | Question matching method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110543558B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111709247A (en) * | 2020-05-20 | 2020-09-25 | 北京百度网讯科技有限公司 | Data set processing method and device, electronic equipment and storage medium |
CN112328710A (en) * | 2020-11-26 | 2021-02-05 | 北京百度网讯科技有限公司 | Entity information processing method, entity information processing device, electronic equipment and storage medium |
CN113254609A (en) * | 2021-05-12 | 2021-08-13 | 同济大学 | Question-answering model integration method based on negative sample diversity |
CN113434792A (en) * | 2021-07-20 | 2021-09-24 | 北京百度网讯科技有限公司 | Training method of network address matching model and network address matching method |
CN113836885A (en) * | 2020-06-24 | 2021-12-24 | 阿里巴巴集团控股有限公司 | Text matching model training method, text matching device and electronic equipment |
CN114119989A (en) * | 2021-11-29 | 2022-03-01 | 北京百度网讯科技有限公司 | Training method and device for image feature extraction model and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110276396A1 (en) * | 2005-07-22 | 2011-11-10 | Yogesh Chunilal Rathod | System and method for dynamically monitoring, recording, processing, attaching dynamic, contextual and accessible active links and presenting of physical or digital activities, actions, locations, logs, life stream, behavior and status |
CN105893523A (en) * | 2016-03-31 | 2016-08-24 | 华东师范大学 | Method for calculating problem similarity with answer relevance ranking evaluation measurement |
US20190080225A1 (en) * | 2017-09-11 | 2019-03-14 | Tata Consultancy Services Limited | Bilstm-siamese network based classifier for identifying target class of queries and providing responses thereof |
CN109948143A (en) * | 2019-01-25 | 2019-06-28 | 网经科技(苏州)有限公司 | The answer extracting method of community's question answering system |
-
2019
- 2019-09-06 CN CN201910843848.3A patent/CN110543558B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110276396A1 (en) * | 2005-07-22 | 2011-11-10 | Yogesh Chunilal Rathod | System and method for dynamically monitoring, recording, processing, attaching dynamic, contextual and accessible active links and presenting of physical or digital activities, actions, locations, logs, life stream, behavior and status |
CN105893523A (en) * | 2016-03-31 | 2016-08-24 | 华东师范大学 | Method for calculating problem similarity with answer relevance ranking evaluation measurement |
US20190080225A1 (en) * | 2017-09-11 | 2019-03-14 | Tata Consultancy Services Limited | Bilstm-siamese network based classifier for identifying target class of queries and providing responses thereof |
CN109948143A (en) * | 2019-01-25 | 2019-06-28 | 网经科技(苏州)有限公司 | The answer extracting method of community's question answering system |
Non-Patent Citations (1)
Title |
---|
熊昌镇等: "结合主体检测的图像检索方法", 《光学精密工程》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111709247A (en) * | 2020-05-20 | 2020-09-25 | 北京百度网讯科技有限公司 | Data set processing method and device, electronic equipment and storage medium |
CN111709247B (en) * | 2020-05-20 | 2023-04-07 | 北京百度网讯科技有限公司 | Data set processing method and device, electronic equipment and storage medium |
CN113836885A (en) * | 2020-06-24 | 2021-12-24 | 阿里巴巴集团控股有限公司 | Text matching model training method, text matching device and electronic equipment |
CN112328710A (en) * | 2020-11-26 | 2021-02-05 | 北京百度网讯科技有限公司 | Entity information processing method, entity information processing device, electronic equipment and storage medium |
CN112328710B (en) * | 2020-11-26 | 2024-06-11 | 北京百度网讯科技有限公司 | Entity information processing method, device, electronic equipment and storage medium |
CN113254609A (en) * | 2021-05-12 | 2021-08-13 | 同济大学 | Question-answering model integration method based on negative sample diversity |
CN113434792A (en) * | 2021-07-20 | 2021-09-24 | 北京百度网讯科技有限公司 | Training method of network address matching model and network address matching method |
CN113434792B (en) * | 2021-07-20 | 2023-07-18 | 北京百度网讯科技有限公司 | Training method of network address matching model and network address matching method |
CN114119989A (en) * | 2021-11-29 | 2022-03-01 | 北京百度网讯科技有限公司 | Training method and device for image feature extraction model and electronic equipment |
CN114119989B (en) * | 2021-11-29 | 2023-08-11 | 北京百度网讯科技有限公司 | Training method and device for image feature extraction model and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110543558B (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110543558B (en) | Question matching method, device, equipment and medium | |
CN111507104B (en) | Method and device for establishing label labeling model, electronic equipment and readable storage medium | |
CN111428008B (en) | Method, apparatus, device and storage medium for training a model | |
CN112560912B (en) | Classification model training method and device, electronic equipment and storage medium | |
CN111125335B (en) | Question and answer processing method and device, electronic equipment and storage medium | |
CN111639710A (en) | Image recognition model training method, device, equipment and storage medium | |
CN112036509A (en) | Method and apparatus for training image recognition models | |
CN111104514A (en) | Method and device for training document label model | |
CN111767359B (en) | Point-of-interest classification method, device, equipment and storage medium | |
US11915484B2 (en) | Method and apparatus for generating target re-recognition model and re-recognizing target | |
CN111950291A (en) | Semantic representation model generation method and device, electronic equipment and storage medium | |
CN111079945B (en) | End-to-end model training method and device | |
CN111667056A (en) | Method and apparatus for searching model structure | |
CN112149741A (en) | Training method and device of image recognition model, electronic equipment and storage medium | |
CN111522944A (en) | Method, apparatus, device and storage medium for outputting information | |
CN111782785B (en) | Automatic question and answer method, device, equipment and storage medium | |
CN111324715A (en) | Method and device for generating question-answering robot | |
CN113342946A (en) | Model training method and device for customer service robot, electronic equipment and medium | |
CN111640103A (en) | Image detection method, device, equipment and storage medium | |
CN114860913A (en) | Intelligent question-answering system construction method, question-answering processing method and device | |
CN111241838A (en) | Text entity semantic relation processing method, device and equipment | |
CN112529180A (en) | Method and apparatus for model distillation | |
CN112417156A (en) | Multitask learning method, device, equipment and storage medium | |
CN111325000B (en) | Language generation method and device and electronic equipment | |
CN112541362A (en) | Generalization processing method, device, equipment and computer storage medium |
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 |