CN118051603A - Intelligent clarification question sentence generation method, device, equipment and medium - Google Patents
Intelligent clarification question sentence generation method, device, equipment and medium Download PDFInfo
- Publication number
- CN118051603A CN118051603A CN202410444686.7A CN202410444686A CN118051603A CN 118051603 A CN118051603 A CN 118051603A CN 202410444686 A CN202410444686 A CN 202410444686A CN 118051603 A CN118051603 A CN 118051603A
- Authority
- CN
- China
- Prior art keywords
- question sentence
- result
- question
- sentence
- ambiguity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000005352 clarification Methods 0.000 title claims description 104
- 230000008569 process Effects 0.000 claims description 23
- 238000012549 training Methods 0.000 claims description 12
- 238000012937 correction Methods 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 230000002085 persistent effect Effects 0.000 description 6
- 238000000605 extraction Methods 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000003058 natural language processing Methods 0.000 description 4
- 235000013399 edible fruits Nutrition 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000013179 statistical model Methods 0.000 description 3
- 230000002441 reversible effect Effects 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 241000282414 Homo sapiens Species 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 239000002355 dual-layer Substances 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Machine Translation (AREA)
Abstract
According to the intelligent clear question sentence generation method, device, equipment and medium, an original question sentence input by a user side is received, the original question sentence is input into a clear model to obtain a sentence ambiguity result, the clear model is used for generating a question sentence to be cleared for disambiguation based on the question sentence when the meaning of the question sentence is detected to be ambiguous, then the sentence ambiguity result is sent to the user side, a reply result returned by the user side is received, the original question sentence is corrected based on the reply result to obtain a clear question sentence, finally an answer result is obtained based on the clear question sentence, and the answer result is returned to the user side.
Description
Technical Field
The application relates to the technical field of artificial intelligence, in particular to an intelligent clarification question sentence generation method, device, equipment and medium.
Background
The intelligent question-answering system is used as a powerful intelligent application, and the core technical problem proposed by a user is solved in a concise and effective question-answering mode by fusing knowledge extraction, representation, retrieval and question-answering technologies of multi-source heterogeneous data.
In the related art, in the process of a question-answer dialogue between an intelligent question-answer system and a user, the problems of semantic ambiguity, knowledge ambiguity and the like may exist in sentences in the dialogue input by the user, and the intelligent question-answer system cannot accurately understand the intention which the user wants to express, so that the intelligent question-answer system cannot give an accurate answer.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides a method, a device, equipment and a medium for generating an intelligent clarification question sentence, which are used for improving the accuracy of answers of an intelligent question-answering system.
The first aspect of the application provides an intelligent clarification question sentence generation method, which comprises the following steps:
receiving an original question sentence input by a user terminal;
Inputting the original question sentence into a clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for eliminating ambiguity based on the question sentence when the ambiguity exists in the semantic meaning of the question sentence;
sending the statement ambiguity result to the user side;
receiving a reply result returned by the user side;
correcting the original question sentence based on the reply result to obtain a clear question sentence;
obtaining an answer result based on the clear question sentence, and returning the answer result to the user side;
after receiving the reply result returned by the user side, before correcting the original question sentence based on the reply result, the method further comprises the following steps:
Inputting the reply result returned by the user terminal into the clarification model;
identifying the reply result based on the clarification model to obtain an identification result; the identification result at least comprises an entity sub-result;
correcting the original question sentence based on the entity sub-result in the reply result;
The step of correcting the original question sentence based on the reply result to obtain a clear question sentence, comprising:
Correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clarifying sub question sentence are ambiguous or not based on the clarifying model;
If the statement ambiguity exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
receiving a reply result returned by the user side, and correcting an original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences have no ambiguity.
Optionally, the inputting the original question sentence into a clarification model to obtain a sentence ambiguity result includes:
splitting the original question sentence to obtain a plurality of question phrases;
Inquiring historical data corresponding to each question phrase based on the clarification model to obtain an inquiry result;
And judging whether each question phrase in the original question sentence has ambiguity according to the query result, and obtaining the sentence ambiguity result.
Optionally, the determining whether each question phrase in the original question sentence has ambiguity according to the query result, to obtain the sentence ambiguity result includes:
if the questioning phrase is ambiguous, the clarification model generates the sentence ambiguity result for determining whether the questioning phrase is matched with the historical data.
Optionally, the determining the matching process of the question phrase and the historical data includes:
Determining whether the front and rear sentences of the question phrase adjacent to the original question sentence are matched; or alternatively, the first and second heat exchangers may be,
Determining whether the technical fields of the questioning phrase and the original questioning sentence in the historical data are matched; or alternatively, the first and second heat exchangers may be,
Determining whether the context analysis of the question phrase matches the context analysis of the related information in the history data.
Optionally, the training process of the clarification model further includes:
the single-round dialog data set in the history data is expanded into a multi-round dialog data set based on a data enhancement algorithm.
The second aspect of the present application provides an intelligent clarification question sentence generating device, comprising:
The detection module is used for receiving an original question sentence input by a user side;
The to-be-clarified question sentence generation module is used for inputting the original question sentence into a clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for eliminating ambiguity based on the question sentence when the ambiguity exists in the semantic meaning of the question sentence; sending the statement ambiguity result to the user side;
the correction module is used for receiving a reply result returned by the user side; correcting the original question sentence based on the reply result to obtain a clear question sentence; obtaining an answer result based on the clear question sentence, and returning the answer result to the user side;
after receiving the reply result returned by the user side, before correcting the original question sentence based on the reply result, the method further comprises the following steps:
Inputting the reply result returned by the user terminal into the clarification model;
identifying the reply result based on the clarification model to obtain an identification result; the identification result at least comprises an entity sub-result;
correcting the original question sentence based on the entity sub-result in the reply result;
The step of correcting the original question sentence based on the reply result to obtain a clear question sentence, comprising:
Correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clarifying sub question sentence are ambiguous or not based on the clarifying model;
If the statement ambiguity exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
receiving a reply result returned by the user side, and correcting an original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences have no ambiguity.
A third aspect of the present application provides an electronic apparatus, comprising:
A processor; and
A memory having executable code stored thereon which, when executed by the processor, causes the processor to perform the method as described above.
A fourth aspect of the application provides a non-transitory machine-readable storage medium having stored thereon executable code which, when executed by a processor of an electronic device, causes the processor to perform a method as described above.
Therefore, the intelligent clear question sentence generating method provided by the application comprises the steps of firstly receiving an original question sentence input by a user side, inputting the original question sentence into a clear model to obtain a sentence ambiguity result, generating a question sentence to be cleared for disambiguation based on the question sentence when detecting that the meaning of the question sentence is ambiguous, then sending the sentence ambiguity result to the user side, receiving a reply result returned by the user side, correcting the original question sentence based on the reply result to obtain a clear question sentence, finally obtaining an answer result based on the clear question sentence, returning the answer result to the user side, and sending the sentence ambiguity result to the user side when the meaning of the original question sentence input by the user side is ambiguous by detecting whether the meaning of the original question sentence exists or not through the clear model, and when the meaning ambiguity result of the sentence is ambiguous, revising the original question sentence by the user side according to the reply result, so that the newly generated clear question sentence disambiguates the meaning existing in the original question sentence, and the accuracy of an intelligent question system is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular descriptions of exemplary embodiments of the application as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout the exemplary embodiments of the application.
FIG. 1 is a flow chart of an intelligent clarification question sentence generating method according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of clarification model entity identification in intelligent question and answer according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a clear question generation device in an intelligent question and answer according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the application. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The embodiment of the application can be applied to an intelligent question-answering system based on an artificial intelligence technology, in particular to a dialogue scene of a user side initiating a question. In the embodiment of the application, the intelligent question-answering system can simulate the thinking and understanding ability of human beings so as to understand and answer the questions presented by the user side in natural language. Intelligent question-answering systems may generally employ natural language processing (Natural Language Processing), machine learning (MACHINE LEARNING), deep learning, etc. techniques for understanding and generating text.
In the actual use process, in order to ensure that the intelligent question-answering system provides accurate answers, firstly, the questions and the intentions which are put forward by the user end need to be understood, and complex language structure processing and understanding of the context of the current sentence by combining historical data can be included. Based on the above, the embodiment of the application provides a method, a device, equipment and a medium for generating intelligent clear question sentences, which are used for solving the problem that semantic ambiguity, knowledge ambiguity and other semantic ambiguity possibly exist in sentences of a dialogue input by a user and improving the accuracy of answers of an intelligent question-answering system.
Embodiments of the present application are described in detail below.
Referring to fig. 1, fig. 1 is a flow chart illustrating a method for generating an intelligent clarifying question sentence according to an embodiment of the present application.
The application discloses an intelligent clarification question sentence generation method, which comprises the following steps:
S10, receiving an original question sentence input by a user terminal;
In the embodiment of the application, the execution subject can be an intelligent question-answering system or can be applied to the front ends of other question-answering systems, and the intelligent question-answering system can support multi-mode input including characters, voice, images and the like, so that a user side can ask questions in various modes without excessive limitation.
In the embodiment of the application, the original question sentences are question sentences which are input by the user side and are not processed by the intelligent question-answering system, namely, each question sentence of the user side is taken as the original question sentences, wherein the original question sentences can be question sentences or question texts input by the user side, and the question sentences can be expressed in a natural language form.
S20, inputting the original question sentence into a clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for disambiguation based on the question sentence when detecting that the semantics of the question sentence are ambiguous;
in an embodiment of the present application, the clarification model may be a machine learning model, such as a Support Vector Machine (SVM), a Recurrent Neural Network (RNN), a BERT model in a pre-training model, and the like. The original question sentences input by the user side are input into a clarification model, the clarification model can detect the original question sentences through natural language processing, and ambiguous or ambiguous sentences possibly existing in the original question sentences are determined according to detection results.
In application, first the semantic ambiguity in the original question sentence may manifest as ambiguity of the phrase, ambiguity of the grammar structure, or ambiguity of the context. Extracting relevant semantic features from the original question sentence before the clarification model detects ambiguity, including: phrase, grammar, and context information. The extracted semantic features are then represented in a form that the clarification model can handle, such as a vector or matrix. The text sequence of the original question sentence may be embedded in a high-dimensional space so that the clarification model can learn information about the semantic strong associations to which the original question sentence relates. When the clarification model detects that the original question sentence has semantic ambiguity, a question sentence to be clarified is generated based on understanding of the clarification model.
It can be seen that the original question sentences are processed through the clarification model, so that the understanding of the intelligent question-answering system on the intention of the user and the capability of accurately answering the question sentences are improved.
In the embodiment of the application, the semantic ambiguity result can comprise a question sentence to be clarified, the question sentence to be clarified can be a question sentence regenerated aiming at an ambiguous sentence or phrase existing in an original question sentence, for example, the phrase "A" appears in the original question sentence as an ambiguous word, whether the phrase "A belongs to the technical field B" can be used as the question sentence to be clarified, and the specific meaning of the phrase "A" is determined based on the technical field to which the phrase "A" belongs; and can also include modifying, adding or deleting some vocabulary question sentences of the original question sentences, and remarking comment sentences.
S30, sending the sentence ambiguity result to a user side;
In the embodiment of the application, the sentence ambiguity result is sent to the interactive interface between the user side and the intelligent question-answering system, and is displayed on the interactive interface in a text mode.
In the embodiment of the application, the user can reply the question to be clarified in the sentence ambiguity result through the interactive interface. Which may include interpretation of the question sentence to be clarified, adding additional information, or correcting the original question sentence.
S40, receiving a reply result returned by the user terminal;
S50, correcting the original question sentence based on the reply result to obtain a clear question sentence;
it can be understood that the reply result returned by the receiving user end and the to-be-clarified question sentence of the original question sentence can be a single-round dialogue process or a multi-round dialogue process.
In the embodiment of the application, the intelligent question-answering system corrects the original question sentence according to the reply result returned by the user side, and the correction process can comprise grammar correction and description of adding part of phrase.
In an application, for example, the original question sentence is "how is the weather at today's a site? The intelligent question-answering system judges that the sentences in the original question sentences are not ambiguous, the preliminary answer is weather of the land A today, and the temperature is 22 ℃. "in the second round of session, the user's original question sentence is" is rainy? The clarification model detects that the original question sentence has ambiguity, the original question sentence is analyzed, and the sentence ambiguity result comprises: the user expresses a concern about rain, judges that the user may have a question about weather conditions in rainy days not mentioned in the preliminary answer, and generates a question sentence to be clarified as "do you want to know whether there is rain today? When the reply result of the user side is yes, the original question sentence is updated, and the clear question sentence is obtained as' whether the site A has rain today? ", re-acquire the weather information of the A place and answer the clear question statement.
S60, obtaining an answer result based on the clear question sentence, and returning the answer result to the user side.
It can be seen that, first, receiving the original question sentence input by the user terminal, inputting the original question sentence into the clarification model to obtain a sentence ambiguity result, when detecting that the meaning of the question sentence is ambiguous, the clarification model is used for generating a question sentence to be clarified for disambiguation based on the question sentence, then sending the sentence ambiguity result to the user terminal, receiving the reply result returned by the user terminal, correcting the original question sentence based on the reply result to obtain a clarification question sentence, finally obtaining the reply result based on the clarification question sentence, returning the reply result to the user terminal, and when the sentence ambiguity result is ambiguous, sending the sentence ambiguity result to the user terminal, returning the reply result to the user terminal, revising the original question sentence according to the reply result, the newly generated clarification question sentence eliminates the meaning ambiguity existing in the original question sentence, and improves the accuracy of the intelligent question-and-answer system.
The foregoing embodiment describes a process of detecting an original question sentence using a clarification model, and the process is described in detail below.
In the embodiment of the application, the step of inputting the original question sentence into a clarification model to obtain a sentence ambiguity result comprises the following steps:
S100, splitting an original question sentence to obtain a plurality of question phrases;
in the embodiment of the application, the splitting process can be to split the original question sentence, and the word splitting is to split the continuous text sequence into meaningful units, for example, split the text sequence into phrases or sub-words.
In the embodiment of the application, preset word segmentation rules can be given to the clarification model, and the text is split into a plurality of meaningful phrase units by utilizing the preset splitting rules, for example, the longest matching phrase can be found from left to right or from right to left by using rules such as forward maximum matching or reverse maximum matching.
Statistical models may also be trained using large amounts of text data, and new text may be segmented using statistical models, such as common statistical models like Hidden Markov Models (HMMs) and Conditional Random Fields (CRFs).
S101, inquiring historical data corresponding to each question phrase based on the clarification model to obtain an inquiry result.
In the embodiment of the application, the historical data can comprise records of previous user questions, answer histories of the system or other related information, and can also be related information which appears in other dialogue scenes based on corresponding queries in the database.
S102, judging whether each question phrase in the original question sentence has ambiguity according to the query result, and obtaining the sentence ambiguity result.
In the embodiment of the application, for each question phrase, the clarification model obtains the query result through the query history data or other related data sources, and whether related information with different meanings exists in the query history data according to the query result.
It will be appreciated that the ambiguity determination rules of the clarification model may include determining ambiguity based on context, word sense, grammar structure, etc.
In addition, in order to ensure that ambiguity judgment rules of the clarification model can accurately judge ambiguity of an original question sentence, in the training process of the clarification model, semantic ambiguity in the question sentence is identified through learning patterns in training data, the performance of the clarification model is evaluated on an independent verification set, and the generalization capability of the clarification model on the question sentence which is not seen is checked. The method is beneficial to determining whether the clarification model can effectively detect the semantic ambiguity of the question sentence, and after training and verification, the clarification model can be deployed into an intelligent question-answering system to process the question sentence of the user.
In the application, for example, what is the price of "B" the original question sentence input by the user side? The method includes the steps that a split question phrase is 'B, price', based on a clarification model, historical data of the user is inquired, the price of the user is found, meanwhile, a commodity information database is searched, a historical record of the price of the user is obtained, current commodity information is obtained, based on clarification model, the historical data are analyzed, the fact that 'B' in the question of the user possibly refers to fruits and possibly also to companies is obtained, therefore, based on the historical data judgment of the question phrase, the original question sentence still has semantic ambiguity, therefore, the intention of the user needs to be clarified further, and the sentence ambiguity result generated by the clarification model is used for indicating the ambiguity of 'B' in the original question sentence.
In the embodiment of the present application, the determining whether each question phrase in the original question sentence has ambiguity according to the query result, to obtain the sentence ambiguity result includes:
if the questioning phrase is ambiguous, the clarification model generates the sentence ambiguity result for determining whether the questioning phrase is matched with the historical data.
In the embodiment of the present application, the determining the matching process of the question phrase and the history data includes:
S1020, determining whether the front and rear sentences of the question phrase adjacent to the original question sentence are matched; or alternatively, the first and second heat exchangers may be,
In the embodiment of the application, when judging whether the question phrase is matched with the historical data, the context association relationship of the question phrase in the original question sentence is considered, wherein the context association relationship of the original question sentence can comprise other related phrases of the sentences before and after the original question sentence and association relationships of other original question sentences of the user.
On the basis of the above embodiment, for example, what is the price for the original question sentence "B? If the historical data contains relevant product information of a company, and the content of the fruit appears in the context of the original question sentence, the clarification model judges that the original question sentence has ambiguity.
S1021, determining whether the question phrase is matched with the technical field of the original question sentence in the historical data; or alternatively, the first and second heat exchangers may be,
In the embodiment of the application, the technical field can comprise terms or keywords of a specific industry, a specific technical field or a theme, and the like in consideration of the matching property of the question phrase in the technical field.
In an application, for example, what are there are "artificial intelligence applications" to the original question sentence? If the history data comprises technical field information related to the artificial intelligence, the clarification model determines that the question phrase is matched with the history data.
S1022, determining whether the context analysis of the question phrase is matched with the context analysis of the related information in the historical data.
In the embodiment of the application, the matching relation of the question phrases in the context analysis is considered, namely, the meaning of the question phrases is ensured to be understood in different contexts.
On the basis of the above embodiment, for example, the original question sentence is "who is the creator of B? The split question phrase is "B, creator", but the history data contains relevant information about fruit "B" and science and technology company "B".
Thus, in the context analysis matching based decision process, if the information in the history data covers the history, development, creator, etc. of the company "B", and the context is clearly directed to the relevant information of the science and technology company, the context analysis matching determines that the question phrase is directed to the conclusion that "B" is the creator of the company.
The foregoing embodiment describes a clarification model and algorithm, in which, through training of the clarification model, a parameter tuning method and the like, an original question sentence with fuzzy user intention and semantic ambiguity is generated to generate a question sentence to be clarified, and the original question sentence is revised according to a reply result returned by the user side, where, in order to further eliminate the semantic ambiguity in the original question sentence, the embodiment can improve the utilization rate of the reply result returned by the user side, and the following details are described:
Fig. 2 is a schematic flow chart of clarification model entity identification in intelligent question and answer according to an embodiment of the present application.
Referring to fig. 2, in the embodiment of the present application, after receiving a reply result returned by the user terminal, before correcting an original question sentence based on the reply result, the method further includes:
and inputting the reply result returned by the user terminal into the clarification model.
Identifying the reply result based on the clarification model to obtain an identification result; the recognition result includes at least one entity sub-result.
The original question sentence is revised based on the entity sub-result in the reply result.
In the embodiment of the application, after the user interacts with the intelligent question-answering system, a reply result returned by the user to-be-clarified question sentence is input into the clarification model. The clarification model is used for further understanding the reply result replied by the user, and extracting effective information in the reply result of the user for further analysis.
In the embodiment of the application, the reply result is identified based on the clarification model, and the key entity sub-result is extracted from the reply result returned by the user side. The recognition result may include an entity sub-result and a predicate sub-result. Entity recognition and predicate recognition are two relevant recognition methods in natural language processing, and are used for extracting related entities and predicate information with relevant relations with the entities from reply results.
It can be appreciated that the entity recognition of the reply result by the clarification model yields an entity sub-result. Entity recognition refers to the classification and extraction of entities of particular significance from the reply results, and may generally include named entities, such as: name of person, place name, organization or time, etc. The clarification model marks the location of the relevant entity in the reply result through entity identification, and each entity is not assigned the correct identification type. The entity sub-results facilitate understanding of the key concepts and specific physical things mentioned in the reply results.
And performing predicate identification on the reply result by the clarification model to obtain a predicate sub-result. Predicate identification refers to extracting information with a correlation with an entity from a reply result, and can be also understood as a relation extraction process. The clarification model marks information, such as verbs, adjectives, and the like, which have a relevant relation with the entity in the reply result through predicate identification. The predicate sub-result is helpful for constructing a knowledge graph or understanding the association relationship between entities in the reply result.
Therefore, the clarification model is used for identifying the reply result returned by the user side, so that the intelligent question-answering system can understand the reply intention of the user, and a more accurate and targeted reply or correction mode can be made on the basis. Through clarification model and entity recognition and predicate recognition, the intelligent question-answering system can be better adapted to the expression mode of the user, and the understanding accuracy of the intention of the user is improved.
The foregoing embodiment describes that the intelligent question-answering system performs a single round of clarification question and corrects the original question sentence according to the reply result replied by the user in the session process with the user, and the following describes the multi-round session process.
In the embodiment of the application, the original question sentence is corrected based on the reply result to obtain a clear question sentence, which comprises the following steps:
correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clear sub question statement are ambiguous or not based on the clear model;
If the statement ambiguity result exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
Receiving a reply result returned by the user side, and correcting the original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences are not ambiguous.
In the embodiment of the application, the original question sentence is corrected according to the reply result returned by the user side, the corrected original question sentence is used as a clarifying sub-question sentence, and the clarifying sub-question sentence is input into a clarifying model for judging whether ambiguity exists in the semanteme of the clarifying sub-question sentence. If the clear sub-question sentence has semantic ambiguity, the clear model outputs an ambiguity result of the clear sub-question sentence and sends the ambiguity result to the user side. And then, the original question sentence is revised again according to the reply result replied by the user section to form a new clear sub question sentence.
It can be appreciated that the clarification process can be performed in multiple rounds, the reply result provided by each round of users is used for correcting the original question sentence, the iteration is circulated until the semantics of the clarified sub-question sentence are no longer ambiguous, and the clarified sub-question sentence without semantic ambiguity is used as the clarified question sentence.
During the multi-round session, the clarification process can enable the intelligent question-answering system to more deeply understand the requirements of users and gradually eliminate semantic ambiguity caused by the ambiguity of natural language. By constantly interacting with the user, the intelligent question-answering system can refine the original question sentences of the user, improve understanding of the user's intention, and provide more accurate and satisfactory answers.
In the embodiment of the application, the training process of the clarification model further comprises the following steps:
the single-round dialog data set in the history data is expanded into a multi-round dialog data set based on a data enhancement algorithm.
In the embodiment of the application, in the training process of the clarification model, based on the problem of limited historical data sets, more session data are generated by adopting a data enhancement technology, and the quantity of the training data is expanded, so that the clarification model obtains more semantic feature information.
In the embodiment of the application, the text translated into a multilingual form can be used as a data set together with the original text, so that the aim of enhancing the text semantic information can be fulfilled.
Text semantic information can also be enhanced by expanding a single-round conversation into a multi-round conversation form through a text generation model in the original single-round conversation data set.
On the basis of the above embodiment, regarding the problem of text extraction summary, the original dataset contains too long text, typically even over 2000 characters. The maximum character length set by a clarification model, such as a BERT pre-training model or a transducer model, is defined as 512, and sentences exceeding 512 lengths are commonly cut off. But the cut text will also lose a large piece of text information. Therefore, text compression is performed by adopting a text abstract extraction mode, redundant information is removed from a large text, and the most useful language information of the text is extracted, so that a text with a few thousand words can be extracted into a text with a few hundred words.
Corresponding to the embodiment of the application function implementation method, the application also provides a clear question generation device in the intelligent question and answer, and corresponding embodiments of the vehicle and the medium.
Fig. 3 is a schematic diagram of a clear question generation device in an intelligent question and answer according to an embodiment of the present application.
Referring to fig. 3, comprising:
the detection module 31 is configured to receive an original question sentence input by a user terminal;
The to-be-clarified question sentence generation module 32 is configured to input an original question sentence into the clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for disambiguation based on the question sentence when detecting that the semantics of the question sentence are ambiguous; sending the sentence ambiguity result to the user side;
The correction module 33 is configured to receive a reply result returned by the user terminal; correcting the original question sentence based on the reply result to obtain a clear question sentence; and obtaining an answer result based on the clear question sentence, and returning the answer result to the user side.
The to-be-clarified question sentence generation module 32 is configured to:
Splitting the original question sentence to obtain a plurality of question phrases;
inquiring historical data corresponding to each question phrase based on the clarification model to obtain an inquiry result;
And judging whether each question phrase in the original question sentence has ambiguity according to the query result, and obtaining the sentence ambiguity result.
In some embodiments, determining whether each question phrase in the original question sentence has ambiguity according to the query result, to obtain a sentence ambiguity result includes:
If the questioning phrase is ambiguous, the clarification model generates sentence ambiguity results for determining whether the questioning phrase is matched with the historical data.
In some embodiments, determining a matching process of the question phrase with the historical data includes:
determining whether the front and rear sentences of the question phrase adjacent to the original question sentence are matched; or alternatively, the first and second heat exchangers may be,
Determining whether the technical fields of the question phrase and the original question sentence in the history data are matched; or alternatively, the first and second heat exchangers may be,
It is determined whether the context analysis of the question phrase matches the context analysis of the related information in the history data.
In some embodiments, after receiving the reply result returned by the user side, before correcting the original question sentence based on the reply result, the method further includes:
inputting a reply result returned by the user side into a clarification model;
identifying the reply result based on the clarification model to obtain an identification result; the identification result at least comprises an entity sub-result;
the original question sentence is revised based on the entity sub-result in the reply result.
Optionally, correcting the original question sentence based on the reply result to obtain a clear question sentence, including:
correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clear sub question statement are ambiguous or not based on the clear model;
If the statement ambiguity result exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
Receiving a reply result returned by the user side, and correcting the original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences are not ambiguous.
Optionally, the training process of the clarification model further comprises:
the single-round dialog data set in the history data is expanded into a multi-round dialog data set based on a data enhancement algorithm.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and the electronic device 500 includes a memory 510 and a processor 520.
The Processor 520 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 510 may include various types of storage units, such as system memory, read Only Memory (ROM), and persistent storage. Where the ROM may store static data or instructions that are required by the processor 520 or other modules of the computer. The persistent storage may be a readable and writable storage. The persistent storage may be a non-volatile memory device that does not lose stored instructions and data even after the computer is powered down. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the persistent storage may be a removable storage device (e.g., diskette, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as dynamic random access memory. The system memory may store instructions and data that are required by some or all of the processors at runtime. Furthermore, memory 510 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks, and/or optical disks may also be employed. In some embodiments, memory 510 may include a readable and/or writable removable storage device such as a Compact Disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual layer DVD-ROM), a read-only blu-ray disc, an ultra-dense disc, a flash memory card (e.g., SD card, min SD card, micro-SD card, etc.), a magnetic floppy disk, and the like. The computer readable storage medium does not contain a carrier wave or an instantaneous electronic signal transmitted by wireless or wired transmission.
The memory 510 has stored thereon executable code that, when processed by the processor 520, causes the processor 520 to perform some or all of the methods described above.
The aspects of the present application have been described in detail hereinabove with reference to the accompanying drawings. In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments. Those skilled in the art will also appreciate that the acts and modules referred to in the specification are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application may be sequentially adjusted, combined and pruned according to actual needs, and the modules in the device of the embodiment of the present application may be combined, divided and pruned according to actual needs.
Furthermore, the method according to the application may also be implemented as a computer program or computer program product comprising computer program code instructions for performing part or all of the steps of the above-described method of the application.
Or the application may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) that, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform some or all of the steps of a method according to the application as described above.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present application. 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 foregoing description of embodiments of the application has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (8)
1. The intelligent clarification question sentence generation method is characterized by comprising the following steps:
receiving an original question sentence input by a user terminal;
Inputting the original question sentence into a clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for eliminating ambiguity based on the question sentence when the ambiguity exists in the semantic meaning of the question sentence;
sending the statement ambiguity result to the user side;
receiving a reply result returned by the user side;
correcting the original question sentence based on the reply result to obtain a clear question sentence;
obtaining an answer result based on the clear question sentence, and returning the answer result to the user side;
after receiving the reply result returned by the user side, before correcting the original question sentence based on the reply result, the method further comprises the following steps:
Inputting the reply result returned by the user terminal into the clarification model;
identifying the reply result based on the clarification model to obtain an identification result; the identification result at least comprises an entity sub-result;
correcting the original question sentence based on the entity sub-result in the reply result;
The step of correcting the original question sentence based on the reply result to obtain a clear question sentence, comprising:
Correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clarifying sub question sentence are ambiguous or not based on the clarifying model;
If the statement ambiguity exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
receiving a reply result returned by the user side, and correcting an original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences have no ambiguity.
2. The method of claim 1, wherein said inputting the original question sentence into a clarification model results in a sentence ambiguity result, comprising:
splitting the original question sentence to obtain a plurality of question phrases;
Inquiring historical data corresponding to each question phrase based on the clarification model to obtain an inquiry result;
And judging whether each question phrase in the original question sentence has ambiguity according to the query result, and obtaining the sentence ambiguity result.
3. The method of claim 2, wherein said determining whether each of the question phrases in the original question sentence is ambiguous based on the query results, resulting in the sentence ambiguity results, comprises:
if the questioning phrase is ambiguous, the clarification model generates the sentence ambiguity result for determining whether the questioning phrase is matched with the historical data.
4. The method of claim 3, wherein said determining that the question phrase matches the historical data comprises:
Determining whether the front and rear sentences of the question phrase adjacent to the original question sentence are matched; or alternatively, the first and second heat exchangers may be,
Determining whether the technical fields of the questioning phrase and the original questioning sentence in the historical data are matched; or alternatively, the first and second heat exchangers may be,
Determining whether the context analysis of the question phrase matches the context analysis of the related information in the history data.
5. The method of claim 1, wherein the training process of the clarification model further comprises:
the single-round dialog data set in the history data is expanded into a multi-round dialog data set based on a data enhancement algorithm.
6. Intelligent clarification question sentence generation device, its characterized in that includes:
The detection module is used for receiving an original question sentence input by a user side;
The to-be-clarified question sentence generation module is used for inputting the original question sentence into a clarification model to obtain a sentence ambiguity result; the clarification model is used for generating a question sentence to be clarified for eliminating ambiguity based on the question sentence when the ambiguity exists in the semantic meaning of the question sentence; sending the statement ambiguity result to the user side;
the correction module is used for receiving a reply result returned by the user side; correcting the original question sentence based on the reply result to obtain a clear question sentence; obtaining an answer result based on the clear question sentence, and returning the answer result to the user side;
after receiving the reply result returned by the user side, before correcting the original question sentence based on the reply result, the method further comprises the following steps:
Inputting the reply result returned by the user terminal into the clarification model;
identifying the reply result based on the clarification model to obtain an identification result; the identification result at least comprises an entity sub-result;
correcting the original question sentence based on the entity sub-result in the reply result;
The step of correcting the original question sentence based on the reply result to obtain a clear question sentence, comprising:
Correcting the original question sentence based on the reply result to obtain a clear sub question sentence;
judging whether the semantics of the clarifying sub question sentence are ambiguous or not based on the clarifying model;
If the statement ambiguity exists, the clarification model outputs the statement ambiguity result and sends the statement ambiguity result to the user side;
receiving a reply result returned by the user side, and correcting an original question sentence based on the reply result to obtain a current clear sub question sentence;
and taking the clear sub-question sentences as clear question sentences until the sentences of the clear sub-question sentences have no ambiguity.
7. An electronic device, comprising:
A processor; and
A memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-5.
8. A computer readable storage medium having stored thereon executable code which when executed by a processor of an electronic device causes the processor to perform the method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410444686.7A CN118051603A (en) | 2024-04-15 | 2024-04-15 | Intelligent clarification question sentence generation method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410444686.7A CN118051603A (en) | 2024-04-15 | 2024-04-15 | Intelligent clarification question sentence generation method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118051603A true CN118051603A (en) | 2024-05-17 |
Family
ID=91054019
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410444686.7A Pending CN118051603A (en) | 2024-04-15 | 2024-04-15 | Intelligent clarification question sentence generation method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118051603A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111737441A (en) * | 2020-08-07 | 2020-10-02 | 北京百度网讯科技有限公司 | Human-computer interaction method, device and medium based on neural network |
CN112214589A (en) * | 2020-10-19 | 2021-01-12 | 焦点科技股份有限公司 | Method for multi-round session framework based on cold start |
CN112287090A (en) * | 2020-11-23 | 2021-01-29 | 深圳季连科技有限公司 | Financial question asking back method and system based on knowledge graph |
US20230095180A1 (en) * | 2021-09-29 | 2023-03-30 | International Business Machines Corporation | Question answering information completion using machine reading comprehension-based process |
-
2024
- 2024-04-15 CN CN202410444686.7A patent/CN118051603A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111737441A (en) * | 2020-08-07 | 2020-10-02 | 北京百度网讯科技有限公司 | Human-computer interaction method, device and medium based on neural network |
US20210234814A1 (en) * | 2020-08-07 | 2021-07-29 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Human-machine interaction |
CN112214589A (en) * | 2020-10-19 | 2021-01-12 | 焦点科技股份有限公司 | Method for multi-round session framework based on cold start |
CN112287090A (en) * | 2020-11-23 | 2021-01-29 | 深圳季连科技有限公司 | Financial question asking back method and system based on knowledge graph |
US20230095180A1 (en) * | 2021-09-29 | 2023-03-30 | International Business Machines Corporation | Question answering information completion using machine reading comprehension-based process |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109885660B (en) | Knowledge graph energizing question-answering system and method based on information retrieval | |
US9792280B2 (en) | Context based synonym filtering for natural language processing systems | |
CN108763510B (en) | Intention recognition method, device, equipment and storage medium | |
CN110349568B (en) | Voice retrieval method, device, computer equipment and storage medium | |
US10671929B2 (en) | Question correction and evaluation mechanism for a question answering system | |
US10713438B2 (en) | Determining off-topic questions in a question answering system using probabilistic language models | |
CN111078837B (en) | Intelligent question-answering information processing method, electronic equipment and computer readable storage medium | |
CN111177359A (en) | Multi-turn dialogue method and device | |
US20220343082A1 (en) | System and method for ensemble question answering | |
CN109271524B (en) | Entity linking method in knowledge base question-answering system | |
CN111460115A (en) | Intelligent man-machine conversation model training method, model training device and electronic equipment | |
CN110096572B (en) | Sample generation method, device and computer readable medium | |
US11526512B1 (en) | Rewriting queries | |
CN113282711B (en) | Internet of vehicles text matching method and device, electronic equipment and storage medium | |
CN113849623B (en) | Text visual question-answering method and device | |
CN113705196A (en) | Chinese open information extraction method and device based on graph neural network | |
CN113064985A (en) | Man-machine conversation method, electronic device and storage medium | |
CN117648429A (en) | Question-answering method and system based on multi-mode self-adaptive search type enhanced large model | |
Schaback et al. | Multi-level feature extraction for spelling correction | |
CN109684357B (en) | Information processing method and device, storage medium and terminal | |
CN118051603A (en) | Intelligent clarification question sentence generation method, device, equipment and medium | |
CN114118080B (en) | Method and system for automatically identifying client intention from sales session | |
CN116304046A (en) | Dialogue data processing method and device, storage medium and electronic equipment | |
CN115658845A (en) | Intelligent question-answering method and device suitable for open-source software supply chain | |
CN115203206A (en) | Data content searching method and device, computer equipment and 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 |