CN109726396A - Semantic matching method, device, medium and the electronic equipment of question and answer text - Google Patents
Semantic matching method, device, medium and the electronic equipment of question and answer text Download PDFInfo
- Publication number
- CN109726396A CN109726396A CN201811563115.6A CN201811563115A CN109726396A CN 109726396 A CN109726396 A CN 109726396A CN 201811563115 A CN201811563115 A CN 201811563115A CN 109726396 A CN109726396 A CN 109726396A
- Authority
- CN
- China
- Prior art keywords
- feature
- text
- vector
- syntactic structure
- candidate answers
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 79
- 238000013528 artificial neural network Methods 0.000 claims abstract description 27
- 230000000306 recurrent effect Effects 0.000 claims abstract description 23
- 239000013598 vector Substances 0.000 claims description 358
- 239000000203 mixture Substances 0.000 claims description 16
- 238000012545 processing Methods 0.000 claims description 8
- 230000002457 bidirectional effect Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 5
- 230000006403 short-term memory Effects 0.000 claims description 5
- 210000004218 nerve net Anatomy 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 14
- 238000013135 deep learning Methods 0.000 abstract description 4
- 230000007246 mechanism Effects 0.000 abstract description 4
- 238000013136 deep learning model Methods 0.000 abstract description 2
- 238000005516 engineering process Methods 0.000 abstract description 2
- 230000015654 memory Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 7
- 239000011159 matrix material Substances 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 4
- 230000006854 communication Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012549 training Methods 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000005291 magnetic effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000001351 cycling effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000010348 incorporation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 210000005036 nerve Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000003014 reinforcing effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Machine Translation (AREA)
Abstract
Present disclose provides a kind of semantic matching method of question and answer text, this method can efficiently solve the problems in the relevant technologies.Such as, question and answer text semantic matching technique based on deep learning model in the related art, it can only provide context part semantic feature information, lack the syntactic feature information of background global characteristics information and question and answer text, lead to feature unification, the semantic matches information of question and answer text cannot be embodied completely.And the present invention provides a kind of question and answer text semantic matching process based on multi-stage characteristics and deep learning, word and syntactic information to question and answer text, which carry out word and syntactic structure distribution, to be indicated, and the context local feature information and syntactic structure characteristic information of question and answer text are extracted using Recognition with Recurrent Neural Network, then background global characteristics information is extracted with attention mechanism, keep the characteristic information of question and answer text richer, to improve the matched accuracy of question and answer text semantic.
Description
Technical field
The present invention relates to natural language processing technique fields, in particular to a kind of semantic matches side of question and answer text
Method, device, medium and electronic equipment.
Background technique
Currently, the matched method of question and answer text semantic based on deep learning may include following steps: being based on nerve net
The word incorporation model of network training carries out term vector expression to text, indicates that semantic ability is stronger.By constructing long short-term memory
Network LSTM (Long Short-Term Memory) or gating cycle unit GRU (Gated Recurrent Unit) even depth
The models such as study are to text modeling.Although these methods are lower to Feature Selection dependence, it is shallow that it is extracted text to a certain extent
Layer semantic information and context local feature, but a large amount of emphasis global characteristics and syntactic structure feature cannot be extracted, therefore reduce
Question and answer text semantic matched accuracy.
It should be noted that information is only used for reinforcing the reason to background of the invention disclosed in above-mentioned background technology part
Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
Semantic matching method, device, medium and the electronics for being designed to provide a kind of question and answer text of the embodiment of the present invention
Equipment, and then can at least overcome the problems, such as that the matched accuracy of question and answer text semantic is lower to a certain extent.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention
Practice and acquistion.
According to a first aspect of the embodiments of the present invention, a kind of semantic matching method of question and answer text is provided, comprising: utilize
Recognition with Recurrent Neural Network obtains the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of question text,
And obtain the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of candidate answers text;It is based on
Multi-stage characteristics sequence vector and the described problem text with context local feature and syntactic structure feature of described problem text
The attention of each feature vector in this multi-stage characteristics sequence vector with context local feature and syntactic structure feature
Weight, generate described problem text with context local feature, syntactic structure feature and global characteristics feature vector,
And the multi-stage characteristics sequence vector with context local feature and syntactic structure feature based on the candidate answers text
With it is each in the multi-stage characteristics sequence vector of the candidate answers text with context local feature and syntactic structure feature
The attention weight of feature vector, generate the candidate answers text with context local feature, syntactic structure feature
With the feature vector of global characteristics;According to described problem text with context local feature, syntactic structure feature and it is complete
The feature vector of office's feature and the candidate answers text with context local feature, syntactic structure feature and the overall situation it is special
The feature vector of sign determines the semantic matching degree of described problem text Yu the candidate answers text.
In some embodiments of the invention, the local with context of question text is being obtained using Recognition with Recurrent Neural Network
The multi-stage characteristics sequence vector of feature and syntactic structure feature, and acquisition candidate answers text have context local feature
Before the multi-stage characteristics sequence vector of syntactic structure feature, this method further include: constructed according to knowledge base question and answer corpus of text
Professional question and answer dictionary;Described problem text and the candidate answers text are analyzed according to the professional question and answer dictionary, obtained
To the word, the syntactic structure of described problem text and word, the candidate of the candidate answers text of described problem text
The syntactic structure of answer text;To the word of described problem text, the syntactic structure of described problem text and the candidate answers
The word of text, the candidate answers text syntactic structure carry out distributed expression respectively, obtain the term vector of question text
With the vector sequence of term vector and syntactic structure the vector composition of the sequence vector and candidate answers text of syntactic structure vector composition
Column.
In some embodiments of the invention, aforementioned schemes are based on, the Recognition with Recurrent Neural Network includes bidirectional circulating nerve
Network, the Recognition with Recurrent Neural Network in the bidirectional circulating neural network include based on long short-term memory LSTM and/or based on gate
The network of cycling element GRU.
In some embodiments of the invention, aforementioned schemes are based on, it is above-mentioned further include: based on having for described problem text
The multi-stage characteristics sequence vector and the candidate answers text of context local feature and syntactic structure feature have context
The multi-stage characteristics sequence vector of local feature and syntactic structure feature, generates background information, and the background information includes described asks
All time states of the term vector of the term vector and the candidate answers of inscribing text before the Recognition with Recurrent Neural Network last moment
Semantic information and syntactic structure information;According to the background information, determine described problem text has context part special
The attention weight of each moment feature vector and the candidate answer in the multi-stage characteristics sequence vector for syntactic structure feature of seeking peace
Each moment feature vector in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of case text
Attention weight.
In some embodiments of the invention, aforementioned schemes are based on, context part is had based on described problem text
The multi-stage characteristics sequence vector and described problem text of feature and syntactic structure feature have context local feature and syntax
It is upper to generate having for described problem text for the attention weight of each feature vector in the multi-stage characteristics sequence vector of structure feature
Hereafter local feature, syntactic structure feature and global characteristics feature vector include: according to the background information, determine described in
In the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of background information and described problem text
Each moment feature vector similarity;According to the background information with described problem text with context local feature
With the similarity of each moment feature vector in the multi-stage characteristics sequence vector of syntactic structure feature, described problem text is determined
The characteristic vector sequence with context local feature in each moment feature vector attention weight;It is asked according to described
Inscribe each moment feature in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of text to
The attention weight of amount, to the multi-stage characteristics vector with context local feature and syntactic structure feature of described problem text
Each moment feature vector in sequence is weighted and is summed, and obtain described problem text has context local feature, syntax
The feature vector of structure feature and global characteristics.
In some embodiments of the invention, aforementioned schemes are based on, context is had based on the candidate answers text
The multi-stage characteristics sequence vector and the candidate answers text of local feature and syntactic structure feature have context part special
The attention weight of each feature vector, generates the candidate answers in the multi-stage characteristics sequence vector for syntactic structure feature of seeking peace
Text with context local feature, syntactic structure feature and the feature vectors of global characteristics include: according to the background
Information determines the more with context local feature and syntactic structure feature of the background information and the candidate answers text
The similarity of each moment feature vector in grade characteristic vector sequence;According to the background information and the candidate answers text
The multi-stage characteristics sequence vector with context local feature and syntactic structure feature in each moment feature vector phase
Like degree, the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of the candidate answers text is determined
In each moment feature vector attention weight;There is context local feature and sentence according to the candidate answers text
The attention weight of each moment feature vector in the multi-stage characteristics sequence vector of method structure feature, to the candidate answers text
Each moment feature vector in this multi-stage characteristics sequence vector with context local feature and syntactic structure feature adds
Weigh and sum, obtain the candidate answers text with context local feature, syntactic structure feature and global characteristics
Feature vector.
In some embodiments of the invention, aforementioned schemes are based on, context part is had according to described problem text
Feature, syntactic structure feature and global characteristics feature vector and the candidate answers text have the context part special
Sign, syntactic structure feature and global characteristics feature vector, determine the language of described problem text Yu the candidate answers text
Adopted matching degree include: to described problem text with context local feature, syntactic structure feature and global characteristics spy
Levy vector sum described in candidate answers text with context local feature, syntactic structure feature and global characteristics feature to
Amount is spliced;Classified using classifier to spliced feature vector, obtains described problem text and answered with the candidate
The matching degree of case text.
According to a second aspect of the embodiments of the present invention, a kind of semantic matches device of question and answer text is provided, comprising: obtain
Module obtains the multi-stage characteristics with context local feature and syntactic structure feature of question text using Recognition with Recurrent Neural Network
Sequence vector, and obtain the multi-stage characteristics vector with context local feature and syntactic structure feature of candidate answers text
Sequence;Generation module, the multi-stage characteristics with context local feature and syntactic structure feature based on described problem text to
It measures every in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of sequence and described problem text
The attention weight of a feature vector generates the sum with context local feature, syntactic structure feature of described problem text
The feature vector of global characteristics, and context local feature and syntactic structure feature are had based on the candidate answers text
Multi-stage characteristics sequence vector and the candidate answers text the multistage with context local feature and syntactic structure feature
The attention weight of each feature vector in characteristic vector sequence, generate the candidate answers text has context part special
Sign, syntactic structure feature and global characteristics feature vector;Determining module, for having up and down according to described problem text
Literary local feature, syntactic structure feature and global characteristics feature vector and the candidate answers text have context office
Portion's feature, syntactic structure feature and global characteristics feature vector, determine described problem text and the candidate answers text
Semantic matching degree.
According to a third aspect of the embodiments of the present invention, a kind of electronic equipment is provided, comprising: one or more processors;
Storage device, for storing one or more programs, when one or more of programs are held by one or more of processors
When row, so that one or more of processors realize semantic of the question and answer text as described in first aspect in above-described embodiment
Method of completing the square.
According to a fourth aspect of the embodiments of the present invention, a kind of computer-readable medium is provided, computer is stored thereon with
Program realizes the semantic matches of the question and answer text as described in first aspect in above-described embodiment when described program is executed by processor
Method.
Technical solution provided in an embodiment of the present invention can include the following benefits:
Question and answer text semantic matching technique based on deep learning model in the related art, can only provide context office
Portion's semantic feature information lacks the syntactic feature information of background global characteristics information and question and answer text, leads to feature unification, no
The semantic matches information of question and answer text can be embodied completely.In order to solve this problem, the present invention provides one kind to be based on multi-stage characteristics
With the question and answer text semantic matching process of deep learning, word and syntactic information to question and answer text carry out word and syntactic structure
Distribution indicates, and the context local feature information and syntactic structure feature letter of question and answer text are extracted using Recognition with Recurrent Neural Network
Then breath extracts background global characteristics information with attention mechanism, keeps the characteristic information of question and answer text richer, to improve
The matched accuracy of question and answer text semantic.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.It should be evident that the accompanying drawings in the following description is only the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.In the accompanying drawings:
Fig. 1 diagrammatically illustrates the process of the semantic matching method of question and answer text according to an embodiment of the invention
Figure;
Fig. 2 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure;
Fig. 3 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure;
Fig. 4 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure;
Fig. 5 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure;
Fig. 6 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure;
Fig. 7 diagrammatically illustrates the block diagram of the semantic matches device of question and answer text according to an embodiment of the invention;
Fig. 8 shows the structural schematic diagram for being suitable for the computer system for the electronic equipment for being used to realize the embodiment of the present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the present invention will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
Fig. 1 diagrammatically illustrates the process of the semantic matching method of question and answer text according to an embodiment of the invention
Figure.
As shown in Figure 1, the semantic matching method of question and answer text includes step S110~step S140.
In step s 110, there is context local feature and syntax knot using Recognition with Recurrent Neural Network acquisition question text
The multi-stage characteristics sequence vector of structure feature, and obtain the special with context local feature and syntactic structure of candidate answers text
The multi-stage characteristics sequence vector of sign.
In the step s 120, the multistage with context local feature and syntactic structure feature based on described problem text
The multi-stage characteristics vector sequence with context local feature and syntactic structure feature of characteristic vector sequence and described problem text
The attention weight of each feature vector in column, generate described problem text has context local feature, syntactic structure special
Sign and global characteristics feature vectors, and context local feature and syntax knot are had based on the candidate answers text
The multi-stage characteristics sequence vector of structure feature and the candidate answers text have context local feature and syntactic structure feature
Multi-stage characteristics sequence vector in each feature vector attention weight, generate the candidate answers text have context
Local feature, syntactic structure feature and global characteristics feature vector.
In step s 130, according to described problem text with context local feature, syntactic structure feature and it is complete
The feature vector of office's feature and the candidate answers text with context local feature, syntactic structure feature and the overall situation it is special
The feature vector of sign determines the semantic matching degree of described problem text Yu the candidate answers text.
This method can according to question text with context local feature, syntactic structure feature and global characteristics
Feature vector and candidate answers text with context local feature, syntactic structure feature and global characteristics feature vector
The semantic matching degree of question text Yu candidate answers text is determined, to improve the matched accuracy of question and answer text semantic.
In one embodiment of the invention, the semantic matching method of above-mentioned question and answer text can be applied to intelligent answer
In robot system, so that the answer that intelligent answer robot system provides a user is more accurate, to improve user's body
It tests.Certainly, intelligent answer robot system is an illustrative example, and this method is also applied to other scenes,
This is without limitation.
In one embodiment of the invention, the Recognition with Recurrent Neural Network in step S110 includes bidirectional circulating neural network,
The middle Recognition with Recurrent Neural Network of the bidirectional circulating neural network can be based on long short-term memory LSTM and/or based on gating cycle list
The network etc. of first GRU.
It in one embodiment of the invention, can be according to knowledge base question and answer text (i.e. question text and candidate answers text
This) the professional question and answer dictionary of corpus building, it can be to question and answer text (i.e. question text and candidate answers by the profession question and answer dictionary
Text) participle word and syntactic structure carry out distributed expression, obtain term vector and syntax vector composition sequence vector.Example
Such as, which can recognize daily vocabulary, can also recognize the proprietary name of specific area (for example, insurance, electric business)
Word.In addition, only need to be added to profession if having other proper nouns after in the text database of the specific area and ask
In thank-you speech allusion quotation.
For example, professional question and answer dictionary can be constructed according to the corpus of current intelligent Answer System knowledge base, to customer issue,
Candidate answers in question and answer Candidate Set carry out word segmentation processing and sentence structure analysis, and carry out distributed expression to them respectively,
The sequence vector of term vector and syntax vector composition is obtained to get term vector and syntactic structure the vector composition for having arrived question text
Sequence vector and candidate answers text term vector and syntactic structure vector composition sequence vector.
In one embodiment of the invention, the sequence vector term vector of question text and syntactic structure vector formed
The sequence vector formed with the term vector and syntactic structure vector of candidate answers text is separately input to respective circulation nerve net
Network learns and extracts the multi-stage characteristics sequence vector with context local feature semantic information and syntactic structure information, and exports
Respective multi-stage characteristics characteristic vector sequence.For example, to utilize the two-way length numeralization question and answer of memory network Bi-LSTM capture in short-term
It is upper to obtain having for the two for the context local feature and syntactic structure feature of text (i.e. question text and candidate answers text)
For the characteristic vector sequence of following traits and syntactic structure feature, step S110 is described in detail.
Specifically, in step s 110, can be by using identical vocabulary length after professional question and answer dictionary conversion the problem of
The term vector sequence of text and candidate answers text is separately input to two two-way length, and memory network Bi-LSTM is extracted up and down in short-term
Literary local feature and syntactic structure feature.It, can be respectively by the word of positive sequence question text and candidate answers text in Bi-LSTM
Term vector sequence inputting two long memory network LSTM in short-term of sequence vector and inverted order question text and candidate answers text,
During input the text information at current time can be calculated in conjunction with the information of last time.The calculation formula of LSTM is as follows:
it=σ (Wxixt+Whiht-1+Wcict-1+bi)
ft=σ (Wxfxt+Whfht-1+Wcfct-1+bf)
ct=ftct-1+ittanh(Wxcxt+Whcht-1+bc)
ot=σ (Wxoxt+Whoht-1+Wcoct+bo)
ht=ottanh(ct)
Wherein, σ indicates that sigmoid activation primitive, tanh indicate tanh activation primitive, xtIndicate that step S110 is obtained
The word of t moment is embedded in vector, itIndicate the output vector of t moment input gate, ftIndicate that t moment forgets the output vector of door, otTable
Show the output vector of t moment out gate, ctAnd ct-1Respectively indicate the memory stream mode of t moment and the cell factory at t-1 moment, ht
And ht-1Respectively indicate t moment and t-1 moment hidden layer vector.Weight matrix and offset parameter description have apparent meaning, such as
WxiIndicate the weight matrix of input and input gate, WhiIndicate the weight matrix of hidden layer and input gate, WciIndicate cell factory and
The weight matrix of input gate, bi、bfIt indicates input gate and forgets the offset parameter of door, footmark indicates affiliated calculating section.This
In parameter matrix and offset parameter be all first random initializtion, then in the model training based on bidirectional circulating neural network
Automatic amendment, can finally obtain final weight with Recognition with Recurrent Neural Network.
For each moment t, the input of moment t can be allowed to learn to preceding moment (for example, t+1) and rear moment (for example, t-
1) semantic information and syntactic structure information, by splicing positive sequence question and answer text (i.e. question text and candidate answers text) word to
Measure two length memory networks of sequence and inverted order question and answer text (i.e. question text and candidate answers text) term vector sequence
The feature vector h of LSTM outputfwAnd hbw, as the final feature vector output of Bi-LSTM moment t, the dimension of feature vector
It is 2 times of LSTM output feature vector dimension.
ht=[hfw,hbw]
Wherein, hfwIndicate the LSTM of processing positive sequence question and answer text (i.e. question text and candidate answers text) term vector sequence
The output of network, hbwIndicate the LSTM net of processing inverted order question and answer text (i.e. question text and candidate answers text) term vector sequence
The output of network, htThe term vector and syntactic structure of the problem of feature vector of expression Bi-LSTM moment t exports, i.e. moment t text
The feature vector of term vector and syntactic structure the vector composition of the feature vector and candidate answers text of vector composition.By this method
Study, available corresponding multi-stage characteristics vector sequence are trained using Bi-LSTM to question and answer text and candidate answers text
The sequence vector of column, the i.e. term vector of question text and syntactic structure vector composition and the term vector and syntax of candidate answers text
The sequence vector of structure vector composition.
According to an embodiment of the invention, above-mentioned Bi-LSTM is based on the two-way of the LSTM of memory network in short-term two long formation
Long memory network in short-term.
According to an embodiment of the invention, can use the calculation formula of LSTM in question text and candidate answers text
After each term vector is handled, the feature with context local feature syntactic structure feature sign of available question text
The characteristic vector sequence with context local feature and syntactic structure feature of sequence vector and candidate answers text.
Fig. 2 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure.
As shown in Fig. 2, the above method further includes step S210~step S230 before step S1101.
In step S210, professional question and answer dictionary is constructed according to knowledge base question and answer corpus of text.
In step S220, described problem text and the candidate answers text are carried out according to the professional question and answer dictionary
Analysis, obtains the word of described problem text, the word of the syntactic structure of described problem text and the candidate answers text, institute
State the syntactic structure of candidate answers text.
In step S230, the word of described problem text, the syntactic structure of described problem text and the candidate are answered
The word of case text, the candidate answers text syntactic structure carry out distributed expression respectively, obtain the word of question text to
The vector of term vector and syntactic structure the vector composition of the sequence vector and candidate answers text of amount and syntactic structure vector composition
Sequence.
This method includes that can be analyzed according to professional question and answer dictionary question text and candidate answers text, is asked
Inscribe the word of text, the word of syntactic structure and candidate answers text, syntactic structure, be convenient in this way to the word of question text,
The word of syntactic structure and candidate answers text, syntactic structure carry out distributed expression respectively, obtain the term vector of question text
With the vector sequence of term vector and syntactic structure the vector composition of the sequence vector and candidate answers text of syntactic structure vector composition
Column, facilitate the vector sequence that later use Recognition with Recurrent Neural Network is formed from the term vector and syntactic structure vector of question text in this way
Context local feature, syntax are extracted in the sequence vector of term vector and syntactic structure the vector composition of column and candidate answers text
The feature of structure feature and global characteristics.
According to an embodiment of the invention, can be constructed according to knowledge base question and answer corpus of text in existing intelligent Answer System special
Industry question and answer dictionary.It is carried out for the candidate answers text in question text and Candidate Set using participle tool and syntactic analysis tool
Word segmentation processing and sentence structure analysis, using the embedding layer of deep learning frame keras to question text and candidate answers
The respective textual words of text and syntax result carry out distributed expression and are converted into respective term vector and syntax vector,
Embedding layers of parameters with depth learning model is together obtained by training.And it is question text and candidate answers text is respective
Term vector and syntax vector form sequence vector.In order to facilitate the calculating of term vector sequence, length choosing is carried out to term vector sequence
Fixed, short sequence vector length is supplemented with 0, and sequence vector length, which is greater than limit value, to be intercepted.
Fig. 3 meaning property shows the flow chart of the semantic matching method of question and answer text according to another embodiment of the invention
If Fig. 3 shows, other than step S110~step S130 of Fig. 1 embodiment description, this method further includes step
S310 and step S320.
In step s310, the multistage with context local feature and syntactic structure feature based on described problem text
The multi-stage characteristics with context local feature and syntactic structure feature of characteristic vector sequence and the candidate answers text to
Measure sequence, generate background information, the background information include described problem text term vector and the candidate answers word to
Measure the semantic information and syntactic structure information of all time states before the Recognition with Recurrent Neural Network last moment.
In step s 320, according to the background information, determine described problem text have context local feature and
The attention weight of each moment feature vector and candidate answers text in the multi-stage characteristics sequence vector of syntactic structure feature
The note of each moment feature vector in this multi-stage characteristics sequence vector with context local feature and syntactic structure feature
Meaning power weight.
This method passes through using the semantic information of all time states before the Recognition with Recurrent Neural Network last moment as problem
The background information of text and candidate answers text, and there is context local feature with reference to the background information computational problem text
With the attention weight and candidate answers text of moment feature vector each in the multi-stage characteristics sequence vector of syntactic structure feature
The multi-stage characteristics sequence vector with context local feature and syntactic structure feature in each moment feature vector attention
Power weight, the attention weight being calculated by this method can be effectively reflected question and answer text (i.e. question text and candidate
Answer text) Deep Semantics information syntactic structure feature and global characteristics, asked to overcome the prior art and only reflect
Answer the shallow semantic information of text (i.e. question text and candidate answers text) and the defect of context local feature.
In one embodiment of the invention, above-mentioned background information can be On The Choice text respectively and candidate answers text
This, which carries out vector splicing as background information in the feature vector of the last moment state of Bi-LSTM, indicates, this background information packet
Text containing question and answer (i.e. question text and candidate answers text) semantic information of all time states and syntactic structure information before this.
It specifically, can be respectively from the multi-stage characteristics vector with context local feature and syntactic structure feature of above problem text
It is chosen in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of sequence and candidate answers text
The two carries out vector in the feature vector of the last moment state of Bi-LSTM and carries out splicing as above-mentioned background information.In addition,
Since the background information is the spy of question and answer text (i.e. question text and candidate answers text) in the last moment state of Bi-LSTM
Vector is levied, therefore the feature vector of last moment state can be obtained by the calculation formula of LSTM.For example, combination can be passed through
The feature vector of all last time states in LSTM before the last moment is calculated, therefore the background information includes question and answer
Text (i.e. question text and candidate answers text) semantic information of all time states and syntactic structure information before this.
There is context below with reference to what Fig. 4 and Fig. 5 specifically described the problem of how obtaining text and candidate answers text
Local feature, syntactic structure feature and global characteristics feature vector.
Fig. 4 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure.
As shown in figure 4, " there is context local feature and syntactic structure based on described problem text in step S120
The multi-stage characteristics sequence vector of feature and the multistage with context local feature and syntactic structure feature of described problem text
The attention weight of each feature vector in characteristic vector sequence, generate described problem text have context local feature,
Syntactic structure feature and global characteristics feature vectors " can specifically include step S121, step S122 and step S123.
In step S121, according to the background information, determine that the background information and having for described problem text are upper
The hereafter similarity of each moment feature vector in local feature and the multi-stage characteristics sequence vector of syntactic structure feature.
In step S122, according to the background information with described problem text with context local feature and syntax
The similarity of each moment feature vector in the multi-stage characteristics sequence vector of structure feature, determines having for described problem text
The attention weight of each moment feature vector in the characteristic vector sequence of context local feature.
In step S123, according to the multistage with context local feature and syntactic structure feature of described problem text
The attention weight of each moment feature vector in characteristic vector sequence has context part special in described problem text
Each moment feature vector in the multi-stage characteristics sequence vector for syntactic structure feature of seeking peace is weighted and is summed, and obtains described problem
The feature vector with context local feature, syntactic structure feature and global characteristics of text.
Fig. 5 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure.
As shown in figure 5, " there is context local feature and syntax based on the candidate answers text in step S120
The multi-stage characteristics sequence vector of structure feature and the candidate answers text have context local feature and syntactic structure special
The attention weight of each feature vector in the multi-stage characteristics sequence vector of sign, generate the candidate answers text has up and down
Literary local feature, syntactic structure feature and global characteristics feature vector " can specifically include step S124, step S125 and
Step S126.
In step S124, according to the background information, the tool of the background information Yu the candidate answers text is determined
There is the similarity of each moment feature vector in context local feature and the multi-stage characteristics sequence vector of syntactic structure feature.
In step s 125, according to the background information and the candidate answers text have context local feature and
The similarity of each moment feature vector in the multi-stage characteristics sequence vector of syntactic structure feature determines the candidate answers text
Originally each moment feature vector in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature
Attention weight.
In step S126, according to the candidate answers text with context local feature and syntactic structure feature
The attention weight of each moment feature vector in multi-stage characteristics sequence vector, to having up and down for the candidate answers text
Each moment feature vector in literary local feature and the multi-stage characteristics sequence vector of syntactic structure feature is weighted and is summed, and is obtained
The candidate answers text with context local feature, syntactic structure feature and global characteristics feature vector.
According to an embodiment of the invention, calculating the tool of the background information and question text by reference to above-mentioned background information
There is the similarity of the feature vector at each moment in context local feature and the multi-stage characteristics sequence vector of syntactic structure feature
With with it is each in multi-stage characteristics sequence vectors of the candidate answers text with context local feature and syntactic structure feature when
The similarity of the feature vector at quarter, then according to question and answer text (i.e. question text and candidate answers text) in Bi-LSTM
The similarity of the feature vector at each moment come computational problem text with context local feature and syntactic structure feature
The attention weight of each moment feature vector and candidate answers text has context part in multi-stage characteristics sequence vector
The attention weight of each moment feature vector, is counted by this method in the multi-stage characteristics sequence vector of feature and syntactic structure feature
Obtained attention weight can be effectively reflected the deep layer language of question and answer text (i.e. question text and candidate answers text)
The syntactic structure feature and global characteristics of adopted information, so that overcoming the prior art only reflects question and answer text (i.e. question text
With candidate answers text) shallow semantic information and context local feature defect.
It in one embodiment of the invention, can be according to the basic think of of attention mechanism (soft attention model)
Think, On The Choice text and candidate answers text carry out vector splicing in the feature vector of the last moment state of Bi-LSTM and make
For background information expression, this background information includes question and answer text (i.e. question text and candidate answers text) institute's having time shape before this
The semantic information and syntactic structure information of state.By full articulamentum, dimension is dropped into half, with question text and candidate answers text
Originally consistent in the output sequence vector dimension of Bi-LSTM.Its parameter is expressed as bkg.It can specifically be obtained by three phases
The multi-stage characteristics sequence vector with context local feature and syntactic structure feature of question text and candidate answers text.
First stage: background information bkg and problem answers text can be calculated in Bi- using text similarity formula respectively
T exports feature vector h at the time of in LSTMtSimilarity, specific formula is as follows:
simt=bkght
Wherein, simtBe expressed as background information bkg and question and answer text (i.e. question text and candidate answers text) has
Some term vector h in context local feature and the multi-stage characteristics sequence vector of syntactic structure featuretAt the time of t it is similar
Degree.Therefore it is calculated separately according to the formula and goes wrong text and candidate answers text corresponds to similarity matrix SimqAnd Sima.According to
The formula, which can calculate separately, goes wrong text and candidate answers text corresponds to similarity vector SimqAnd Sima。
Second stage introduces softmax calculation, carries out numerical value conversion, a side to the similarity score of first stage
Face can be normalized, and original calculation score value is organized into the probability distribution that all elements weights sum is 1;On the other hand
The weight of important information in inherent mechanism more the outstanding problem text and candidate answers text of softmax can be passed through.Formula
It is as follows:
Wherein, atHave context part special for t moment question and answer text (i.e. question text and candidate answers text)
The attention weight of some feature vector in the multi-stage characteristics sequence vector for syntactic structure feature of seeking peace, N be multi-stage characteristics to
Measure the length of sequence.Similarity vector Sim can be passed through respectively according to the formulaqAnd SimaIt calculates question text and candidate answers
The attention weight a of each moment t of case textqtAnd aat。
Phase III, aqtAnd aatRespectively question and answer text (i.e. question text and candidate answers text) has context
Some feature vector in local feature and the multi-stage characteristics sequence vector of syntactic structure feature is weighed in the attention of t moment
Weight, needs the output vector h with problem and candidate answers text t moment wordtThe weighting of attention weight is carried out, question and answer are constituted
Text (i.e. question text and candidate answers text) new vector s of t moment wordt.The formula is as follows:
st=atht
Then to the s that each moment obtainstIt sums, generates question and answer text (i.e. question text and candidate answers text)
Respective attention numerical value vector the feature vector with context local feature and global characteristics of question text and has
Context local feature, syntactic structure feature and global characteristics feature vector, specific formula is as follows:
Wherein, atFor the attention weight of t moment word, N is the length of multi-stage characteristics sequence vector, Attention
For attention numerical value vector.
By the above stage, the tool of question and answer text (i.e. question text and candidate answers text) is calculated according to background information
There is each feature vector in context local feature and the multi-stage characteristics sequence vector of syntactic structure feature in each t moment
Then attention weight is paid attention to the feature vector of question and answer text (i.e. question text and candidate answers text) t moment
The weighting of power weight, then sums.Question text and candidate answers text can be constructed respectively in this way has context office
Portion's feature, syntactic structure feature and global characteristics feature vector.
Fig. 6 diagrammatically illustrates the process of the semantic matching method of question and answer text according to another embodiment of the invention
Figure.
As shown in fig. 6, the step S130 in Fig. 1 embodiment can specifically include step S131 and step S132.
In step S131, to described problem text with context local feature, syntactic structure feature and it is global
The feature vector of feature and the candidate answers text with context local feature, syntactic structure feature and global characteristics
Feature vector spliced.
In step S132, classified using classifier to spliced feature vector, obtain described problem text with
The matching degree of the candidate answers text.
This method can to described problem text with context local feature, syntactic structure feature and global characteristics
Feature vector and the candidate answers text with context local feature, syntactic structure feature and global characteristics spy
Sign vector is spliced, and is then classified using classifier to spliced feature vector, is obtained question text and the time
Select the matching degree of answer text.For example, attention numerical value vector corresponding to question text and candidate answers text is spelled
It connects, new feature vector is inputted into full articulamentum, finally carries out matched two points of question and answer text semantic using softmax classifier
Class judgement, the predicted value of obtained prediction result (matching, mismatch) is ranked up as matching degree, can be returned in this way
With the best candidate answers of degree.
Fig. 7 diagrammatically illustrates the block diagram of the semantic matches device of question and answer text according to an embodiment of the invention.
As shown in fig. 7, the semantic matches device 700 of question and answer text includes obtaining module 710, generation module 720 and determining
Module 730.
Specifically, obtain module 710, using Recognition with Recurrent Neural Network obtain question text have context local feature and
The multi-stage characteristics sequence vector of syntactic structure feature, and acquisition candidate answers text have context local feature and syntax
The multi-stage characteristics sequence vector of structure feature.
Generation module 720, the multistage with context local feature and syntactic structure feature based on described problem text
The multi-stage characteristics vector sequence with context local feature and syntactic structure feature of characteristic vector sequence and described problem text
The attention weight of each feature vector in column, generate described problem text has context local feature, syntactic structure special
Sign and global characteristics feature vectors, and context local feature and syntax knot are had based on the candidate answers text
The multi-stage characteristics sequence vector of structure feature and the candidate answers text have context local feature and syntactic structure feature
Multi-stage characteristics sequence vector in each feature vector attention weight, generate the candidate answers text have context
Local feature, syntactic structure feature and global characteristics feature vector.
Determining module 730, for the sum with context local feature, syntactic structure feature according to described problem text
The feature vector of global characteristics and the candidate answers text with context local feature, syntactic structure feature and it is global
The feature vector of feature determines the semantic matching degree of described problem text Yu the candidate answers text.
The semantic matches device 700 of the question and answer text can have context local feature and the overall situation according to question text
Characteristic vector sequence, the characteristic vector sequence with context local feature and global characteristics of candidate answers text of feature,
It determines the semantic matching degree of question text Yu candidate answers text, answering for the question text then can be determined according to the matching degree
Case, the answer of text is more accurate the problem of acquisition by this method.
According to an embodiment of the invention, the semantic matches device 700 of question and answer text can be used to implement above-mentioned FIG. 1 to FIG. 6
The semantic matching method of the question and answer text of description.
Since the modules of the semantic matches device 700 of the question and answer text of example embodiments of the present invention can be used for reality
The step of example embodiment of the semantic matching method of existing above-mentioned question and answer text, therefore for not draped over one's shoulders in apparatus of the present invention embodiment
The details of dew please refers to the embodiment of the semantic matching method of the above-mentioned question and answer text of the present invention.
Below with reference to Fig. 8, it illustrates the computer systems 800 for the electronic equipment for being suitable for being used to realize the embodiment of the present invention
Structural schematic diagram.The computer system 800 of electronic equipment shown in Fig. 8 is only an example, should not be to the embodiment of the present invention
Function and use scope bring any restrictions.
As shown in figure 8, computer system 800 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 802 or be loaded into the program in random access storage device (RAM) 803 from storage section 808 and
Execute various movements appropriate and processing.In RAM 803, it is also stored with various programs and data needed for system operatio.CPU
801, ROM 802 and RAM 803 is connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to bus
804。
I/O interface 805 is connected to lower component: the importation 806 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 808 including hard disk etc.;
And the communications portion 809 of the network interface card including LAN card, modem etc..Communications portion 809 via such as because
The network of spy's net executes communication process.Driver 810 is also connected to I/O interface 805 as needed.Detachable media 811, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 810, in order to read from thereon
Computer program be mounted into storage section 808 as needed.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 809, and/or from detachable media
811 are mounted.When the computer program is executed by central processing unit (CPU) 501, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs
When standby execution, so that the electronic equipment realizes the semantic matching method such as above-mentioned question and answer text as described in the examples.
For example, the electronic equipment may be implemented as shown in Figure 1: in step s 110, utilizing circulation nerve net
Network obtains the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of question text, and obtains and wait
Select the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of answer text.In the step s 120,
It multi-stage characteristics sequence vector with context local feature and syntactic structure feature based on described problem text and described asks
Inscribe the note of each feature vector in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of text
Anticipate power weight, generate described problem text with context local feature, syntactic structure feature and global characteristics feature
Vector, and the multi-stage characteristics vector with context local feature and syntactic structure feature based on the candidate answers text
In the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of sequence and the candidate answers text
The attention weight of each feature vector, generate the candidate answers text has context local feature, syntactic structure special
Sign and global characteristics feature vectors.In step s 130, context local feature, sentence are had according to described problem text
Method structure feature and global characteristics feature vectors and the candidate answers text have context local feature, syntax knot
Structure feature and global characteristics feature vectors determine the semantic matching degree of described problem text Yu the candidate answers text.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description
Member, but this division is not enforceable.In fact, embodiment according to the present invention, it is above-described two or more
Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould
The feature and function of block or unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention
Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.
Claims (10)
1. a kind of semantic matching method of question and answer text, which is characterized in that this method comprises:
The multi-stage characteristics with context local feature and syntactic structure feature of question text are obtained using Recognition with Recurrent Neural Network
Sequence vector, and obtain the multi-stage characteristics vector with context local feature and syntactic structure feature of candidate answers text
Sequence;
Multi-stage characteristics sequence vector and the institute with context local feature and syntactic structure feature based on described problem text
State each feature vector in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of question text
Attention weight, generate described problem text with context local feature, syntactic structure feature and global characteristics
Feature vector, and the multi-stage characteristics with context local feature and syntactic structure feature based on the candidate answers text
The multi-stage characteristics vector sequence with context local feature and syntactic structure feature of sequence vector and the candidate answers text
The attention weight of each feature vector in column, generate the candidate answers text has context local feature, syntax knot
The feature vector of structure feature and global characteristics;
According to described problem text with context local feature, syntactic structure feature and global characteristics feature vector and
The candidate answers text with context local feature, syntactic structure feature and global characteristics feature vector, determine
The semantic matching degree of described problem text and the candidate answers text.
2. the method according to claim 1, wherein obtaining having for question text using Recognition with Recurrent Neural Network
The multi-stage characteristics sequence vector of context local feature and syntactic structure feature, and obtain having up and down for candidate answers text
Before literary local feature and the multi-stage characteristics sequence vector of syntactic structure feature, this method further include:
Professional question and answer dictionary is constructed according to knowledge base question and answer corpus of text;
Described problem text and the candidate answers text are analyzed according to the professional question and answer dictionary, obtain described problem
The word of text, the word of the syntactic structure of described problem text and the candidate answers text, the candidate answers text
Syntactic structure;
To the word of the word of described problem text, the syntactic structure of described problem text and the candidate answers text, described
The syntactic structure of candidate answers text carries out distributed expression respectively, obtains the term vector and syntactic structure Vector Groups of question text
At sequence vector and candidate answers text term vector and syntactic structure vector composition sequence vector.
3. the method according to claim 1, wherein the Recognition with Recurrent Neural Network includes bidirectional circulating nerve net
Network, the Recognition with Recurrent Neural Network in the bidirectional circulating neural network include being followed based on long short-term memory LSTM and/or based on gate
The network of ring element GRU.
4. the method according to claim 1, wherein this method further include:
Multi-stage characteristics sequence vector and the institute with context local feature and syntactic structure feature based on described problem text
The multi-stage characteristics sequence vector with context local feature and syntactic structure feature of candidate answers text is stated, background letter is generated
Breath, the background information include described problem text term vector and the candidate answers term vector Recognition with Recurrent Neural Network most
The semantic information and syntactic structure information of all time states before moment afterwards;
According to the background information, the multistage with context local feature and syntactic structure feature of described problem text is determined
The attention weight of each moment feature vector and the candidate answers text has context part in characteristic vector sequence
The attention weight of each moment feature vector in the multi-stage characteristics sequence vector of feature and syntactic structure feature.
5. according to the method described in claim 4, it is characterized in that, there is context local feature based on described problem text
There is context local feature and syntactic structure with the multi-stage characteristics sequence vector of syntactic structure feature and described problem text
The attention weight of each feature vector in the multi-stage characteristics sequence vector of feature, generate described problem text has context
The feature vector of local feature, syntactic structure feature and global characteristics includes:
According to the background information, determine the background information with described problem text with context local feature and syntax
The similarity of each moment feature vector in the multi-stage characteristics sequence vector of structure feature;
The multistage with context local feature and syntactic structure feature according to the background information and described problem text is special
The similarity of levying each moment feature vector in sequence vector, determine described problem text with context local feature
The attention weight of each moment feature vector in characteristic vector sequence;
According in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of described problem text
The attention weight of each moment feature vector has context local feature and syntactic structure feature to described problem text
Multi-stage characteristics sequence vector in each moment feature vector weight and sum, obtain described problem text have context
The feature vector of local feature, syntactic structure feature and global characteristics.
6. according to the method described in claim 4, it is characterized in that, there is context part based on the candidate answers text
The multi-stage characteristics sequence vector and the candidate answers text of feature and syntactic structure feature have context local feature and
The attention weight of each feature vector in the multi-stage characteristics sequence vector of syntactic structure feature, generates the candidate answers text
With context local feature, syntactic structure feature and the feature vectors of global characteristics include:
According to the background information, determine the background information and the candidate answers text have context local feature and
The similarity of each moment feature vector in the multi-stage characteristics sequence vector of syntactic structure feature;
According to the background information and the candidate answers text with the more of context local feature and syntactic structure feature
The similarity of each moment feature vector in grade characteristic vector sequence, determine the candidate answers text has context office
The attention weight of each moment feature vector in the multi-stage characteristics sequence vector of portion's feature and syntactic structure feature;
According to the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of the candidate answers text
In each moment feature vector attention weight, to the candidate answers text have context local feature and syntax
Each moment feature vector in the multi-stage characteristics sequence vector of structure feature is weighted and is summed, and obtains the candidate answers text
With context local feature, syntactic structure feature and global characteristics feature vector.
7. the method according to claim 1, wherein having context part special according to described problem text
Sign, syntactic structure feature and global characteristics feature vector and the candidate answers text have context local feature,
Syntactic structure feature and global characteristics feature vectors determine semantic of described problem text and the candidate answers text
Include: with degree
To described problem text with context local feature, syntactic structure feature and global characteristics feature vector and institute
State candidate answers text with context local feature, syntactic structure feature and the feature vectors of global characteristics spelled
It connects;
Classified using classifier to spliced feature vector, obtains described problem text and the candidate answers text
Matching degree.
8. a kind of semantic matches device of question and answer text, which is characterized in that this method comprises:
Obtain module, using Recognition with Recurrent Neural Network obtain question text with context local feature and syntactic structure feature
Multi-stage characteristics sequence vector, and obtain the multistage with context local feature and syntactic structure feature of candidate answers text
Characteristic vector sequence;
Generation module, the multi-stage characteristics vector with context local feature and syntactic structure feature based on described problem text
It is each in the multi-stage characteristics sequence vector with context local feature and syntactic structure feature of sequence and described problem text
The attention weight of feature vector, generate described problem text with context local feature, syntactic structure feature and it is complete
The feature vector of office's feature, and based on the candidate answers text with context local feature and syntactic structure feature
The multistage with context local feature and syntactic structure feature of multi-stage characteristics sequence vector and the candidate answers text is special
The attention weight for levying each feature vector in sequence vector, generate the candidate answers text has context part special
Sign, syntactic structure feature and global characteristics feature vector;
Determining module, for according to described problem text with context local feature, syntactic structure feature and the overall situation it is special
The feature vector of sign and the candidate answers text with context local feature, syntactic structure feature and global characteristics
Feature vector determines the semantic matching degree of described problem text Yu the candidate answers text.
9. a kind of electronic equipment, comprising:
One or more processors;And
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing
When device executes, so that one or more of processors realize method described in any one according to claim 1~7.
10. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor
The method according to claim 1~any one of 7 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811563115.6A CN109726396A (en) | 2018-12-20 | 2018-12-20 | Semantic matching method, device, medium and the electronic equipment of question and answer text |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811563115.6A CN109726396A (en) | 2018-12-20 | 2018-12-20 | Semantic matching method, device, medium and the electronic equipment of question and answer text |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109726396A true CN109726396A (en) | 2019-05-07 |
Family
ID=66296918
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811563115.6A Pending CN109726396A (en) | 2018-12-20 | 2018-12-20 | Semantic matching method, device, medium and the electronic equipment of question and answer text |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109726396A (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110196981A (en) * | 2019-06-11 | 2019-09-03 | 百度在线网络技术(北京)有限公司 | Document representation method, device, equipment and storage medium |
CN110309283A (en) * | 2019-06-28 | 2019-10-08 | 阿里巴巴集团控股有限公司 | A kind of answer of intelligent answer determines method and device |
CN110362681A (en) * | 2019-06-19 | 2019-10-22 | 平安科技(深圳)有限公司 | The recognition methods of question answering system replication problem, device and storage medium |
CN110390005A (en) * | 2019-07-23 | 2019-10-29 | 北京香侬慧语科技有限责任公司 | A kind of data processing method and device |
CN110390107A (en) * | 2019-07-26 | 2019-10-29 | 腾讯科技(深圳)有限公司 | Hereafter relationship detection method, device and computer equipment based on artificial intelligence |
CN110569499A (en) * | 2019-07-18 | 2019-12-13 | 中国科学院信息工程研究所 | Generating type dialog system coding method and coder based on multi-mode word vectors |
CN110825852A (en) * | 2019-11-07 | 2020-02-21 | 四川长虹电器股份有限公司 | Long text-oriented semantic matching method and system |
CN110956962A (en) * | 2019-10-17 | 2020-04-03 | 中国第一汽车股份有限公司 | Reply information determination method, device and equipment for vehicle-mounted robot |
CN111061850A (en) * | 2019-12-12 | 2020-04-24 | 中国科学院自动化研究所 | Dialog state tracking method, system and device based on information enhancement |
CN111108501A (en) * | 2019-12-25 | 2020-05-05 | 深圳市优必选科技股份有限公司 | Context-based multi-turn dialogue method, device, equipment and storage medium |
CN111198876A (en) * | 2020-01-02 | 2020-05-26 | 泰康保险集团股份有限公司 | Data cleaning method and device based on knowledge base |
CN111241258A (en) * | 2020-01-08 | 2020-06-05 | 泰康保险集团股份有限公司 | Data cleaning method and device, computer equipment and readable storage medium |
CN111541570A (en) * | 2020-04-22 | 2020-08-14 | 北京交通大学 | Cloud service QoS prediction method based on multi-source feature learning |
CN111813909A (en) * | 2020-06-24 | 2020-10-23 | 泰康保险集团股份有限公司 | Intelligent question answering method and device |
CN111859909A (en) * | 2020-07-10 | 2020-10-30 | 山西大学 | Semantic scene consistency recognition reading robot |
CN112699348A (en) * | 2020-12-25 | 2021-04-23 | 中国平安人寿保险股份有限公司 | Method and device for verifying nuclear body information, computer equipment and storage medium |
CN112712073A (en) * | 2021-03-29 | 2021-04-27 | 北京远鉴信息技术有限公司 | Eye change feature-based living body identification method and device and electronic equipment |
CN115017276A (en) * | 2022-03-28 | 2022-09-06 | 连芷萱 | Multi-turn conversation method and system for government affair consultation by combining fuzzy logic and R-GCN |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180121785A1 (en) * | 2016-11-03 | 2018-05-03 | Nec Laboratories America, Inc. | Context-aware attention-based neural network for interactive question answering |
CN108536681A (en) * | 2018-04-16 | 2018-09-14 | 腾讯科技(深圳)有限公司 | Intelligent answer method, apparatus, equipment and storage medium based on sentiment analysis |
CN108846077A (en) * | 2018-06-08 | 2018-11-20 | 泰康保险集团股份有限公司 | Semantic matching method, device, medium and the electronic equipment of question and answer text |
CN108920654A (en) * | 2018-06-29 | 2018-11-30 | 泰康保险集团股份有限公司 | A kind of matched method and apparatus of question and answer text semantic |
-
2018
- 2018-12-20 CN CN201811563115.6A patent/CN109726396A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180121785A1 (en) * | 2016-11-03 | 2018-05-03 | Nec Laboratories America, Inc. | Context-aware attention-based neural network for interactive question answering |
CN108536681A (en) * | 2018-04-16 | 2018-09-14 | 腾讯科技(深圳)有限公司 | Intelligent answer method, apparatus, equipment and storage medium based on sentiment analysis |
CN108846077A (en) * | 2018-06-08 | 2018-11-20 | 泰康保险集团股份有限公司 | Semantic matching method, device, medium and the electronic equipment of question and answer text |
CN108920654A (en) * | 2018-06-29 | 2018-11-30 | 泰康保险集团股份有限公司 | A kind of matched method and apparatus of question and answer text semantic |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110196981A (en) * | 2019-06-11 | 2019-09-03 | 百度在线网络技术(北京)有限公司 | Document representation method, device, equipment and storage medium |
CN110196981B (en) * | 2019-06-11 | 2023-07-25 | 百度在线网络技术(北京)有限公司 | Text representation method, apparatus, device and storage medium |
CN110362681A (en) * | 2019-06-19 | 2019-10-22 | 平安科技(深圳)有限公司 | The recognition methods of question answering system replication problem, device and storage medium |
CN110309283A (en) * | 2019-06-28 | 2019-10-08 | 阿里巴巴集团控股有限公司 | A kind of answer of intelligent answer determines method and device |
CN110309283B (en) * | 2019-06-28 | 2023-03-21 | 创新先进技术有限公司 | Answer determination method and device for intelligent question answering |
CN110569499A (en) * | 2019-07-18 | 2019-12-13 | 中国科学院信息工程研究所 | Generating type dialog system coding method and coder based on multi-mode word vectors |
CN110569499B (en) * | 2019-07-18 | 2021-10-08 | 中国科学院信息工程研究所 | Generating type dialog system coding method and coder based on multi-mode word vectors |
CN110390005A (en) * | 2019-07-23 | 2019-10-29 | 北京香侬慧语科技有限责任公司 | A kind of data processing method and device |
CN110390107A (en) * | 2019-07-26 | 2019-10-29 | 腾讯科技(深圳)有限公司 | Hereafter relationship detection method, device and computer equipment based on artificial intelligence |
CN110390107B (en) * | 2019-07-26 | 2023-04-18 | 腾讯科技(深圳)有限公司 | Context relation detection method and device based on artificial intelligence and computer equipment |
CN110956962A (en) * | 2019-10-17 | 2020-04-03 | 中国第一汽车股份有限公司 | Reply information determination method, device and equipment for vehicle-mounted robot |
CN110825852A (en) * | 2019-11-07 | 2020-02-21 | 四川长虹电器股份有限公司 | Long text-oriented semantic matching method and system |
CN111061850A (en) * | 2019-12-12 | 2020-04-24 | 中国科学院自动化研究所 | Dialog state tracking method, system and device based on information enhancement |
CN111061850B (en) * | 2019-12-12 | 2023-04-28 | 中国科学院自动化研究所 | Dialogue state tracking method, system and device based on information enhancement |
CN111108501A (en) * | 2019-12-25 | 2020-05-05 | 深圳市优必选科技股份有限公司 | Context-based multi-turn dialogue method, device, equipment and storage medium |
CN111108501B (en) * | 2019-12-25 | 2024-02-06 | 深圳市优必选科技股份有限公司 | Context-based multi-round dialogue method, device, equipment and storage medium |
CN111198876A (en) * | 2020-01-02 | 2020-05-26 | 泰康保险集团股份有限公司 | Data cleaning method and device based on knowledge base |
CN111241258A (en) * | 2020-01-08 | 2020-06-05 | 泰康保险集团股份有限公司 | Data cleaning method and device, computer equipment and readable storage medium |
CN111541570A (en) * | 2020-04-22 | 2020-08-14 | 北京交通大学 | Cloud service QoS prediction method based on multi-source feature learning |
CN111813909A (en) * | 2020-06-24 | 2020-10-23 | 泰康保险集团股份有限公司 | Intelligent question answering method and device |
CN111859909B (en) * | 2020-07-10 | 2022-05-31 | 山西大学 | Semantic scene consistency recognition reading robot |
CN111859909A (en) * | 2020-07-10 | 2020-10-30 | 山西大学 | Semantic scene consistency recognition reading robot |
CN112699348A (en) * | 2020-12-25 | 2021-04-23 | 中国平安人寿保险股份有限公司 | Method and device for verifying nuclear body information, computer equipment and storage medium |
CN112712073A (en) * | 2021-03-29 | 2021-04-27 | 北京远鉴信息技术有限公司 | Eye change feature-based living body identification method and device and electronic equipment |
CN115017276A (en) * | 2022-03-28 | 2022-09-06 | 连芷萱 | Multi-turn conversation method and system for government affair consultation by combining fuzzy logic and R-GCN |
CN115017276B (en) * | 2022-03-28 | 2022-11-29 | 连芷萱 | Multi-turn conversation method and system for government affair consultation, government affair robot and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109726396A (en) | Semantic matching method, device, medium and the electronic equipment of question and answer text | |
CN108846077A (en) | Semantic matching method, device, medium and the electronic equipment of question and answer text | |
CN111339255B (en) | Target emotion analysis method, model training method, medium, and device | |
CN108959246A (en) | Answer selection method, device and electronic equipment based on improved attention mechanism | |
CN109033068A (en) | It is used to read the method, apparatus understood and electronic equipment based on attention mechanism | |
CN108491433A (en) | Chat answer method, electronic device and storage medium | |
CN109101537A (en) | More wheel dialogue data classification methods, device and electronic equipment based on deep learning | |
CN110489751A (en) | Text similarity computing method and device, storage medium, electronic equipment | |
CN109918568B (en) | Personalized learning method and device, electronic equipment and storage medium | |
CN109710760A (en) | Clustering method, device, medium and the electronic equipment of short text | |
CN109214006B (en) | Natural language reasoning method for image enhanced hierarchical semantic representation | |
CN111368548A (en) | Semantic recognition method and device, electronic equipment and computer-readable storage medium | |
CN111666376B (en) | Answer generation method and device based on paragraph boundary scan prediction and word shift distance cluster matching | |
CN109933792A (en) | Viewpoint type problem based on multi-layer biaxially oriented LSTM and verifying model reads understanding method | |
CN111666416A (en) | Method and apparatus for generating semantic matching model | |
CN110188158A (en) | Keyword and topic label generating method, device, medium and electronic equipment | |
CN112000778A (en) | Natural language processing method, device and system based on semantic recognition | |
CN110457478A (en) | Text compliance inspection method and device, electronic equipment and computer-readable medium | |
US20230113524A1 (en) | Reactive voice device management | |
Matějů et al. | An empirical assessment of deep learning approaches to task-oriented dialog management | |
Choudhary et al. | An intelligent chatbot design and implementation model using long short-term memory with recurrent neural networks and attention mechanism | |
CN110489730A (en) | Text handling method, device, terminal and storage medium | |
Suresh Kumar et al. | Local search five‐element cycle optimized reLU‐BiLSTM for multilingual aspect‐based text classification | |
Hou et al. | A corpus-free state2seq user simulator for task-oriented dialogue | |
CN108984475A (en) | Answer selection method, device and electronic equipment based on holographic neural network |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190507 |