CN109829045A - A kind of answering method and device - Google Patents
A kind of answering method and device Download PDFInfo
- Publication number
- CN109829045A CN109829045A CN201811648550.9A CN201811648550A CN109829045A CN 109829045 A CN109829045 A CN 109829045A CN 201811648550 A CN201811648550 A CN 201811648550A CN 109829045 A CN109829045 A CN 109829045A
- Authority
- CN
- China
- Prior art keywords
- text
- semantic analysis
- inquiry
- inquiry text
- semantic
- 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
Landscapes
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention provides a kind of answering method and device, the method comprise the steps that obtaining the semantic analysis result of the inquiry text of the semantic analysis model output by inquiry text input into semantic analysis model;Wherein, the semantic analysis model is obtained based on the training of the sample semantic analysis result of sample inquiry text and the sample inquiry text;Based on the semantic analysis result and keyword matching result, the answer text of the inquiry text is obtained;The keyword matching result is to carry out keyword match acquisition to the inquiry text based on default problem base.Method and apparatus provided in an embodiment of the present invention, by the way that semantic analysis and keyword match are combined, facilitate deeper time and understands inquiry text semantic, to realize more accurate inquiry text matches, so that the answer text specific aim returned is stronger, reliability is higher, optimizes user experience, improves automatic question answering efficiency.
Description
Technical field
The present embodiments relate to natural language processing technique field more particularly to a kind of answering methods and device.
Background technique
In recent years, with the development of artificial intelligence related discipline, especially computational linguistics, various question answering systems
It comes into being with dialogue robot, people can the letter required for linked up in a manner of natural language with equipment, obtaining
Breath.
In the related art, existing question answering system generallys use the mode of keyword match, searches and uses from database
The Similar Problems of the current asked questions in family, and the answer content by the corresponding answer of Similar Problems as current asked questions.
However, only by keyword match, can not profound understanding natural language semanteme, cause to reply content for a purpose
Difference, reliability are low, the case where usually giving an irrelevant answer, poor user experience.
Summary of the invention
The embodiment of the present invention provides a kind of answering method and device, to solve existing answering method specific aim it is poor, can
The problem low by property.
In a first aspect, the embodiment of the present invention provides a kind of answering method, comprising:
Semantic analysis step: by inquiry text input into semantic analysis model, the semantic analysis model output is obtained
The inquiry text semantic analysis result;Wherein, the semantic analysis model is based on sample inquiry text and the sample
What the sample semantic analysis result training of this inquiry text obtained;
Integration replies step: being based on the semantic analysis result and keyword matching result, obtains the inquiry text
Reply text;The keyword matching result is to carry out keyword match acquisition to the inquiry text based on default problem base
's.
Second aspect, the embodiment of the present invention provide a kind of question and answer system, comprising:
Semantic analysis unit, for inquiry text input into semantic analysis model, to be obtained the semantic analysis model
The semantic analysis result of the inquiry text of output;Wherein, the semantic analysis model is based on sample inquiry text and institute
The sample semantic analysis result training for stating sample inquiry text obtains;
Response unit is integrated, for being based on the semantic analysis result and keyword matching result, obtains the inquiry text
This answer text;The keyword matching result is to carry out keyword match to the inquiry text based on default problem base to obtain
It takes.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including processor, communication interface, memory and total
Line, wherein processor, communication interface, memory complete mutual communication by bus, and processor can call in memory
Logical order, to execute as provided by first aspect the step of method.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, are stored thereon with calculating
Machine program is realized as provided by first aspect when the computer program is executed by processor the step of method.
A kind of answering method and device provided in an embodiment of the present invention, by mutually tying semantic analysis with keyword match
It closes, facilitates deeper time and understand inquiry text semantic, so that more accurate inquiry text matches are realized, so that return
Answer text specific aim is stronger, and reliability is higher, optimizes user experience, improves automatic question answering efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the flow diagram of answering method provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides answering method flow diagram;
Fig. 3 is the structural schematic diagram of question and answer system provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Generally use keyword match for existing question answering system, can not profound understanding natural language semanteme, cause
Reply that content for a purpose is poor, reliability is low, the case where usually giving an irrelevant answer, the problem of poor user experience, present invention implementation
Example provides a kind of answering method.This method can be used for intelligent answer scene, can be used for needing intelligent answer function
Other scenes, such as Driving Scene, shopping scene, the present invention is not especially limit this.Fig. 1 is the embodiment of the present invention
The flow diagram of the answering method of offer, as shown in Figure 1, this method comprises:
Step 110, semantic analysis step: by inquiry text input into semantic analysis model, semantic analysis model is obtained
The semantic analysis result of the inquiry text of output.Wherein, semantic analysis model is based on sample inquiry text and sample inquiry text
What this sample semantic analysis result training obtained.
Herein, inquiry text can be the text that user directly inputs, and can also be voice number when puing question to based on user
The text obtained according to speech recognition is carried out, the present invention is not especially limit this.Semantic analysis model is used for inquiry
Text carries out semantic analysis, and exports semantic analysis result.Semantic analysis result is obtained after carrying out semantic analysis to inquiry text
To as a result, the semantic analysis result semanteme that can be inquiry text is semantic similar with default problem each in default problem base
Degree can also be the possible corresponding default problem of the semanteme of inquiry text, and the present invention is not especially limit this.This
Place, default problem base is pre-set include several default problems database.
In addition, can also train in advance before executing step 110 and obtain semantic analysis model, it can specifically pass through such as lower section
Formula training obtains: firstly, collecting the sample semantic analysis result of great amount of samples inquiry text and sample inquiry text;Wherein, sample
This semantic analysis result is predetermined, and sample semantic analysis result is to carry out semantic analysis to sample inquiry text to obtain
Analysis result.Initial model is trained based on sample inquiry text and sample semantic analysis result, to obtain semanteme
Analysis model.Wherein, initial model can be single neural network model, be also possible to the combination of multiple neural network models,
The embodiment of the present invention does not make specific limit to the type of initial model and structure.
Step 120, integration replies step: being based on semantic analysis result and keyword matching result, obtains inquiry text
Reply text.Keyword matching result is to carry out keyword match acquisition to inquiry text based on default problem base.
Specifically, it before executing step 120, is also based on default problem base and keyword is carried out to inquiry text
Match, obtains the keyword matching result of inquiry text.Herein, keyword matching result can be inquiry text and default problem base
In each default problem text similarity, can also be and the pre- rhetoric question to match with inquiry text is obtained by keyword match
Topic, the present invention is not especially limit this.
After respectively obtaining semantic analysis result and keyword matching result, to semantic analysis result and keyword match knot
Fruit is integrated, and determines the immediate default problem of inquiry text, and the corresponding default answer of immediate default problem is made
For the answer text of inquiry text.
Method provided in an embodiment of the present invention facilitates deeper by combining semantic analysis and keyword match
It is secondary to understand inquiry text semantic, so that more accurate inquiry text matches are realized, so that the answer text specific aim returned
Stronger, reliability is higher, optimizes user experience, improves automatic question answering efficiency.
Based on the above embodiment, step 110 specifically includes:
Step 111, semantic similarity obtaining step: by semantic similarity of the inquiry text input into semantic analysis model
In model, the semantic similarity feature of the inquiry text of semantic similarity model output is obtained;Wherein, semantic similarity model is
What the sample semantic similarity feature based on sample inquiry text and sample inquiry text obtained twin neural metwork training.
Specifically, semantic similarity model is the twin nerve net for obtaining the semantic similarity feature of inquiry text
Network, the semantic similarity of inquiry text are characterized in one group of multi-C vector, for characterizing the semanteme and default problem base of inquiry text
In each default problem semanteme between semantic similarity.
Before executing step 111, it can also train in advance and obtain semantic similarity model, can specifically instruct in the following way
It gets: firstly, collecting the sample semantic similarity feature of great amount of samples inquiry text and sample inquiry text;Wherein, sample
Semantic similarity feature is predetermined, and sample semantic similarity feature is used to characterize the language of corresponding sample inquiry text
The adopted semantic similarity between the semanteme of default problem each in default problem base.Based on sample inquiry text and its sample language
Adopted similarity feature is trained twin neural network, to obtain semantic similarity model.Wherein, twin neural network is
A kind of neural network framework of specific type, twin neural network are made of two identical neural networks, will be different
Input is separately input in two neural networks, and the last layer of two networks is then fed to comparison loss function, is used to
Calculate the semantic similarity between two inputs.In the training process of semantic similarity model, by any sample inquiry text
Two neural networks for being separately input into twin neural network are inputted as two with any default problem in default problem base
In, by the semantic similarity between obtain two inputs and the sample inquiry in predetermined sample semantic similarity feature
Semantic similarity between text and the default problem is compared, to be adjusted to neural network parameter and structure.This
Locate, two identical neural networks in twin neural network can be single neural network model, be also possible to multiple
The combination of neural network model, the embodiment of the present invention do not make specific limit to this.
Step 112, semantic analysis result obtaining step: being based on semantic similarity feature and default problem base, obtains inquiry
The semantic analysis result of text.
Specifically, after obtaining semantic similarity feature by semantic similarity model, based on semantic similarity feature and
Preset problem base, the semantic phase in the semantic and default problem base of available inquiry text between the semanteme of each default problem
Like degree, to obtain output of the semantic analysis result of inquiry text as semantic analysis model.
Method provided in an embodiment of the present invention obtains the semantic similarity feature of inquiry text by twin neural network,
It solves the understanding of natural language and the matching problem of semantic level, is conducive to improve the reliability and specific aim for replying text.
Based on any of the above-described embodiment, step 112 is specifically included: being based on semantic similarity feature, is passed through KD tree arest neighbors
Algorithm obtains the nearest default problem of preset quantity distance as semantic analysis result from default problem base.
Specifically, KD tree is the abbreviation of K-dimension tree, is a kind of number divided in k dimension space to data point
According to structure, it is mainly used in the search of hyperspace critical data.KD tree nearest neighbor algorithm is i.e. in the quick of multidimensional data
Analysis and fast search, the purpose is to retrieve in KD tree with query point apart from nearest data point.In the embodiment of the present invention, language
Adopted similarity feature is query point, and each default problem is a data point in KD tree in default problem base, passes through KD
The available preset quantity of nearest neighbor algorithm is set apart from semantic similarity feature, the i.e. nearest default problem of query point.Herein,
Preset quantity is the quantity for the default problem for including in preset semantic analysis result.Herein, semantic similarity in KD tree
The distance between feature data point corresponding with any default problem reflects the semanteme between inquiry text and the default problem
Similarity, the more close then semantic similarity of distance are higher.Therefore, preset quantity distance is obtained recently by KD tree nearest neighbor algorithm
Default problem be the semantic highest default problem of semantic similarity between inquiry text of preset quantity.
Based on any of the above-described embodiment, before step 120 further include: step 100, based on default problem base to inquiry text
Keyword match is carried out, keyword matching result is obtained.Step 100 specifically includes:
Step 101, it segments step: inquiry text is divided by several participles based on participle tool.
Participle tool can be jieba participle, THULAC (THU Lexical Analyzer for Chinese) or
IKAnalyzer.Wherein, IKAnalyzer is an open source, the Chinese word segmentation tool of the lightweight based on java language development
Packet.
Step 102, it text similarity step: based on each participle and each default problem in default problem base, obtains
The text similarity of inquiry text and each default problem.
After completing participle, to each default problem progress in each participle and default problem base in inquiry text
Match, calculates the text similarity between inquiry text and each default problem, the calculation method of text similarity can be herein
Cosine similarity algorithm, shared word algorithm, Hamming distance algorithm or manhatton distance algorithm etc., the embodiment of the present invention to this not
Make specific limit.
Step 103, matching step: the text similarity based on inquiry text Yu each default problem obtains keyword
With result.
The text similarity of inquiry text Yu each default problem is being obtained, it can be by the highest pre- rhetoric question of text similarity
Topic is used as keyword matching result, and text similarity can also be greater than to the default problem of pre-set text similarity threshold as pass
Key word matching result, the present invention is not especially limit this.
It should be noted that the embodiment of the present invention does not make specific restriction, step 100 to the sequence of step 100 and step 110
It can be prior to or subsequent to step 110 execution, synchronous with step 110 can also be executed.
Based on any of the above-described embodiment, step 102 is specifically included: based in each participle and the default problem base
Each default problem, the text similarity of the inquiry text Yu each default problem is obtained by bm25 algorithm.
Specifically, bm25 is a kind of algorithm for evaluating correlation between search term and document, it is a kind of based on general
The algorithm that rate retrieval model proposes.Bm25 algorithm is applied in the embodiment of the present invention, steps are as follows: being carried out to inquiry text
After participle, each participle is searched in default problem base, obtains the corresponding search result of each participle, i.e., several include this point
The default problem of word calculates the Relevance scores between each participle and each default problem comprising the participle.It is basic herein
On, for any default problem, this is preset into the Relevance scores between problem and each participle and is weighted summation, is somebody's turn to do
Text similarity between default problem and inquiry text.
Based on any of the above-described embodiment, step 120 is specifically included: by the friendship of semantic analysis result and keyword matching result
Collection is used as matching problem, and the answer text by the corresponding default answer of matching problem as inquiry text.
Specifically, semantic analysis result includes several default problems, and keyword matching result includes several pre- rhetoric questions
Topic.If any default problem appears in semantic analysis result and keyword matching result simultaneously, confirm that the default problem is
This is preset problem as matching by the immediate problem for inquiry text obtained by semantic analysis and keyword match
Problem.Each default problem in default problem base is previously provided with corresponding default reply and presets problem for answering this.
The corresponding default answer of matching problem is obtained, by the default answer text replied as inquiry text.
It should be noted that the intersection of semantic analysis result and keyword matching result may include one or more default
Each default problem in intersection, can be used as matching problem by problem, and using the default answer of each matching problem as
The answer text of inquiry text returns, and is screened by user.It is also based on each default in default weight and intersection
The semantic similarity and text similarity of problem obtain the matching score of each default problem in intersection, will match in intersection
The default problem of highest scoring as matching problem, and using the preset answer of the matching problem as inquiry text answer text
This, the present invention is not especially limit this.
Based on any of the above-described embodiment, step 120 further include: if between semantic analysis result and keyword matching result not
There are intersections, then matching score and keyword based on each default problem in default Weight Acquisition semantic analysis result
The matching score of each default problem in matching result;It is matched from semantic analysis result with selection in keyword matching result
Divide highest default problem as matching problem, and the answer text by the corresponding default answer of matching problem as inquiry text
This.
Specifically, it is being based on semantic analysis result and keyword matching result, it is first when obtaining the answer text of inquiry text
First obtain the intersection of semantic analysis result and keyword matching result.If between semantic analysis result and keyword matching result
There is no intersections, then according to the matching score for presetting weight calculation semantic analysis result and keyword matching result.Herein, semantic
The matching score of any default problem can be by the way that this, to preset problem corresponding in analysis result or keyword matching result
Semantic similarity and text similarity are weighted what summation obtained, can also be by presetting the corresponding semantic phase of problem to this
Number is putd question to be weighted what summation obtained like the history of degree and text similarity and the default problem, the embodiment of the present invention
This is not especially limited.
Based on any of the above-described embodiment, Fig. 2 be another embodiment of the present invention provides answering method flow diagram, such as
Shown in Fig. 2, answering method includes the following steps:
Firstly, obtaining the inquiry text of user's input.
Then, semantic analysis and keyword match are carried out to inquiry text respectively.
Wherein, the step of carrying out semantic analysis to inquiry text is as follows:
Inquiry text is pre-processed, after being segmented by IKAnalyzer, removes stop words, each participle is converted
For term vector, and constitute the sentence vector of inquiry text, if the length of sentence vector less than 15, by the length polishing of sentence vector, if
Sentence vector length is greater than 15, then a vector is truncated.
The sentence vector of inquiry text is input in the semantic similarity model in semantic analysis model, is obtained semantic similar
Spend the semantic similarity feature of model output.Herein, semantic similarity model is based on sample inquiry text and sample inquiry text
What this sample semantic similarity feature obtained twin neural metwork training.In the embodiment of the present invention, twin neural network by
Shot and long term memory network (Long Short-Term Memory, the LSTM) network that two hidden layer quantity are 50 forms, twin mind
Through when network training using L1 normal form as measurement index.
Then using semantic similarity feature as query point, each default problem is preset in problem base as one in KD tree
A data point obtains the nearest default problem of 3 Distance query points by KD tree nearest neighbor algorithm, by above-mentioned 3 Distance queries
The nearest default problem of point is as semantic analysis result.
The step of carrying out keyword match to inquiry text is as follows:
Inquiry text is segmented by IKAnalyzer, obtains several participles.
Based on bm25 algorithm, each participle is searched in default problem base, obtains the corresponding search result of each participle, i.e.,
Several include the default problem of the participle, calculate each participle and the correlation between each default problem comprising the participle
Score.On this basis, for any default problem, this is preset into the Relevance scores between problem and each participle and is added
Power summation obtains the text similarity between the default problem and inquiry text.
The highest default problem of 3 text similarities is chosen from default problem base as keyword matching result.
After obtaining semantic analysis result and keyword matching result, semantic analysis result and keyword matching result are taken
Intersection.If there are intersection between semantic analysis result and keyword matching result, using the corresponding default problem of intersection as
With problem.If intersection is not present between semantic analysis result and keyword matching result, divide according to weight calculation semanteme is preset
Analyse the matching score of each default problem in result and keyword matching result, and from semantic analysis result and keyword match knot
The highest default problem of matching score is chosen in fruit as matching problem.
Each default problem in default problem base is previously provided with corresponding default answer for answering the pre- rhetoric question
Topic.The corresponding default answer of matching problem is obtained, by the default answer text replied as inquiry text, and shows the answer
Text allows users to know the corresponding answer of inquiry text.
Method provided in an embodiment of the present invention facilitates deeper by combining semantic analysis and keyword match
It is secondary to understand inquiry text semantic, so that more accurate inquiry text matches are realized, so that the answer text specific aim returned
Stronger, reliability is higher, optimizes user experience, improves automatic question answering efficiency.
Based on any of the above-described embodiment, Fig. 3 is the structural schematic diagram of question and answer system provided in an embodiment of the present invention, such as Fig. 3
Shown, question and answer system includes semantic analysis unit 310 and integrates response unit 320;
Wherein, semantic analysis unit 310 is used for by inquiry text input into semantic analysis model, obtains described semantic point
Analyse the semantic analysis result of the inquiry text of model output;Wherein, the semantic analysis model is based on sample inquiry text
The training of the sample semantic analysis result of this and the sample inquiry text obtains;
Response unit 320 is integrated for obtaining the inquiry based on the semantic analysis result and keyword matching result
The answer text of text;The keyword matching result is to carry out keyword match to the inquiry text based on default problem base
It obtains.
Device provided in an embodiment of the present invention facilitates deeper by combining semantic analysis and keyword match
It is secondary to understand inquiry text semantic, so that more accurate inquiry text matches are realized, so that the answer text specific aim returned
Stronger, reliability is higher, optimizes user experience, improves automatic question answering efficiency.
Based on any of the above-described embodiment, semantic analysis unit 310 includes that semantic similarity obtains subelement and semantic analysis
As a result subelement is obtained;
Semantic similarity obtains subelement for the semanteme by the inquiry text input into the semantic analysis model
In similarity model, the semantic similarity feature of the inquiry text of the semantic similarity model output is obtained;Wherein, institute
Stating semantic similarity model is the sample semantic similarity feature based on sample inquiry text and the sample inquiry text to twin
What raw neural metwork training obtained;
Semantic analysis result obtains subelement and is used to be based on the semantic similarity feature and the default problem base, obtains
The semantic analysis result of the inquiry text.
Based on any of the above-described embodiment, semantic analysis result obtains subelement and is specifically used for:
Based on the semantic similarity feature, by KD tree nearest neighbor algorithm, obtained from the default problem base default
The nearest default problem of quantity distance is as the semantic analysis result.
Based on any of the above-described embodiment, which further includes keyword matching unit;Keyword matching unit specifically includes
Segment subelement, text similarity subelement and coupling subelement;
Wherein, participle subelement is used to that the inquiry text to be divided into several participles based on participle tool;
Text similarity subelement is used for based on each participle and each default problem in the default problem base,
Obtain the text similarity of the inquiry text Yu each default problem;
Coupling subelement is used for the text similarity based on the inquiry text Yu each default problem, described in acquisition
Keyword matching result.
Based on any of the above-described embodiment, text similarity subelement is specifically used for:
Based on each participle and each default problem in the default problem base, by described in the acquisition of bm25 algorithm
The text similarity of inquiry text and each default problem.
Based on any of the above-described embodiment, integrates response unit 320 and is specifically used for:
Using the intersection of the semantic analysis result and the keyword matching result as matching problem, and by the matching
Answer text of the corresponding default answer of problem as the inquiry text.
Based on any of the above-described embodiment, integrates response unit 320 and is also used to:
If intersection is not present between the semantic analysis result and the keyword matching result, obtained based on default weight
Take the matching score of each default problem in the semantic analysis result and each pre- in the keyword matching result
The matching score of rhetoric question topic;
The highest pre- rhetoric question of the matching score is chosen from the semantic analysis result and the keyword matching result
Topic is used as the matching problem, and the answer text by the corresponding default answer of the matching problem as the inquiry text.
Fig. 4 is the entity structure schematic diagram of electronic equipment provided in an embodiment of the present invention, as shown in figure 4, the electronic equipment
It may include: processor (processor) 401,402, memory communication interface (Communications Interface)
(memory) 403 and communication bus 404, wherein processor 401, communication interface 402, memory 403 pass through communication bus 404
Complete mutual communication.Processor 401 can call the meter that is stored on memory 403 and can run on processor 401
Calculation machine program, to execute the answering method of the various embodiments described above offer, for example, by inquiry text input to semantic analysis mould
In type, the semantic analysis result of the inquiry text of the semantic analysis model output is obtained;Wherein, the semantic analysis mould
Type is obtained based on the training of the sample semantic analysis result of sample inquiry text and the sample inquiry text;Based on institute's predicate
Justice analysis result and keyword matching result, obtain the answer text of the inquiry text;The keyword matching result is base
Keyword match acquisition is carried out to the inquiry text in default problem base.
In addition, the logical order in above-mentioned memory 403 can be realized by way of SFU software functional unit and conduct
Independent product when selling or using, can store in a computer readable storage medium.Based on this understanding, originally
The technical solution of the inventive embodiments substantially part of the part that contributes to existing technology or the technical solution in other words
It can be embodied in the form of software products, which is stored in a storage medium, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes the present invention respectively
The all or part of the steps of a embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory
(ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk
Etc. the various media that can store program code.
The embodiment of the present invention also provides a kind of non-transient computer readable storage medium, is stored thereon with computer program,
The computer program is implemented to carry out the answering method of the various embodiments described above offer when being executed by processor, for example, will ask
Text input is ask into semantic analysis model, obtains the semantic analysis knot of the inquiry text of the semantic analysis model output
Fruit;Wherein, the semantic analysis model is the sample semantic analysis knot based on sample inquiry text and the sample inquiry text
Fruit training obtains;Based on the semantic analysis result and keyword matching result, the answer text of the inquiry text is obtained;
The keyword matching result is to carry out keyword match acquisition to the inquiry text based on default problem base.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (10)
1. a kind of answering method characterized by comprising
Semantic analysis step obtains the institute of the semantic analysis model output by inquiry text input into semantic analysis model
State the semantic analysis result of inquiry text;Wherein, the semantic analysis model is asked based on sample inquiry text and the sample
What the sample semantic analysis result training of inquiry text obtained;
Integration replies step, is based on the semantic analysis result and keyword matching result, obtains the answer of the inquiry text
Text;The keyword matching result is to carry out keyword match acquisition to the inquiry text based on default problem base.
2. the method according to claim 1, wherein the semantic analysis step specifically includes:
Semantic similarity obtaining step, by semantic similarity model of the inquiry text input into the semantic analysis model
In, obtain the semantic similarity feature of the inquiry text of the semantic similarity model output;Wherein, the semanteme is similar
Spending model is the sample semantic similarity feature based on sample inquiry text and the sample inquiry text to twin neural network
What training obtained;
Semantic analysis result obtaining step is based on the semantic similarity feature and the default problem base, obtains the inquiry
The semantic analysis result of text.
3. according to the method described in claim 2, it is characterized in that, the semantic analysis result obtaining step specifically includes:
Preset quantity is obtained from the default problem base by KD tree nearest neighbor algorithm based on the semantic similarity feature
The nearest default problem of a distance is as the semantic analysis result.
4. the method according to claim 1, wherein before integration answer step further include:
Step is segmented, the inquiry text is divided by several participles based on participle tool;
Text similarity step, based on each participle and each default problem in the default problem base, described in acquisition
The text similarity of inquiry text and each default problem;
Matching step, the text similarity based on the inquiry text Yu each default problem, obtains the keyword
With result.
5. according to the method described in claim 4, it is characterized in that, the text similarity step specifically includes:
Based on each participle and each default problem in the default problem base, the inquiry is obtained by bm25 algorithm
The text similarity of text and each default problem.
6. the method according to any one of claims 1 to 5, which is characterized in that the integration replies step and specifically includes:
Using the intersection of the semantic analysis result and the keyword matching result as matching problem, and by the matching problem
Answer text of the corresponding default answer as the inquiry text.
7. according to the method described in claim 6, it is characterized in that, the integration replies step further include:
If intersection is not present between the semantic analysis result and the keyword matching result, based on default Weight Acquisition institute
State the matching score of each default problem in semantic analysis result and each pre- rhetoric question in the keyword matching result
The matching score of topic;
The highest default problem of the matching score is chosen from the semantic analysis result and the keyword matching result to make
For the matching problem, and the answer text by the corresponding default answer of the matching problem as the inquiry text.
8. a kind of question and answer system characterized by comprising
Semantic analysis unit, for inquiry text input into semantic analysis model, to be obtained to the semantic analysis model output
The inquiry text semantic analysis result;Wherein, the semantic analysis model is based on sample inquiry text and the sample
What the sample semantic analysis result training of this inquiry text obtained;
Response unit is integrated, for being based on the semantic analysis result and keyword matching result, obtains the inquiry text
Reply text;The keyword matching result is to carry out keyword match acquisition to the inquiry text based on default problem base
's.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and bus, wherein processor leads to
Believe that interface, memory complete mutual communication by bus, processor can call the logical order in memory, to execute
Method as described in claim 1 to 7 is any.
10. a kind of non-transient computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer
The method as described in claim 1 to 7 is any is realized when program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811648550.9A CN109829045A (en) | 2018-12-30 | 2018-12-30 | A kind of answering method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811648550.9A CN109829045A (en) | 2018-12-30 | 2018-12-30 | A kind of answering method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109829045A true CN109829045A (en) | 2019-05-31 |
Family
ID=66860765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811648550.9A Pending CN109829045A (en) | 2018-12-30 | 2018-12-30 | A kind of answering method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109829045A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765247A (en) * | 2019-09-30 | 2020-02-07 | 支付宝(杭州)信息技术有限公司 | Input prompting method and device for question-answering robot |
CN111143530A (en) * | 2019-12-24 | 2020-05-12 | 平安健康保险股份有限公司 | Intelligent answering method and device |
CN111177349A (en) * | 2019-12-20 | 2020-05-19 | 厦门快商通科技股份有限公司 | Question-answer matching method, device, equipment and storage medium |
CN111382255A (en) * | 2020-03-17 | 2020-07-07 | 北京百度网讯科技有限公司 | Method, apparatus, device and medium for question and answer processing |
CN111581354A (en) * | 2020-05-12 | 2020-08-25 | 金蝶软件(中国)有限公司 | FAQ question similarity calculation method and system |
CN111683174A (en) * | 2020-06-01 | 2020-09-18 | 信雅达系统工程股份有限公司 | Incoming call processing method, device and system |
CN113377921A (en) * | 2021-06-25 | 2021-09-10 | 北京百度网讯科技有限公司 | Method, apparatus, electronic device, and medium for matching information |
CN114328852A (en) * | 2021-08-26 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Text processing method, related device and equipment |
CN117171309A (en) * | 2023-07-28 | 2023-12-05 | 至本医疗科技(上海)有限公司 | Method, apparatus and medium for providing response information for medical query |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106529138A (en) * | 2016-10-26 | 2017-03-22 | 李露青 | Method and device for information pushing |
CN106980652A (en) * | 2017-03-03 | 2017-07-25 | 竹间智能科技(上海)有限公司 | Intelligent answer method and system |
WO2017198031A1 (en) * | 2016-05-19 | 2017-11-23 | 北京京东尚科信息技术有限公司 | Semantic parsing method and apparatus |
CN108536708A (en) * | 2017-03-03 | 2018-09-14 | 腾讯科技(深圳)有限公司 | A kind of automatic question answering processing method and automatically request-answering system |
-
2018
- 2018-12-30 CN CN201811648550.9A patent/CN109829045A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017198031A1 (en) * | 2016-05-19 | 2017-11-23 | 北京京东尚科信息技术有限公司 | Semantic parsing method and apparatus |
CN106529138A (en) * | 2016-10-26 | 2017-03-22 | 李露青 | Method and device for information pushing |
CN106980652A (en) * | 2017-03-03 | 2017-07-25 | 竹间智能科技(上海)有限公司 | Intelligent answer method and system |
CN108536708A (en) * | 2017-03-03 | 2018-09-14 | 腾讯科技(深圳)有限公司 | A kind of automatic question answering processing method and automatically request-answering system |
Non-Patent Citations (2)
Title |
---|
王宏生等编: "《人工智能及其应用》", 31 January 2006 * |
赵银各: ""句子语义相似度计算及其应用研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765247A (en) * | 2019-09-30 | 2020-02-07 | 支付宝(杭州)信息技术有限公司 | Input prompting method and device for question-answering robot |
CN110765247B (en) * | 2019-09-30 | 2022-10-25 | 支付宝(杭州)信息技术有限公司 | Input prompting method and device for question-answering robot |
CN111177349B (en) * | 2019-12-20 | 2022-05-17 | 厦门快商通科技股份有限公司 | Question-answer matching method, device, equipment and storage medium |
CN111177349A (en) * | 2019-12-20 | 2020-05-19 | 厦门快商通科技股份有限公司 | Question-answer matching method, device, equipment and storage medium |
CN111143530A (en) * | 2019-12-24 | 2020-05-12 | 平安健康保险股份有限公司 | Intelligent answering method and device |
CN111143530B (en) * | 2019-12-24 | 2024-04-05 | 平安健康保险股份有限公司 | Intelligent reply method and device |
CN111382255A (en) * | 2020-03-17 | 2020-07-07 | 北京百度网讯科技有限公司 | Method, apparatus, device and medium for question and answer processing |
CN111581354A (en) * | 2020-05-12 | 2020-08-25 | 金蝶软件(中国)有限公司 | FAQ question similarity calculation method and system |
CN111683174A (en) * | 2020-06-01 | 2020-09-18 | 信雅达系统工程股份有限公司 | Incoming call processing method, device and system |
CN113377921A (en) * | 2021-06-25 | 2021-09-10 | 北京百度网讯科技有限公司 | Method, apparatus, electronic device, and medium for matching information |
CN113377921B (en) * | 2021-06-25 | 2023-07-21 | 北京百度网讯科技有限公司 | Method, device, electronic equipment and medium for matching information |
CN114328852A (en) * | 2021-08-26 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Text processing method, related device and equipment |
CN117171309A (en) * | 2023-07-28 | 2023-12-05 | 至本医疗科技(上海)有限公司 | Method, apparatus and medium for providing response information for medical query |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109829045A (en) | A kind of answering method and device | |
CN106815252B (en) | Searching method and device | |
CN109992646B (en) | Text label extraction method and device | |
CN108829822B (en) | Media content recommendation method and device, storage medium and electronic device | |
US10095784B2 (en) | Synonym generation | |
CN112800170A (en) | Question matching method and device and question reply method and device | |
CN112069298A (en) | Human-computer interaction method, device and medium based on semantic web and intention recognition | |
CN108132927B (en) | Keyword extraction method for combining graph structure and node association | |
CN106874441A (en) | Intelligent answer method and apparatus | |
CN112035599B (en) | Query method and device based on vertical search, computer equipment and storage medium | |
CN112214593A (en) | Question and answer processing method and device, electronic equipment and storage medium | |
CN111259130B (en) | Method and apparatus for providing reply sentence in dialog | |
CN102637179B (en) | Method and device for determining lexical item weighting functions and searching based on functions | |
CN113282711B (en) | Internet of vehicles text matching method and device, electronic equipment and storage medium | |
CN115470338B (en) | Multi-scenario intelligent question answering method and system based on multi-path recall | |
CN108287848B (en) | Method and system for semantic parsing | |
CN111078832A (en) | Auxiliary response method and system for intelligent customer service | |
CN112084307A (en) | Data processing method and device, server and computer readable storage medium | |
CN108536665A (en) | A kind of method and device of determining sentence consistency | |
CN112579752A (en) | Entity relationship extraction method and device, storage medium and electronic equipment | |
CN112364622A (en) | Dialog text analysis method, dialog text analysis device, electronic device and storage medium | |
CN116304020A (en) | Industrial text entity extraction method based on semantic source analysis and span characteristics | |
TWI734085B (en) | Dialogue system using intention detection ensemble learning and method thereof | |
CN107122378B (en) | Object processing method and device and mobile terminal | |
CN111460114A (en) | Retrieval method, device, equipment and computer readable 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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20191030 Address after: 100085 Floor 102-1, Building No. 35, West Second Banner Road, Haidian District, Beijing Applicant after: Seashell Housing (Beijing) Technology Co., Ltd. Address before: 300 457 days Unit 5, Room 1, 112, Room 1, Office Building C, Nangang Industrial Zone, Binhai New Area Economic and Technological Development Zone, Tianjin Applicant before: Shell Technology Co., Ltd. |
|
TA01 | Transfer of patent application right | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190531 |
|
RJ01 | Rejection of invention patent application after publication |