CN112182175A - Intelligent question answering method, device, equipment and readable storage medium - Google Patents

Intelligent question answering method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN112182175A
CN112182175A CN202011025450.8A CN202011025450A CN112182175A CN 112182175 A CN112182175 A CN 112182175A CN 202011025450 A CN202011025450 A CN 202011025450A CN 112182175 A CN112182175 A CN 112182175A
Authority
CN
China
Prior art keywords
query statement
query
similarity
determining
categories
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
Application number
CN202011025450.8A
Other languages
Chinese (zh)
Inventor
邓江东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011025450.8A priority Critical patent/CN112182175A/en
Publication of CN112182175A publication Critical patent/CN112182175A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24147Distances to closest patterns, e.g. nearest neighbour classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0281Customer communication at a business location, e.g. providing product or service information, consulting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Business, Economics & Management (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Strategic Management (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Probability & Statistics with Applications (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)

Abstract

The embodiment of the disclosure provides an intelligent question answering method, an intelligent question answering device, intelligent question answering equipment and a readable storage medium. After the server receives the first query statement, the first query statement and the second query statement are input into the similarity model, and the similarity of the two query statements can be determined. And then, the server determines the target dialogues according to the similarity and returns the target dialogues to the electronic equipment. By adopting the scheme, the similarity model is constructed, the query statement input by the user and the similar query statement in the plurality of pre-stored query statements are identified by using the similarity model, the dialect corresponding to the similar query statement is returned, and the expense of the electronic equipment for loading the similarity model is reduced.

Description

Intelligent question answering method, device, equipment and readable storage medium
Technical Field
The disclosed embodiments relate to the technical field of artificial intelligence, and in particular, to an intelligent question answering method, an intelligent question answering device, an intelligent question answering equipment and a readable storage medium.
Background
With the rapid development of e-commerce services, online shopping has become a common behavior in people's lives. The online shopping comprises emerging live shopping, conventional business to customer (B2C) platform shopping and the like.
The customer service system is an important link of e-commerce business, the customer service system is used for answering a large number of inquiries of the user, and the quality of the customer service system has a great influence on the online shopping experience of the user. In order to build a high-quality customer service system, a conventional method is to build an intention recognition model from a large number of historical query sentences, recognize the intention of a query sentence currently input by a user based on the intention recognition model, and return relevant dialogs according to the intention in response to the user. As the electric business services become more complex, the customer service systems also become more complex. At this time, the intention system needs to be expanded to accommodate more scenes.
However, the e-commerce industry often involves many activities, and training an intent recognition model for each activity may make the entire intent recognition model too bulky and heavy, increasing the system overhead of electronic devices that load the intent recognition model.
Disclosure of Invention
The embodiment of the disclosure provides an intelligent question answering method, an intelligent question answering device, intelligent question answering equipment and a readable storage medium.
In a first aspect, an embodiment of the present disclosure provides an intelligent question answering method, including:
receiving a first query statement; inputting the first query statement and a second query statement into a similarity model to obtain the similarity between the first query statement and the second query statement, wherein the second query statement is stored in a knowledge base, a plurality of question answer QA pairs are stored in the knowledge base, each QA pair in the QA pairs comprises a query statement and a reply utterance corresponding to the query statement, the similarity model is trained by utilizing a plurality of question pairs in advance, and each question pair in the question pairs comprises two different query statements; determining a target utterance from the similarities, the target utterance being an answer utterance contained by at least one QA pair of the plurality of QA pairs; and sending the target language.
In a second aspect, an embodiment of the present disclosure provides an intelligent question answering device, including:
the receiving unit is used for receiving a first query statement from the electronic equipment.
A first determining unit, configured to input the first query statement and a second query statement to a similarity model, so as to obtain a similarity between the first query statement and the second query statement, where the second query statement is stored in a knowledge base, the knowledge base stores a plurality of question answer QA pairs, each QA pair in the plurality of QA pairs includes a reply utterance corresponding to one query statement and the query statement, the similarity model is trained by using a plurality of question pairs in advance, and each question pair in the plurality of question pairs includes two different query statements.
A second determining unit, configured to determine a target utterance, which is a reply utterance contained by at least one QA pair of the plurality of QA pairs, according to the similarity.
A sending unit, configured to send the target utterance.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the intelligent question-answering method as described above in the first aspect and in various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the intelligent question and answer method according to the first aspect and various possible designs of the first aspect is implemented.
The intelligent question answering method, the intelligent question answering device, the intelligent question answering equipment and the readable storage medium are characterized in that a similarity model and a knowledge base are deployed on a server in advance. After the server receives the first query statement, the first query statement and the second query statement are input into the similarity model, and the similarity of the two query statements can be determined. And then, the server determines the target dialogues according to the similarity and returns the target dialogues to the electronic equipment. By adopting the scheme, the similarity model is constructed, the query statement input by the user and the similar query statement in the plurality of pre-stored query statements are identified by using the similarity model, the dialect corresponding to the similar query statement is returned, and the expense of the electronic equipment for loading the similarity model is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a network architecture to which the intelligent question answering method provided by the embodiment of the present disclosure is applied;
FIG. 2 is a flow chart of an intelligent question answering method provided by the embodiment of the present disclosure;
FIG. 3 is a flow chart of knowledge base and similarity model construction in the intelligent question answering method provided by the embodiment of the present disclosure;
fig. 4 is a flowchart of narrowing down the scope of the second query statement in the intelligent question answering method provided by the embodiment of the present disclosure;
fig. 5 is a block diagram of an intelligent question answering device according to an embodiment of the present disclosure;
fig. 6 is a block diagram of another intelligent question answering device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device for implementing an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
With the popularization of live broadcast, many users migrate the online shopping habit to a new ecosystem of live broadcast, and a customer service system is a very important ring of electric commerce services. The traditional mode of training customer service personnel to go on duty brings a large amount of human costs for enterprises. Moreover, the attendance time of the customer service personnel is time-constrained. With the rapid development of artificial intelligence, the labor cost of enterprise customer service personnel is reduced by intelligent customer service, and the problem that the customer service personnel cannot respond to users in time when the customer service personnel is not on duty or is not on duty is solved.
Generally, an intelligent customer service system is established, and an intention system, also called an intention classifier, an intention recognition model and the like, is constructed for the customer service system. The intention classifier is used for classifying the intention of the user, such as identifying the intention of the user as logistics, return or change. As the electric business services become more and more, the customer service systems become more and more complex. At this time, the intention system needs to be expanded to accommodate more scenes.
However, the e-commerce industry often involves many activities, such as various promotion activities of e-commerce, and many B2C platforms organize a shopping section every month, and query statements for the shopping section are different from traditional physical, return-goods and other related query statements, and the intentions of the query statements mostly belong to long-tailed intentions. If an intent system is built for each activity, the intent system may be too bulky and cumbersome. The subsequent loading of the intention system on the electronic device can greatly increase the system overhead of the electronic device, resulting in too slow response speed.
Furthermore, the accuracy of a huge system of intentions decreases to some extent as the intentions increase. In addition, each time the intention system is expanded, the intention system cannot be flexibly increased or decreased because increasing or decreasing the intention system causes remodeling of the model, which requires time and cost.
The embodiment of the disclosure provides an intelligent question answering method, an intelligent question answering device, intelligent question answering equipment and a readable storage medium.
Fig. 1 is a schematic diagram of a network architecture to which the intelligent question answering method provided in the embodiment of the present disclosure is applied. Referring to fig. 1, the network architecture includes: the electronic device 1 and the server 2, and network connection is established between the electronic device 1 and the server 2. The trained similarity model is deployed in advance on the server 2. The user sends the query sentence to the server through the electronic device 1, and the server inputs the query sentence and the pre-stored query sentence to the intention separator, so that the similarity of the two query sentences can be obtained, and further the similarity of the query sentence currently input by the user and each pre-stored query sentence can be obtained. Then, the server determines the query statement with the highest similarity from the currently input query statement, and returns the dialect corresponding to the query statement to the electronic device. In addition, in consideration of the confidence degrees, if the server finds that the confidence degree of the highest similarity among the multiple similarity degrees is lower than the preset similarity degree, at this time, the server feeds back the words corresponding to the previous K (top K) query sentences to the electronic device in a list manner and the like for the user to select. Wherein K is more than or equal to 1.
In fig. 1, the electronic device 1 is a desktop electronic device such as a television, a computer, or the like, or a mobile electronic device such as a mobile phone, a tablet computer, a notebook computer, an intelligent robot, a portable wearable device, or the like. The server is an independently arranged server or a server cluster formed by a plurality of servers, and the embodiment of the disclosure is not limited.
Fig. 2 is a flowchart of an intelligent question answering method provided by the embodiment of the present disclosure. The embodiment is described from the perspective of interaction between an electronic device and a server. The embodiment comprises the following steps:
101. the server receives a first query statement.
The server receives a first query statement input by a user through an input and output device, such as a keyboard, a mouse, a microphone and the like. Alternatively, the server receives a first query statement from the electronic device. For example, a user can interact with a server through an Application (APP) deployed in an electronic device. The user can input query sentences to the electronic equipment in a voice mode or a text mode, and one query sentence is also called a query. When the user enters the query sentence in text, the server can directly recognize the text content. When a user inputs a voice, the electronic device or the server can recognize the text content by Natural Language Processing (NLP) or the like.
102. And inputting the first query statement and the second query statement into a similarity model to obtain the similarity of the first query statement and the second query statement.
The second query statement is stored in a knowledge base, a plurality of pre-constructed corresponding relations are stored in the knowledge base, different corresponding relations among the plurality of corresponding relations are used for indicating different question answer QA pairs, the similarity model is trained by using a plurality of question pairs in advance, and each question pair in the plurality of question pairs comprises two different query statements.
Illustratively, a knowledge base and a similarity model are stored in advance on the server, the similarity model is used for judging the similarity of any two query statements, and a plurality of Question Answer (QA) pairs are stored in the knowledge base. Q in each QA pair is equivalent to a query statement and A is equivalent to a dialect configured for the query statement. For example, a query statement is: for what category apple is, the dialectic technique is: apples belong to the order of fresh, fruit. Wherein, the fresh and fruits are the contents which are supplemented and perfected by the server according to the reality.
And a similarity model is also deployed on the server, the input of the similarity model is a first query statement and a second query statement, and the output of the similarity model is the similarity of the two query statements. Because there is at least one second query statement, the first query statement and each second query statement form a < query1, query2 > pair, and each < query1, query2 > pair is input into the similarity model, so that the similarity of the < query1, query2 > pair can be obtained. The second query statement may be a query statement in all QA pairs in the knowledge base, or may be a query statement in a part of QA pairs in the knowledge base, and the query statement in the QA pair is "Q".
103. Determining a target utterance from the similarities, the target utterance being an answer utterance contained by at least one QA pair of the plurality of QA pairs.
Illustratively, the server determines the similarity and determines the target dialect. For example, when the second query statement is one, the server takes the utterance of the query statement as the target utterance. For another example, when there are a plurality of second query sentences, there are a plurality of similarities, and at this time, the server takes the utterance corresponding to the query sentence with the highest similarity as the target utterance. For another example, when there are a plurality of second query statements, there are a plurality of similarities, at this time, the server sorts each second query statement according to the sequence of the similarities from high to low, determines whether the confidence of the highest similarity exceeds the preset similarity, and if the confidence of the highest similarity exceeds the preset similarity, takes the word of the second query statement corresponding to the highest similarity as the target word; and if the confidence degree of the highest similarity is lower than the preset similarity, returning the words corresponding to the second query statement of the similarity ranking TOP K and the second query statement of the TOP K to the electronic equipment in a list mode for the user to select.
104. And sending the target language.
The server outputs the completed target utterance. For example, the server displays the target utterance on a display screen; for another example, the server plays the target language; for another example, the server sends the target utterance to the electronic device for viewing by the user. Similar to the query sentence input by the user, the server may send the target language in a voice manner, or may send the target language in a text or picture manner, which is not limited in the embodiments of the present disclosure.
According to the intelligent question answering method provided by the embodiment of the disclosure, the server is pre-deployed with the similarity model and the knowledge base. After the server receives the first query statement, the first query statement and the second query statement are input into the similarity model, and the similarity of the two query statements can be determined. And then, the server determines the target dialogues according to the similarity and returns the target dialogues to the electronic equipment. By adopting the scheme, the similarity model is constructed, the query statement input by the user and the similar query statement in the plurality of pre-stored query statements are identified by using the similarity model, the dialect corresponding to the similar query statement is returned, and the expense of the electronic equipment for loading the similarity model is reduced.
In the above embodiment, the server inputs the first query statement and the second query statement to the similarity model, and before obtaining the similarity between the first query statement and the second query statement, the server further constructs a knowledge base and a similarity model by using historical query statements. Exemplarily, referring to fig. 3, fig. 3 is a flowchart for constructing a knowledge base and a similarity model in the intelligent question answering method provided by the embodiment of the present disclosure. The embodiment comprises the following steps:
201. a plurality of historical query statements is obtained.
Illustratively, a historical query statement is a query statement made by a user in a user over a past period of time, and a query statement is also referred to as a query. A query may have multiple expressions. For example, the query of the background website is also asked, and the query of different users is different.
The query of user 1 is: "what is the background web site? ".
The query of user 2 is: "what is the web address logged in the background? "
The query of user 3 is: "what is a backend login website? "
The query of user 4 is: what is the website of background login? "
The query of user 5 is: what is the website of logging in the background? "
202. Determining a vector of each historical query statement in the plurality of historical query statements to obtain a plurality of vectors.
Illustratively, the server performs word segmentation on all historical queries to obtain a plurality of words. Inputting the words into a word vector (word2Vec) model, and training to obtain a word embedding (embedding) vector of each word. Then, for each historical query statement, the server determines the vector of the historical query statement according to the word embedding vector of each of a plurality of words obtained by segmenting the historical query statement. For example, the server calculates an average value of word embedding vectors of each term included in the historical query expression, and sets the average vector as the vector of the historical query expression. In this way, the server can obtain the vector of each historical query statement.
203. Clustering the plurality of historical query statements according to the plurality of vectors to cluster the plurality of historical query statements into a plurality of categories.
Illustratively, the server employs a clustering algorithm to exemplify a plurality of historical query statements, and similar historical query statements are clustered together. The clustering algorithm is, for example, K means (kmeans), fuzzy clustering algorithm, etc.
204. Determining the similarity model from the plurality of categories.
Illustratively, the server constructs a positive sample and a negative sample according to the clustered historical query statement to obtain a sample set, and performs model training by using the samples in the sample set to train a similarity model. The similarity model is used for judging whether any two query sentences are similar query sentences.
The above describes how the server trains the similarity model by taking the server to construct the positive sample and the negative sample according to the clustered historical query statement as an example. However, the disclosed embodiments are not limited. For example, the server can also obtain manually labeled positive and negative examples. A similarity model is trained based on the positive and negative examples.
205. And constructing the knowledge base according to the plurality of categories.
Illustratively, the server constructs a QA pair according to the clustered historical query sentences, and stores the constructed QA pair in a knowledge base so as to construct the knowledge base. In a QA pair, query may have multiple different expression patterns.
The above describes how the server constructs the knowledge base by taking the example that the server constructs the QA pair according to the clustered historical query statement as an example. However, the disclosed embodiments are not limited. For example, the server can also obtain manually labeled QA pairs. A knowledge base is constructed based on the QA pairs.
By adopting the scheme, the server automatically excavates knowledge from the historical query sentences and constructs a knowledge base in a knowledge excavation mode, and trains a similarity model based on the clustered historical query sentences, so that the purpose of automatically identifying the knowledge and constructing the knowledge base and the similarity model is achieved.
In step 204 of the embodiment in fig. 3, when the server determines the similarity model according to the multiple categories, a sample set is determined according to the multiple categories, where the sample set includes a positive sample and a negative sample, two historical query statements included in the positive sample belong to the same category of the multiple categories, and two historical query statements included in the negative sample belong to different categories of the multiple categories. And then, the server trains an initial model by using the sample set to obtain the similarity model.
Illustratively, after clustering the historical query sentences, the server divides the historical query sentences into a plurality of categories, and each category comprises at least one historical query sentence. Since any two historical query statements belonging to the same category are similar queries. Therefore, the server performs pairwise combination of < query, query > on the historical query sentences in the same category to obtain a positive sample. Historical query statements in different categories default to non-similar queries. Therefore, the server performs pairwise combination of < query, query > on the historical query sentences in different categories to obtain negative samples.
After the server obtains the sample set, the initial model is continuously trained by using the samples in the sample set so as to enable the initial model to reach the optimal state, and the initial model in the optimal state is used as a similarity model. The initial model is, for example, a Deep semantic model (DSSM), a Convolutional Neural Network (CNN) model, a Deep Neural Network (DNN), a Recurrent Neural Network (RNN), or the like.
By adopting the scheme, the server automatically constructs the sample set by using the historical query sentences, trains out the similarity model by using the samples in the sample set, and has high efficiency and high accuracy.
In step 205 of the embodiment in fig. 3, when the server constructs the knowledge base according to the multiple categories, different dialogues are configured for different categories in the multiple categories, and the correspondence between the different categories and the dialogues in the multiple categories is stored in the knowledge base.
Illustratively, the server binds the utterance to the historical query statement according to the category to obtain a QA pair, and stores the QA pair in the knowledge base, thereby constructing the knowledge base. In the process of binding the dialogs, the same dialogs are bound for the historical query sentences belonging to the same category. Afterwards, the QA pair is subjected to quality inspection and stored in a knowledge base.
In the embodiment of the present disclosure, when performing the linguistic binding, the server depends on the following manner:
in the first mode, the server mines historical query sentences and dialogs of manual customer service answers. That is, for a historical query statement, after the manual customer service answer is finished, if the user clicks 'solved', the server configures the dialect of the manual customer service answer to the historical query statement. For example, a historical query statement is "what category is apple? ", manual customer service answer: "fresh or fruit". Thereafter, the user clicks resolved. Then, the server considers "what category is apple? "and" fresh or fruit "constitute a QA pair.
In this method, the server excavates a knowledge point from a conversation between the user and the manual customer service by knowledge mining, and stores the knowledge point in the form of a < query, answer > pair. And in order to accelerate the semantic matching of the first query statement and the second query statement, the candidates adopt a vectorization recall mode to carry out coarse screening, and the second query statement in the candidate set is brought into a similarity model to carry out semantic matching.
In the second method, for some high-frequency category questions, if the intention system is expanded for the question, the current intention system will be interfered. This is because, after training an intention system for classifying intentions into logistics, exchange of goods, return of goods, and the like, longtail intentions are endless, and adding a category to each longtail intention reduces the accuracy of intention identification and recall rate. For example, an e-commerce platform hosts a promotional campaign X that a large number of users may have asked a question for a period of time prior to the campaign being launched. Such as:
a user a: sales promotion activity X, together with your coupon preferential strength?
And b, the user b: what do your promotional campaign X have a preferential campaign, what is the maximum strength of the relevant coupon?
And a user c: do your promotional campaign X be 500 full minus 200?
……
In this case, it is not practical to train an intention system for intention classification for these high-frequency query sentences. Therefore, for the high-frequency query statements, the server configures a preset fixed telephone to obtain < query, answer >; or, the manual customer service configures a dialog for the high-frequency query statement to obtain < query, answer >.
By adopting the scheme, the server automatically constructs the knowledge base by utilizing the historical query sentences, and the aim of constructing the accurate knowledge base containing rich knowledge is fulfilled.
In the disclosed embodiment, tens of millions of QA pairs are often stored in a knowledge base. Subsequently, when the similarity between the first query statement currently input by the user and the second query statement in the knowledge base is judged by using the knowledge base and the similarity model, because the Q of each QA opposite face is a query statement, if the similarity between the first query statement currently input by the user and each second query statement is judged, the calculated amount is huge, the system overhead is large, and the system is likely to be crashed. Therefore, the server inputs the first query statement and the second query statement into a similarity model, and before the similarity of the first query statement and the second query statement is obtained, the server also carries out certain processing on the query statements in a knowledge base so as to narrow the range of the second query statement. For example, please refer to fig. 4.
Fig. 4 is a flowchart for narrowing down the scope of the second query statement in the intelligent question answering method provided by the embodiment of the present disclosure. The embodiment comprises the following steps:
301. and dividing the historical query sentences in the knowledge base into a plurality of sets, wherein any two historical query sentences belonging to the same set are similar but have different dialects.
Illustratively, the server uses a K-nearest neighbor (KNN) classification algorithm or the like, for example, a fast ball tree (fast ball tree) that uses an approximation scheme of the KNN classification algorithm, to divide the historical query statements contained in the knowledge base into a plurality of sets, where each set contains a plurality of historical query statements, and where each query statement in a set has a different terminology. The historical query statement is Q in the QA pair contained in the knowledge base, and the jargon is a in the QA pair.
302. Determining an intermediate vector for each of the plurality of sets to obtain a plurality of intermediate vectors.
Illustratively, one set comprises a plurality of historical query sentences, the server performs word segmentation on the historical query sentences to obtain word segmentation results of each historical query sentence, and vectors of the historical query sentences are determined according to the word segmentation results. Then, the average value of the vectors of the historical query statement is obtained, and the average value is used as an intermediate vector.
Therefore, the server gathers similar historical query sentences into a spherical surface, and one spherical surface is a set, so that the intermediate vector of each spherical surface is determined, and a plurality of intermediate vectors are obtained.
303. A target intermediate vector is determined from the plurality of intermediate vectors.
Wherein the target intermediate vector is a vector of the plurality of intermediate vectors having a highest vector similarity to the first query statement.
Illustratively, after a user inputs a first query statement to the electronic device, the first query statement is sent by the electronic device to the server. The server determines a vector for the first query statement. And then, the server carries out similarity calculation on the vector of the first query statement and each intermediate vector in the plurality of intermediate vectors to obtain a plurality of similarities. And then, the server determines the highest similarity from the multiple similarities, and takes the intermediate vector corresponding to the highest similarity as the target intermediate vector. And the server takes the set corresponding to the target intermediate vector as a candidate set. This process is called a recall process.
Then, the server inputs the first query statement and each second query statement in the candidate set into the similarity model to obtain a plurality of similarities, and the target dialect is determined according to the similarities.
By adopting the scheme, the server gathers the similar query sentences in the knowledge base into one spherical surface, then obtains the intermediate vector of each spherical surface, and after a user inputs a first query sentence, the candidate set can be obtained only by performing similarity calculation with each intermediate vector, so that part of query sentences are recalled from thousands of query sentences as second query sentences, the matching range of the similarity model is reduced from the whole knowledge base to the part of knowledge base, and the matching time is shortened.
In the above embodiment, after the server recalls the candidate set by using the KNN classification algorithm, the server needs to perform the correlation matching on the first query statement and the recalled second query statements by using the similarity model. Taking the similarity model as a DSSM framework as an example, the input of the similarity model is a first query statement and a second query statement, and the output is whether the two query statements are similar. For example, the first query statement is: "what is a backend login website? ", the second query statement is: "web site of background login. ", the output of the similarity model is" 1 ", indicating similarity. For another example, the first query statement is: "what the website logged in at background is", the second query statement is: and if the data flow is 'physical flow', the output of the similarity model is '0', which indicates that the data flow is not similar.
In the determination process, the server determines vectors of the first query statement and the second query statement by using the similarity model. Then, the server extracts the long dependence features of the vector of the first query statement by using a bidirectional Gated recursive Unit (Bi-GRU) of the similarity model to obtain a first long dependence feature, and extracts the long dependence features of the vector of the second query statement to obtain a second long dependence feature. The first long dependency characteristics are obtained by sequencing terms obtained by word segmentation of the first query statement, and similarly, the second long dependency characteristics are obtained by sequencing terms obtained by word segmentation of the second query statement. For example, the first query statement is "i love red down jacket", and the terms obtained by segmenting the first query statement include: "i", "love", "red", "down jacket", denoted w1, w2, w3, w4, respectively, the first long dependence feature is: w1, w2, w3 and w 4.
And then, the server performs local feature extraction on the first long dependence feature by using the CNN of the similarity model to obtain a first local feature, and performs local feature extraction on the second long dependence feature to obtain a second local feature. Wherein the first local feature is a partial word in the first long dependence feature, such as w3, w 4.
Next, the server performs processing such as addition, subtraction, or element-by-element multiplication on the first local feature and the second local feature, and inputs the processing result to the loss function layer of the similarity model to identify the similarity. The loss function of the loss function layer is, for example, a sigmoid loss function, and the like, and the embodiments of the present disclosure are not limited thereto. By adopting the scheme, the purpose that the server identifies the similarity of any two Query by using the similarity model is achieved.
And assuming that K second query statements exist in the candidate set, the server obtains K similarities by using the similarity model. For example, if tens of millions of QAs are stored in the knowledge base, K is 1000. Then, the server sorts the K similarities in descending order, and obtains the second query statement of the score top K1. K1 is much less than K.
After the server selects top k1 second query sentences, when the target dialect is determined according to the similarity, the server judges the confidence degrees of the k1 second query sentences, and further judges whether the confidence degrees of the k1 second query sentences exceed a preset threshold value. If the k1 confidences have the confidence exceeding the preset threshold, returning the dialect of the second query statement corresponding to the confidence to the user. If the k1 confidence degrees are all low, the server returns a list, k2 knowledge points are popped up for the user to select, and k2 is not more than k 1. For example, the server pops up k2 second query statements in a list, and consults with which of the k1 questions the user wants to ask, and returns relevant dialogs according to the user's selection.
By adopting the scheme, the server returns different results aiming at the intention identification with different confidence degrees, namely for the intention identification with high confidence degree, the server directly returns the dialect corresponding to the second query statement; for the intention recognition with low confidence coefficient, the server returns a candidate list for the user to select, so that the intention of the user is accurately guessed, and the user is replied through the pre-configured dialect answers to solve the problems encountered in actual shopping.
Corresponding to the intelligent question answering method of the above embodiment, fig. 5 is a structural block diagram of an intelligent question answering device provided by the embodiment of the present disclosure. For ease of illustration, only portions that are relevant to embodiments of the present disclosure are shown. Referring to fig. 5, the apparatus includes: a receiving unit 11, a first determining unit 12, a second determining unit 13 and a transmitting unit 14.
A receiving unit 11, configured to receive a first query statement;
a first determining unit 12, configured to input the first query statement and a second query statement to a similarity model, so as to obtain a similarity between the first query statement and the second query statement, where the second query statement is stored in a knowledge base, the knowledge base stores a plurality of question answer QA pairs, each QA pair in the plurality of QA pairs includes a reply utterance corresponding to one query statement and the query statement, the similarity model is trained by using a plurality of question pairs in advance, and each question pair in the plurality of question pairs includes two different query statements;
a second determining unit 13, configured to determine a target utterance, which is a reply utterance contained in at least one of the plurality of QA pairs, according to the similarity;
a sending unit 14, configured to send the target utterance to the electronic device.
Fig. 6 is a block diagram of another intelligent question answering device according to an embodiment of the present disclosure. The intelligent question-answering device 100 provided in this example further includes, on the basis of fig. 5:
a training unit 15, configured to obtain a plurality of historical query sentences before the first determining unit 12 inputs the first query sentence and the second query sentence to a similarity model to obtain a similarity between the first query sentence and the second query sentence; determining a vector of each historical query statement in the plurality of historical query statements to obtain a plurality of vectors; clustering the plurality of historical query statements according to the plurality of vectors to cluster the plurality of historical query statements into a plurality of categories; determining the similarity model according to the plurality of categories; and constructing the knowledge base according to the plurality of categories.
In an embodiment of the present disclosure, when determining the similarity model according to the multiple categories, the training unit 15 is configured to determine a sample set according to the multiple categories, where the sample set includes a positive sample and a negative sample, two historical query sentences included in the positive sample belong to a same category of the multiple categories, and two historical query sentences included in the negative sample belong to different categories of the multiple categories; and training an initial model by using the sample set to obtain the similarity model.
In an embodiment of the present disclosure, the training unit 15 is configured to configure different dialogs for different categories of the plurality of categories when constructing the knowledge base according to the plurality of categories; and storing the corresponding relation between different categories in the plurality of categories and dialogs in the knowledge base.
In an embodiment of the present disclosure, the first determining unit 12 is further configured to divide the historical query sentences in the knowledge base into a plurality of sets before the first query sentence and the second query sentence are input to a similarity model to obtain the similarity of the first query sentence and the second query sentence, where any two historical query sentences belonging to the same set are similar but have different meanings; determining an intermediate vector of each set in the plurality of sets to obtain a plurality of intermediate vectors; determining a target intermediate vector from the plurality of intermediate vectors, wherein the target intermediate vector is a vector with the highest vector similarity corresponding to the first query statement in the plurality of intermediate vectors; and determining a candidate set according to the target intermediate vector, wherein the second query statement is any one historical query statement in the candidate set.
In an embodiment of the present disclosure, the first determining unit 12 determines an intermediate vector of each set in a plurality of sets, and when obtaining a plurality of intermediate vectors, determines, for any set in the plurality of sets, a vector of each historical query statement included in the set; and determining the intermediate vector of the set according to the vector of each historical query statement contained in the set.
In an embodiment of the present disclosure, the first determining unit 12 is configured to determine, by using the similarity model, a first long dependency feature of the first query statement and a second long dependency feature of the second query statement, where the first long dependency feature is obtained by sorting terms obtained by segmenting the first query statement; determining a first local feature according to the first long-dependent feature, and determining a second local feature according to the second long-dependent feature; and determining the similarity of the first query statement and the second query statement according to the first local feature and the second local feature.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device for implementing an embodiment of the present disclosure, where the electronic device 200 may be a terminal device or a server. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car terminal (e.g., car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, the electronic device 200 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 201, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage means 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for the operation of the electronic apparatus 200 are also stored. The processing device 201, the ROM202, and the RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
Generally, the following devices may be connected to the I/O interface 205: input devices 206 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 207 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 208 including, for example, magnetic tape, hard disk, etc.; and a communication device 209. The communication means 209 may allow the electronic device 200 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 200 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 209, or installed from the storage means 208, or installed from the ROM 202. The computer program, when executed by the processing device 201, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided an intelligent question-answering method, including: receiving a first query statement; inputting the first query statement and a second query statement into a similarity model to obtain the similarity between the first query statement and the second query statement, wherein the second query statement is stored in a knowledge base, a plurality of question answer QA pairs are stored in the knowledge base, each QA pair in the QA pairs comprises a query statement and a reply utterance corresponding to the query statement, the similarity model is trained by utilizing a plurality of question pairs in advance, and each question pair in the question pairs comprises two different query statements; determining a target utterance from the similarities, the target utterance being an answer utterance contained by at least one QA pair of the plurality of QA pairs; and sending the target language.
According to one or more embodiments of the present disclosure, before the inputting the first query statement and the second query statement to a similarity model and obtaining the similarity between the first query statement and the second query statement, the method further includes: acquiring a plurality of historical query sentences; determining a vector of each historical query statement in the plurality of historical query statements to obtain a plurality of vectors; clustering the plurality of historical query statements according to the plurality of vectors to cluster the plurality of historical query statements into a plurality of categories; determining the similarity model according to the plurality of categories; and constructing the knowledge base according to the plurality of categories.
According to one or more embodiments of the present disclosure, the determining the similarity model according to the plurality of categories includes: determining a sample set according to the plurality of categories, wherein the sample set comprises a positive sample and a negative sample, two historical query sentences contained in the positive sample belong to the same category in the plurality of categories, and two historical query sentences contained in the negative sample belong to different categories in the plurality of categories; and training an initial model by using the sample set to obtain the similarity model.
According to one or more embodiments of the present disclosure, the building the knowledge base according to the plurality of categories includes: configuring different dialogs for different categories of the plurality of categories; and storing the corresponding relation between different categories in the plurality of categories and dialogs in the knowledge base.
According to one or more embodiments of the present disclosure, before the inputting the first query statement and the second query statement to a similarity model and obtaining the similarity between the first query statement and the second query statement, the method further includes: dividing historical query sentences in the knowledge base into a plurality of sets, wherein any two historical query sentences belonging to the same set are similar but have different dialects; determining an intermediate vector of each set in the plurality of sets to obtain a plurality of intermediate vectors; determining a target intermediate vector from the plurality of intermediate vectors, wherein the target intermediate vector is a vector with the highest vector similarity corresponding to the first query statement in the plurality of intermediate vectors; and determining a candidate set according to the target intermediate vector, wherein the second query statement is any one historical query statement in the candidate set.
According to one or more embodiments of the present disclosure, the determining the intermediate vector of each of the plurality of sets, resulting in a plurality of intermediate vectors, includes: for any one of the multiple sets, determining vectors of historical query statements contained in the set; and determining the intermediate vector of the set according to the vector of each historical query statement contained in the set.
According to one or more embodiments of the present disclosure, the inputting the first query statement and the second query statement to a similarity model to obtain a similarity between the first query statement and the second query statement includes: determining a first long dependency feature of the first query statement and a second long dependency feature of the second query statement by using the similarity model, wherein the first long dependency feature is obtained by sequencing terms obtained by segmenting the first query statement; determining a first local feature according to the first long-dependent feature, and determining a second local feature according to the second long-dependent feature; and determining the similarity of the first query statement and the second query statement according to the first local feature and the second local feature.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided an intelligent question-answering device, including: a receiving unit, configured to receive a first query statement.
A first determining unit, configured to input the first query statement and a second query statement to a similarity model, so as to obtain a similarity between the first query statement and the second query statement, where the second query statement is stored in a knowledge base, the knowledge base stores a plurality of question answer QA pairs, each QA pair in the plurality of QA pairs includes a reply utterance corresponding to one query statement and the query statement, the similarity model is trained by using a plurality of question pairs in advance, and each question pair in the plurality of question pairs includes two different query statements.
A second determining unit, configured to determine a target utterance, which is a reply utterance contained by at least one QA pair of the plurality of QA pairs, according to the similarity.
A sending unit, configured to send the target utterance to the electronic device.
According to one or more embodiments of the present disclosure, the apparatus described above further includes: a training unit, configured to obtain a plurality of historical query sentences before the first determining unit inputs the first query sentence and the second query sentence to a similarity model and obtains a similarity between the first query sentence and the second query sentence; determining a vector of each historical query statement in the plurality of historical query statements to obtain a plurality of vectors; clustering the plurality of historical query statements according to the plurality of vectors to cluster the plurality of historical query statements into a plurality of categories; determining the similarity model according to the plurality of categories; and constructing the knowledge base according to the plurality of categories.
According to one or more embodiments of the present disclosure, when determining the similarity model according to the plurality of categories, the training unit is configured to determine a sample set according to the plurality of categories, where the sample set includes a positive sample and a negative sample, two historical query sentences included in the positive sample belong to a same category of the plurality of categories, and two historical query sentences included in the negative sample belong to different categories of the plurality of categories; and training an initial model by using the sample set to obtain the similarity model.
According to one or more embodiments of the present disclosure, the training unit is configured to configure different dialogs for different categories of the plurality of categories when constructing the knowledge base according to the plurality of categories; and storing the corresponding relation between different categories in the plurality of categories and dialogs in the knowledge base.
According to one or more embodiments of the present disclosure, the first determining unit inputs the first query statement and the second query statement to a similarity model, and before obtaining the similarity between the first query statement and the second query statement, the first determining unit is further configured to divide the historical query statements in the knowledge base into a plurality of sets, where any two historical query statements belonging to the same set are similar but have different meanings; determining an intermediate vector of each set in the plurality of sets to obtain a plurality of intermediate vectors; determining a target intermediate vector from the plurality of intermediate vectors, wherein the target intermediate vector is a vector with the highest vector similarity corresponding to the first query statement in the plurality of intermediate vectors; and determining a candidate set according to the target intermediate vector, wherein the second query statement is any one historical query statement in the candidate set.
According to one or more embodiments of the present disclosure, the first determining unit determines an intermediate vector of each set in a plurality of sets, and when a plurality of intermediate vectors are obtained, determines, for any one set in the plurality of sets, a vector of each historical query statement included in the set; and determining the intermediate vector of the set according to the vector of each historical query statement contained in the set.
According to one or more embodiments of the present disclosure, the first determining unit is configured to determine, by using the similarity model, a first long dependency feature of the first query statement and a second long dependency feature of the second query statement, where the first long dependency feature is obtained by sorting terms obtained by segmenting the first query statement; determining a first local feature according to the first long-dependent feature, and determining a second local feature according to the second long-dependent feature; and determining the similarity of the first query statement and the second query statement according to the first local feature and the second local feature.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the intelligent question-answering method as described above in the first aspect and in various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the intelligent question and answer method according to the first aspect and various possible designs of the first aspect is implemented.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. An intelligent question answering method is characterized by comprising the following steps:
receiving a first query statement;
inputting the first query statement and a second query statement into a similarity model to obtain the similarity between the first query statement and the second query statement, wherein the second query statement is stored in a knowledge base, a plurality of question answer QA pairs are stored in the knowledge base, each QA pair in the QA pairs comprises a query statement and a reply utterance corresponding to the query statement, the similarity model is trained by utilizing a plurality of question pairs in advance, and each question pair in the question pairs comprises two different query statements;
determining a target utterance from the similarities, the target utterance being an answer utterance contained by at least one QA pair of the plurality of QA pairs;
and sending the target language.
2. The method of claim 1, wherein before inputting the first query statement and the second query statement into a similarity model to obtain the similarity between the first query statement and the second query statement, the method further comprises:
acquiring a plurality of historical query sentences;
determining a vector of each historical query statement in the plurality of historical query statements to obtain a plurality of vectors;
clustering the plurality of historical query statements according to the plurality of vectors to cluster the plurality of historical query statements into a plurality of categories;
determining the similarity model according to the plurality of categories;
and constructing the knowledge base according to the plurality of categories.
3. The method of claim 2, wherein determining the similarity model from the plurality of categories comprises:
determining a sample set according to the plurality of categories, wherein the sample set comprises a positive sample and a negative sample, two historical query sentences contained in the positive sample belong to the same category in the plurality of categories, and two historical query sentences contained in the negative sample belong to different categories in the plurality of categories;
and training an initial model by using the sample set to obtain the similarity model.
4. The method of claim 2, wherein said building said knowledge base from said plurality of categories comprises:
configuring different dialogs for different categories of the plurality of categories;
and storing the corresponding relation between different categories in the plurality of categories and dialogs in the knowledge base.
5. The method of any one of claims 1-4, wherein before inputting the first query statement and the second query statement to a similarity model to obtain a similarity of the first query statement and the second query statement, further comprising:
dividing historical query sentences in the knowledge base into a plurality of sets, wherein any two historical query sentences belonging to the same set are similar but have different dialects;
determining an intermediate vector of each set in the plurality of sets to obtain a plurality of intermediate vectors;
determining a target intermediate vector from the plurality of intermediate vectors, wherein the target intermediate vector is a vector with the highest vector similarity corresponding to the first query statement in the plurality of intermediate vectors;
and determining a candidate set according to the target intermediate vector, wherein the second query statement is any one historical query statement in the candidate set.
6. The method of claim 5, wherein determining the intermediate vectors for each of the plurality of sets to obtain a plurality of intermediate vectors comprises:
for any one of the multiple sets, determining vectors of historical query statements contained in the set;
and determining the intermediate vector of the set according to the vector of each historical query statement contained in the set.
7. The method of any one of claims 1-4, wherein the inputting the first query statement and the second query statement to a similarity model to obtain a similarity of the first query statement and the second query statement comprises:
determining a first long dependency feature of the first query statement and a second long dependency feature of the second query statement by using the similarity model, wherein the first long dependency feature is obtained by sequencing terms obtained by segmenting the first query statement;
determining a first local feature according to the first long-dependent feature, and determining a second local feature according to the second long-dependent feature;
and determining the similarity of the first query statement and the second query statement according to the first local feature and the second local feature.
8. An intelligent question answering device, comprising:
a receiving unit, configured to receive a first query statement;
a first determining unit, configured to input the first query statement and a second query statement to a similarity model, so as to obtain a similarity between the first query statement and the second query statement, where the second query statement is stored in a knowledge base, the knowledge base stores a plurality of question answer QA pairs, each QA pair in the plurality of QA pairs includes a reply utterance corresponding to one query statement and the query statement, the similarity model is trained by using a plurality of question pairs in advance, and each question pair in the plurality of question pairs includes two different query statements;
a second determining unit for determining a target utterance, which is a reply utterance contained by at least one of the plurality of QA pairs, according to the similarity;
a sending unit, configured to send the target utterance.
9. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the intelligent question answering method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement the intelligent question-answering method according to any one of claims 1 to 7.
CN202011025450.8A 2020-09-25 2020-09-25 Intelligent question answering method, device, equipment and readable storage medium Pending CN112182175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011025450.8A CN112182175A (en) 2020-09-25 2020-09-25 Intelligent question answering method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011025450.8A CN112182175A (en) 2020-09-25 2020-09-25 Intelligent question answering method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112182175A true CN112182175A (en) 2021-01-05

Family

ID=73943947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011025450.8A Pending CN112182175A (en) 2020-09-25 2020-09-25 Intelligent question answering method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112182175A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434656A (en) * 2021-07-21 2021-09-24 广州华多网络科技有限公司 E-commerce customer service matching method and corresponding device, equipment and medium thereof
CN114490939A (en) * 2022-01-25 2022-05-13 北京华宇元典信息服务有限公司 Dispute focus recommendation method and device
CN116244413A (en) * 2022-12-27 2023-06-09 北京百度网讯科技有限公司 New intention determining method, apparatus and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107918640A (en) * 2017-10-20 2018-04-17 阿里巴巴集团控股有限公司 Sample determines method and device
US20180373782A1 (en) * 2017-06-27 2018-12-27 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for recommending answer to question based on artificial intelligence
WO2019153522A1 (en) * 2018-02-09 2019-08-15 卫盈联信息技术(深圳)有限公司 Intelligent interaction method, electronic device, and storage medium
CN110795541A (en) * 2019-08-23 2020-02-14 腾讯科技(深圳)有限公司 Text query method and device, electronic equipment and computer readable storage medium
CN111177349A (en) * 2019-12-20 2020-05-19 厦门快商通科技股份有限公司 Question-answer matching method, device, equipment and storage medium
CN111444329A (en) * 2020-06-12 2020-07-24 支付宝(杭州)信息技术有限公司 Intelligent conversation method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180373782A1 (en) * 2017-06-27 2018-12-27 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for recommending answer to question based on artificial intelligence
CN107918640A (en) * 2017-10-20 2018-04-17 阿里巴巴集团控股有限公司 Sample determines method and device
WO2019153522A1 (en) * 2018-02-09 2019-08-15 卫盈联信息技术(深圳)有限公司 Intelligent interaction method, electronic device, and storage medium
CN110795541A (en) * 2019-08-23 2020-02-14 腾讯科技(深圳)有限公司 Text query method and device, electronic equipment and computer readable storage medium
CN111177349A (en) * 2019-12-20 2020-05-19 厦门快商通科技股份有限公司 Question-answer matching method, device, equipment and storage medium
CN111444329A (en) * 2020-06-12 2020-07-24 支付宝(杭州)信息技术有限公司 Intelligent conversation method and device and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434656A (en) * 2021-07-21 2021-09-24 广州华多网络科技有限公司 E-commerce customer service matching method and corresponding device, equipment and medium thereof
CN113434656B (en) * 2021-07-21 2023-04-25 广州华多网络科技有限公司 E-commerce customer service matching method and corresponding device, equipment and medium thereof
CN114490939A (en) * 2022-01-25 2022-05-13 北京华宇元典信息服务有限公司 Dispute focus recommendation method and device
CN114490939B (en) * 2022-01-25 2022-09-02 北京华宇元典信息服务有限公司 Dispute focus recommendation method and device
CN116244413A (en) * 2022-12-27 2023-06-09 北京百度网讯科技有限公司 New intention determining method, apparatus and storage medium
CN116244413B (en) * 2022-12-27 2023-11-21 北京百度网讯科技有限公司 New intention determining method, apparatus and storage medium

Similar Documents

Publication Publication Date Title
US11645517B2 (en) Information processing method and terminal, and computer storage medium
CN111428010B (en) Man-machine intelligent question-answering method and device
CN112182175A (en) Intelligent question answering method, device, equipment and readable storage medium
CN106406806A (en) A control method and device for intelligent apparatuses
CN112182176A (en) Intelligent question answering method, device, equipment and readable storage medium
CN113094481A (en) Intention recognition method and device, electronic equipment and computer readable storage medium
CN111666416A (en) Method and apparatus for generating semantic matching model
CN112182178A (en) Intelligent question answering method, device, equipment and readable storage medium
CN112906381B (en) Dialog attribution identification method and device, readable medium and electronic equipment
CN110765294A (en) Image searching method and device, terminal equipment and storage medium
CN112883968A (en) Image character recognition method, device, medium and electronic equipment
CN111738010A (en) Method and apparatus for generating semantic matching model
CN111625649A (en) Text processing method and device, electronic equipment and medium
CN110059172B (en) Method and device for recommending answers based on natural language understanding
CN112163074A (en) User intention identification method and device, readable storage medium and electronic equipment
CN115270717A (en) Method, device, equipment and medium for detecting vertical position
CN113033707B (en) Video classification method and device, readable medium and electronic equipment
CN112528146B (en) Content resource recommendation method and device, electronic equipment and storage medium
CN112532507A (en) Method and device for presenting expression image and method and device for sending expression image
CN114547244A (en) Method and apparatus for determining information
CN113571044A (en) Voice information processing method and device and electronic equipment
CN112446214A (en) Method, device and equipment for generating advertisement keywords and storage medium
CN116204624A (en) Response method, response device, electronic equipment and storage medium
CN112685996B (en) Text punctuation prediction method and device, readable medium and electronic equipment
CN110502630B (en) Information processing method and device

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