CN116662555A - Request text processing method and device, electronic equipment and storage medium - Google Patents
Request text processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116662555A CN116662555A CN202310935962.5A CN202310935962A CN116662555A CN 116662555 A CN116662555 A CN 116662555A CN 202310935962 A CN202310935962 A CN 202310935962A CN 116662555 A CN116662555 A CN 116662555A
- Authority
- CN
- China
- Prior art keywords
- intention
- probability
- request text
- category
- confidence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title abstract description 5
- 238000013145 classification model Methods 0.000 claims abstract description 37
- 238000000034 method Methods 0.000 claims abstract description 35
- 238000012545 processing Methods 0.000 claims abstract description 23
- 238000011156 evaluation Methods 0.000 claims description 34
- 238000012549 training Methods 0.000 claims description 30
- 230000006870 function Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 17
- 230000004044 response Effects 0.000 claims description 12
- 230000003993 interaction Effects 0.000 claims description 7
- 238000012805 post-processing Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000000670 limiting effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 230000002829 reductive effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
- G06F40/35—Discourse or dialogue representation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Probability & Statistics with Applications (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Machine Translation (AREA)
Abstract
The application provides a request text processing method, a request text processing device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a request text of a user, inputting the request text into a trained intention classification model, and acquiring the probability of the request text in each intention category; comparing the probabilities of the request text in each intention category to obtain the probability of the request text in the intention category with the highest probability; comparing the probability of the request text in the maximum probability intention category with the first confidence coefficient and the second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient is larger than the second confidence coefficient; and processing the request text with fuzzy semantics of the user according to the comparison result to obtain the request text with explicit semantics, thereby improving the accuracy of the intention recognition of the request text.
Description
Technical Field
The present application relates to the field of natural language processing technologies, and in particular, to a method and apparatus for processing a request text, an electronic device, and a storage medium.
Background
As smart devices and smart voice assistants become popular, interactions between users and these devices become more frequent. During these interactions, it becomes critical to accurately identify the intent in the natural language text entered by the user. Existing intent recognition techniques are typically implemented based on text intent classification and intent slot filling. Text intent classification aims at classifying a given text into predefined intent categories with the goal of understanding the intent or purpose conveyed by the text so that the system can respond accordingly or perform a corresponding operation. Slot filling refers to extracting key information from text and filling it into a specific slot. The slots represent parameters or variables that are relevant to a particular intent. By slot filling, the system can better understand the intent and needs of the user, thereby providing a more accurate response or performing the corresponding operation.
However, text intent classification works well when processing clear, accurate text, but the intent tag probability value inferred by the intent classification model is reduced when there is some erroneous or ambiguous text in the face of system input.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method, an apparatus, an electronic device, and a computer readable storage medium for processing a request text, so as to solve the problem in the prior art that the accuracy of identifying the intention of the request text is low.
In a first aspect of an embodiment of the present application, a method for processing a request text is provided, including: acquiring a request text of a user, inputting the request text into a trained intention classification model, and acquiring the probability of the request text in each intention category, wherein the probability of the request text in each intention category is acquired; comparing the probabilities of the request text in each intention category to obtain the probability of the request text in the intention category with the highest probability; comparing the probability of the request text in the maximum probability intention category with a preset first confidence coefficient and a preset second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient is larger than the second confidence coefficient; according to a comparison result, if the probability of the request text in the maximum probability intention category is smaller than the first confidence coefficient and larger than or equal to the second confidence coefficient, acquiring an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient.
In a second aspect of an embodiment of the present application, there is provided a request text processing apparatus, including: the intention classification module is configured to acquire a request text of a user, input the request text into a trained intention classification model, and acquire the probability of the request text in each intention category; the maximum probability determining module is configured to compare probabilities of the request text in the intention categories and obtain probabilities of the request text in the intention categories with the maximum probability; the probability comparison module is configured to compare the probability of the request text in the maximum probability intention category with a preset first confidence coefficient and a preset second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient is larger than the second confidence coefficient; the intention execution module is configured to obtain an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs if the probability of the request text in the maximum probability intention category is smaller than the first confidence degree and larger than or equal to the second confidence degree according to a comparison result; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient.
In a third aspect of the embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
In a fourth aspect of the embodiments of the present application, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
Compared with the prior art, the embodiment of the application has the beneficial effects that: according to the embodiment of the application, the request text of the user is acquired, the request text is input into the intention classification model with training completed, and the probability of the request text in each intention class is acquired; comparing the probabilities of the request text in each intention category to obtain the probability of the request text in the intention category with the highest probability; comparing the probability of the request text in the maximum probability intention category with a preset first confidence coefficient and a preset second confidence coefficient to obtain a comparison result; according to a comparison result, processing a request text of a user, and if the probability of the request text in the maximum probability intention category is smaller than the first confidence coefficient and larger than or equal to the second confidence coefficient, obtaining an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient. Aiming at the request text with fuzzy intention, the embodiment of the application provides that the original request text with fuzzy intention is corrected into the request text with definite meaning through interaction of semantic guidance, so that accurate user intention is obtained, further, intention response which is more fit with the real requirement of the user is executed, and more humanized user experience is brought.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for processing a request text according to an embodiment of the present application;
FIG. 2 is a flow chart of another method for processing request text according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a request text processing device 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
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
A request text processing method and apparatus according to embodiments of the present application will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flow chart of a method for processing a request text according to an embodiment of the present application. As shown in fig. 1, the request text processing method includes:
s101, acquiring a request text of a user, and inputting the request text into an intention classification model after training is completed to acquire the probability of the request text in each intention category, wherein the intention classification model is obtained by training according to a model training corpus;
s102, comparing probabilities of the request text in each intention category to obtain probabilities of the request text in the intention category with the maximum probability;
s103, comparing the probability of the request text in the maximum probability intention category with a first confidence coefficient and a second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient and the second confidence coefficient are obtained by classifying and predicting a model evaluation corpus according to an intention classification model, the first confidence coefficient is larger than the second confidence coefficient, and the model evaluation corpus and a model training corpus are obtained by randomly dividing the acquired text corpus;
s104, processing the request text of the user according to the comparison result.
Illustratively, the request text of the user is processed according to the comparison result, for example, the comparison result comprises three types, and the first type is that the probability of the request text in the maximum probability intention category is greater than or equal to the first confidence degree; the second is that the probability of the request text in the maximum probability intention category is smaller than the first confidence and larger than or equal to the second confidence; the third is that the probability of the request text in the most probable intent category is less than the second confidence. When the first situation occurs, the intention recognition of the request text is specified clearly, so that the intention recognition output can be directly carried out on the request text; when the second situation occurs, the intention recognition of the request text is ambiguous, and semantic guidance is needed for the user to obtain the request text with more explicit intention recognition; when the third situation occurs, it is explained that the intention recognition of the request text at this time is extremely easy to be wrong, and thus the execution of the content of the request text can be refused.
The method and the device can be applied to analyzing the request text input by the user and identifying the requirements and the targets of the user from the request text of the user. The method comprises the steps of obtaining a request text of a user, inputting the request text into an intention classification model after training, and obtaining the probability of the request text in each intention category, wherein the intention classification model is obtained by training according to a model training corpus; comparing the probabilities of the request text in each intention category to obtain the probability of the request text in the intention category with the highest probability; comparing the probability of the request text in the maximum probability intention category with a first confidence coefficient and a second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient and the second confidence coefficient are obtained by classifying and predicting a model evaluation corpus according to an intention classification model, the first confidence coefficient is larger than the second confidence coefficient, and the model evaluation corpus and a model training corpus are obtained by randomly dividing the acquired text corpus; and processing the request text of the user according to the comparison result, so that the accuracy of intention recognition of the request text of the user is improved.
In step S101, it is exemplarily illustrated that a request text of a user is acquired, the request text is input into a trained intent classification model, and probabilities of the request text in each intent class are obtained, where the intent classification model is trained according to a model training corpus, and for example, the request text of the user may be obtained by parsing text or voice data input by the user. Intelligent devices, intelligent voice assistants, etc. need to interact through a specific intent output protocol, for example, in an intelligent vehicle-mounted voice dialogue system, a user requests a protocol "help me turn on air conditioner" which requires intent recognition output "turn on air conditioner". It can be seen that the protocol involves four pieces of information, namely, the intended device, the intended function, the intended operation, and the numerical value of the intended operation, so that the intended classification model classifies the request text mainly according to the four pieces of information, namely, the intended device, the intended function, the intended operation, and the specific value of the intended operation. The intention classification model can be obtained by training the obtained text corpus of the user, and further, the intention classification model is obtained by training a corresponding model training corpus obtained according to the text corpus of the user. In some implementations, the network structure of the intent classification model can be TextCNN neural network model and linear layer and softmax layer, bert pre-training language model and linear layer and softmax layer, and so forth.
In step S102, it is exemplarily illustrated that the probabilities of the request text in the respective intention categories are compared to obtain the probabilities of the request text in the most probable intention category, for example, according to the probabilities of the request text in the respective intention categories are compared, wherein the intention category corresponding to the greatest probability is the most probable intention category corresponding to the request text, the greatest probability is the probability of the request text in the most probable intention category, for example, the intention categories have V in total, and the probabilities of the request text corresponding in the V categories are respectively、/>、...、/>If->For maximum probability, then the most probable intent category of the request text is +.>The corresponding category V, that is, the intention category of the request text is most likely to be category V.
In step S103, it is exemplarily illustrated that the probability of the intention category of the request text in the maximum probability is compared with a first confidence coefficient and a second confidence coefficient, and a comparison result is obtained, where the first confidence coefficient and the second confidence coefficient are obtained by performing classification prediction on the model evaluation corpus according to the intention classification model, and the first confidence coefficient is greater than the second confidence coefficient, and the model evaluation corpus and the model training corpus are obtained by randomly dividing the obtained text corpus, for example, the obtaining manner of the text corpus includes but is not limited to: the method comprises the steps of compiling a dialog system product designer, compiling based on potential intention operation of a conventional dialog system user, cleaning and obtaining a corpus of an open-source dialog system, and dividing the corpus of the text into two types: the model evaluation corpus and the model training corpus may be divided in a random manner, for example, the model training corpus may be corresponding to each intention category: the method comprises the steps of segmenting a model evaluation corpus=7:3, and adding some text corpuses with partial errors or ambiguities such as 'air conditioner temperature rise two-bucket' into the model evaluation corpus for prediction, so that corresponding first confidence coefficient and second confidence coefficient are obtained through probability obtained through prediction.
In some embodiments, prior to entering the requested text into the trained intent classification model, further comprising: determining intent recognition content of the user about the related device based on the interaction information of the user and the related device; determining an intention label system according to the intention identification content, wherein the intention label system comprises an intention device, an intention function, an intention operation and a numerical value of the intention operation; acquiring text corpus corresponding to the intention label system, and randomly classifying the text corpus according to a preset proportion to obtain a model training corpus and a model evaluation corpus; based on the intention label system, classifying and training the initial model through the model training corpus to obtain an intention classification model.
Specifically, the interactive information here refers to voice information and the like when the user interacts with the relevant device; the intention recognition content refers to an intention output protocol, that is, an intention device, an intention function, an intention operation, a value of the intention operation. Creating an intention label system according to the intention identification content, wherein the intention label system comprises an intention device, an intention function, an intention operation and a numerical value of the intention operation, for example, taking the intention of turning on an air conditioner as an example, the intention label is designed to be air conditioner-o-turning on-o, wherein the intention device = air conditioner, the intention function = o represents an intention function default, the intention operation = turning on, and the numerical value of the intention operation = o represents a numerical value default of the intention operation. Further, taking the intention of "adjusting the air volume gear" as an example, the intention label is designed as a numerical value of air conditioner-gear-adjustment-gear. And requesting corresponding text corpus based on the intention label system to obtain an intention classification model training corpus and an evaluation corpus.
In some embodiments, before comparing the probability of the request text being in the most probable intent category with the first confidence, the second confidence, the method further comprises: inputting the model evaluation corpus into an intention classification model to obtain the probability of each model evaluation corpus in the model evaluation corpus in each intention category; comparing the probabilities of the model evaluation linguistic data in each intention category to obtain the probability of each model evaluation linguistic data in the intention category with the highest probability; and evaluating the probability of the corpus in the maximum probability intention category based on each model, and obtaining a first confidence coefficient and a second confidence coefficient, wherein the first confidence coefficient is larger than the second confidence coefficient.
Specifically, for example, assume that the intention category shares v= {,/>,…,/>Class, evaluate corpus as e= { }>,/>,…,...,/>}, wherein->Representing the ith evaluation sample. Deriving ∈thers based on the intent classification model>The probability distribution of the belonging intention category is +.>Wherein->Represents->In intention category->Probability of upper->Is->The probability value of the maximum probability intention category is calculated for the model evaluation corpus, and the probability distribution of each model evaluation corpus classified to the maximum probability intention category is +.>And then obtaining a first confidence and a second confidence according to the probability distribution of the maximum probability intention category.
In some embodiments, estimating probabilities of the corpus in the most probable intent category based on the respective models, obtaining the first confidence and the second confidence includes: establishing a probability distribution histogram based on the probabilities of the corpus in the maximum probability intention category estimated by each model; comparing the peak values in the direction of the abscissa of the probability distribution histogram far from the origin according to the probability distribution histogram to obtain a first peak value; determining the probability of the abscissa corresponding to the first peak as a first confidence; comparing the peak values corresponding to the abscissa of the probability distribution histogram in the direction close to the origin according to the probability distribution histogram to obtain a second peak value; and determining the probability of the abscissa corresponding to the second peak as the second confidence.
Specifically, toAnd carrying out histogram statistics, and selecting the abscissa probability value of the maximum peak value of the absolute value of the leftmost gradient as a fuzzy confidence threshold T1, namely a second confidence. The abscissa probability value of the maximum peak of the absolute value of the rightmost gradient is selected as the high confidence threshold T2, i.e. the first confidence.
In some embodiments, processing the user's request text according to the comparison result includes: if the probability of the request text in the maximum probability intention category is smaller than the first confidence coefficient and larger than or equal to the second confidence coefficient, acquiring an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs; semantic guidance of the user with respect to the intent device, intent function, intent operation, value of intent operation is conducted through the intent label system such that the probability of the user in the highest probability intent category is greater than or equal to the first confidence level.
Specifically, the intention classification model classifies the intention of the request text, if the probability of classifying the request text into the maximum probability category is greater than the fuzzy confidence threshold T1 and less than the high confidence threshold T2, the user is guided by replying based on the corresponding intention label, and then a specific intention recognition output is output after multiple rounds of dialogue. In some implementation processes, for example, a user requests that "the air conditioner temperature is increased by two degrees" is erroneously recognized by automatic voice recognition as "the air conditioner temperature is increased by two buckets", the probability value of classifying into the maximum probability class is 0.8, more than the second confidence coefficient is less than the first confidence coefficient, the user can be replied to "do you want to increase the air conditioner temperature" based on the intention label system, if the user answers affirmative, the slot post-processing is performed, the intention label with the intention function of air conditioner, the intention function of temperature, the intention operation of increasing, and the value of the intention operation of 2 is obtained, and the intention label generates a corresponding instruction and sends the corresponding instruction to the corresponding device to realize the intention response.
In some embodiments, processing the user's request text according to the comparison result includes: if the probability of the request text in the maximum probability intention category is smaller than the second confidence coefficient, the related equipment refuses to respond to the request text of the user; and if the probability of the request text in the maximum probability intention category is greater than or equal to the first confidence coefficient, outputting corresponding intention recognition content according to the request text.
Specifically, the intention classification model classifies the intention of the request text, if the probability of classifying the request text into the maximum probability category is larger than a high confidence threshold T2, a specific intention recognition output protocol is output after the intention classification model performs slot position, and if the probability of classifying the request text into the maximum probability category is smaller than a fuzzy confidence threshold T1, no response is performed, so that erroneous judgment is avoided. The post-processing of the slot refers to the slot corresponding to the intended device, the intended function, the intended operation and the numerical value of the intended operation in the related device, and after the post-processing of the slot is performed, the related device can respond to the request text of the user to execute the corresponding function.
In some embodiments, if the probability of the request text in the most probable intent category is greater than or equal to the first confidence, outputting the corresponding intent recognition content according to the request text includes: if the probability of the request text in the maximum probability intention category is greater than or equal to the first confidence coefficient, determining an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs; according to the intention label system corresponding to the request text, the related equipment executes the intention equipment, the intention function, the intention operation and the numerical value of the intention operation corresponding to the intention label system.
In some embodiments, as shown in fig. 2, a user requests text input into an intention classification model, then obtains a maximum probability intention category probability value of the request text, judges the magnitudes of the maximum probability intention category probability value and a high confidence threshold (first confidence) and a fuzzy confidence threshold (second confidence), and if the maximum probability intention category probability value is greater than the high confidence threshold, performs slot post-processing on the request text and then performs intention response; if the maximum probability intention category probability value is larger than the fuzzy confidence coefficient threshold value and smaller than the high confidence coefficient threshold value, semantic guidance is realized through multi-round interaction between related equipment and a user, after positive reply of the user is obtained, slot post-processing is performed on the request text, then intention response is performed, or if positive reply of the user is not obtained, intention recognition is refused; and when the maximum probability intention category probability value is smaller than the fuzzy confidence threshold value, refusing to carry out intention recognition.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 3 is a schematic diagram of a request text processing device according to an embodiment of the present application. As shown in fig. 3, the request text processing apparatus includes:
the intention classification module 301 is configured to obtain a request text of a user, input the request text into a trained intention classification model, and obtain probabilities of the request text in each intention category, wherein the intention classification model is obtained by training according to a model training corpus;
the maximum probability determination module 302 is configured to compare probabilities of the request text in the intention categories, and obtain probabilities of the request text in the intention categories with the maximum probability;
the probability comparison module 303 is configured to compare the probability of the request text in the maximum probability intention category with a first confidence coefficient and a second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient and the second confidence coefficient are obtained by classifying and predicting a model evaluation corpus according to an intention classification model, the first confidence coefficient is greater than the second confidence coefficient, and the model evaluation corpus and a model training corpus are obtained by randomly dividing the acquired text corpus;
the intention execution module 304 is configured to obtain, according to a comparison result, an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs if the probability of the request text in the maximum probability intention category is smaller than the first confidence degree and greater than or equal to the second confidence degree; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient.
In some embodiments, the intent classification module 301 is configured to determine intent recognition content of a user with respect to a relevant device based on user interaction information with the relevant device; determining an intention label system according to the intention identification content, wherein the intention label system comprises an intention device, an intention function, an intention operation and a numerical value of the intention operation; acquiring text corpus corresponding to the intention label system, and randomly classifying the text corpus according to a preset proportion to obtain a model training corpus and a model evaluation corpus; based on the intention label system, classifying and training the initial model through the model training corpus to obtain an intention classification model.
In some embodiments, the probability comparison module 303 is configured to input the model evaluation corpus into the intent classification model, and obtain probabilities of each model evaluation corpus in the model evaluation corpus in each intent category; comparing the probabilities of the model evaluation linguistic data in each intention category to obtain the probability of each model evaluation linguistic data in the intention category with the highest probability; and evaluating the probability of the corpus in the maximum probability intention category based on each model, and obtaining a first confidence coefficient and a second confidence coefficient, wherein the first confidence coefficient is larger than the second confidence coefficient.
In some embodiments, the probability comparison module 303 is configured to establish a probability distribution histogram based on the probabilities of the respective model evaluation corpora in the most probable intent categories; comparing the peak values in the direction of the abscissa of the probability distribution histogram far from the origin according to the probability distribution histogram to obtain a first peak value; determining the probability of the abscissa corresponding to the first peak as a first confidence; comparing the peak values corresponding to the abscissa of the probability distribution histogram in the direction close to the origin according to the probability distribution histogram to obtain a second peak value; and determining the probability of the abscissa corresponding to the second peak as the second confidence.
In some embodiments, the intention execution module 304 is configured to obtain the intention label system corresponding to the request text according to the highest probability intention category to which the request text belongs if the probability of the request text in the highest probability intention category is less than the first confidence level and greater than or equal to the second confidence level; semantic guidance of the user with respect to the intent device, the intent function, the intent operation, the numerical value of the intent operation is conducted through the intent label system, so that the probability of the user in the highest probability intent category is greater than or equal to the first confidence level.
In some embodiments, the intention execution module 304 is configured to determine, if the probability of the request text in the most probable intention category is greater than or equal to the first confidence, an intention label system corresponding to the request text according to the most probable intention category to which the request text belongs; and generating a corresponding instruction by the intention label system and transmitting the instruction to related equipment so that the related equipment executes the intention response of the request text. Specific: according to the intention label system corresponding to the request text, the related equipment executes the intention equipment, the intention function, the intention operation and the numerical value of the intention operation corresponding to the intention label system.
In some embodiments, the intent execution module 304 is configured to reject the intent response to the request text of the user if the probability of the request text being in the most probable intent category is less than the second confidence.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 4 is a schematic diagram of an electronic device 4 according to an embodiment of the present application. As shown in fig. 4, the electronic apparatus 4 of this embodiment includes: a processor 401, a memory 402 and a computer program 403 stored in the memory 402 and executable on the processor 401. The steps of the various method embodiments described above are implemented by processor 401 when executing computer program 403. Alternatively, the processor 401, when executing the computer program 403, performs the functions of the modules/units in the above-described apparatus embodiments.
The electronic device 4 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the electronic device 4 and is not limiting of the electronic device 4 and may include more or fewer components than shown, or different components.
The processor 401 may be a central processing unit (Central Processing Unit, CPU) or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application SpecificIntegrated 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.
The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or a memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 4. Memory 402 may also include both internal storage units and external storage devices of electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.
Claims (10)
1. A method for processing a request text, comprising:
acquiring a request text of a user, inputting the request text into a trained intention classification model, and acquiring the probability of the request text in each intention category;
comparing the probability of the request text in each intention category to obtain the probability of the request text in the intention category with the highest probability;
comparing the probability of the request text in the maximum probability intention category with a preset first confidence coefficient and a preset second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient is larger than the second confidence coefficient;
according to the comparison result, if the probability of the request text in the maximum probability intention category is smaller than the first confidence coefficient and larger than or equal to the second confidence coefficient, acquiring an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient.
2. The method of claim 1, further comprising, prior to entering the requested text into the trained intent classification model:
determining intent recognition content of a user about a related device based on interaction information of the user with the related device;
determining an intention label system according to the intention identification content, wherein the intention label system comprises an intention device, an intention function, an intention operation and a numerical value of the intention operation;
acquiring text corpus corresponding to the intention label system, and randomly classifying the text corpus according to a preset proportion to obtain a model training corpus and a model evaluation corpus;
and based on the intention label system, carrying out classification training on an initial model through the model training corpus to obtain the intention classification model.
3. The method of claim 2, wherein prior to comparing the probability of the request text in the most probable intent category with a first confidence and a second confidence, the method further comprises:
inputting the model evaluation corpus into the intention classification model to obtain the probability of each model evaluation corpus in the model evaluation corpus in each intention category;
comparing the probabilities of the model evaluation corpus in each intention category to obtain the probability of each model evaluation corpus in the intention category with the highest probability;
and evaluating the probability of the corpus in the maximum probability intention category based on the models, and obtaining the first confidence and the second confidence, wherein the first confidence is greater than the second confidence.
4. A method according to claim 3, wherein estimating the probabilities of corpus in the most probable intent category based on the respective models, obtaining the first confidence and the second confidence, comprises:
establishing a probability distribution histogram based on the probabilities of the estimated corpora in the maximum probability intention category of each model;
comparing the peak values in the direction of the abscissa of the probability distribution histogram far from the origin according to the probability distribution histogram to obtain a first peak value;
determining the probability of the abscissa corresponding to the first peak as the first confidence;
comparing the peak value corresponding to the abscissa of the probability distribution histogram in the direction close to the origin according to the probability distribution histogram to obtain a second peak value;
and determining the probability of the abscissa corresponding to the second peak as the second confidence.
5. The method of claim 2, wherein the semantically directing the user via the intent tagging system comprises:
semantic guidance is conducted on the user with respect to the intent device, the intent function, the intent operation, and the numerical value of the intent operation through the intent tagging system so that the probability of the user in the most probable intent category is greater than or equal to the first confidence.
6. The method as recited in claim 2, further comprising:
according to the comparison result, if the probability of the request text in the maximum probability intention category is smaller than the second confidence coefficient, rejecting the intention response of the request text of the user by the related equipment;
if the probability of the request text in the maximum probability intention category is greater than or equal to the first confidence coefficient, determining the intention label system corresponding to the request text according to the maximum probability intention category, generating a corresponding instruction by the intention label system, and sending the instruction to related equipment so that the related equipment executes the intention response of the request text.
7. The method of claim 6, wherein issuing the intent tag system generate corresponding instructions to a related device to cause the related device to perform an intent response of the request text comprises:
according to the intention label system corresponding to the request text, the related device executes the intention device, the intention function, the intention operation and the intention response of the value of the intention operation corresponding to the intention label system.
8. A request text processing apparatus, comprising:
the intention classification module is configured to acquire a request text of a user, input the request text into a trained intention classification model, and acquire the probability of the request text in each intention category;
the maximum probability determining module is configured to compare probabilities of the request text in various intention categories and obtain probabilities of the request text in the maximum probability intention categories;
the probability comparison module is configured to compare the probability of the request text in the maximum probability intention category with a preset first confidence coefficient and a preset second confidence coefficient to obtain a comparison result, wherein the first confidence coefficient is larger than the second confidence coefficient;
the intention execution module is configured to obtain an intention label system corresponding to the request text according to the maximum probability intention category to which the request text belongs if the probability of the request text in the maximum probability intention category is smaller than the first confidence degree and larger than or equal to the second confidence degree according to the comparison result; and carrying out semantic guidance on the user through the intention label system, and determining a new request text based on a semantic guidance result so that the probability of the new request text in the maximum probability intention category is greater than or equal to the first confidence coefficient.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310935962.5A CN116662555B (en) | 2023-07-28 | 2023-07-28 | Request text processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310935962.5A CN116662555B (en) | 2023-07-28 | 2023-07-28 | Request text processing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116662555A true CN116662555A (en) | 2023-08-29 |
CN116662555B CN116662555B (en) | 2023-10-20 |
Family
ID=87717416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310935962.5A Active CN116662555B (en) | 2023-07-28 | 2023-07-28 | Request text processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116662555B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116959433A (en) * | 2023-09-18 | 2023-10-27 | 腾讯科技(深圳)有限公司 | Text processing method, device, electronic equipment and storage medium |
Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200097563A1 (en) * | 2018-09-21 | 2020-03-26 | Salesforce.Com, Inc. | Intent classification system |
CN111352348A (en) * | 2018-12-24 | 2020-06-30 | 北京三星通信技术研究有限公司 | Device control method, device, electronic device and computer-readable storage medium |
CN111860462A (en) * | 2020-08-07 | 2020-10-30 | 多点(深圳)数字科技有限公司 | Shelf display feedback method and device |
CN111930854A (en) * | 2020-10-10 | 2020-11-13 | 北京福佑多多信息技术有限公司 | Intention prediction method and device |
US20210042372A1 (en) * | 2019-08-09 | 2021-02-11 | Microsoft Technology Licensing, Llc | Query entity-experience classification |
WO2021120631A1 (en) * | 2019-12-19 | 2021-06-24 | 深圳壹账通智能科技有限公司 | Intelligent interaction method and apparatus, and electronic device and storage medium |
CN113220839A (en) * | 2021-05-13 | 2021-08-06 | 湖北亿咖通科技有限公司 | Intention identification method, electronic equipment and computer readable storage medium |
CN113672696A (en) * | 2021-07-08 | 2021-11-19 | 浙江一山智慧医疗研究有限公司 | Intention recognition method, device, computer equipment and computer readable storage medium |
CN113886577A (en) * | 2021-09-10 | 2022-01-04 | 润联软件系统(深圳)有限公司 | Text classification method, device, equipment and storage medium |
CN114254111A (en) * | 2021-12-21 | 2022-03-29 | 北京小鹏汽车有限公司 | Voice interaction method, vehicle, server, voice system and storage medium |
CN114564964A (en) * | 2022-02-24 | 2022-05-31 | 杭州中软安人网络通信股份有限公司 | Unknown intention detection method based on k-nearest neighbor comparison learning |
CN114676689A (en) * | 2022-03-09 | 2022-06-28 | 青岛海尔科技有限公司 | Sentence text recognition method and device, storage medium and electronic device |
CN114694646A (en) * | 2020-12-31 | 2022-07-01 | 华为技术有限公司 | Voice interaction processing method and related device |
CN114925158A (en) * | 2022-03-15 | 2022-08-19 | 青岛海尔科技有限公司 | Sentence text intention recognition method and device, storage medium and electronic device |
CN115470796A (en) * | 2022-09-14 | 2022-12-13 | 四川大学 | Text instruction generation method and equipment for air traffic control simulation training |
CN115689672A (en) * | 2022-09-29 | 2023-02-03 | 广州欢聚时代信息科技有限公司 | Chat type commodity shopping guide method and device, equipment and medium thereof |
CN116187335A (en) * | 2022-12-22 | 2023-05-30 | 深圳绿米联创科技有限公司 | Intention recognition method and device, storage medium and electronic equipment |
-
2023
- 2023-07-28 CN CN202310935962.5A patent/CN116662555B/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200097563A1 (en) * | 2018-09-21 | 2020-03-26 | Salesforce.Com, Inc. | Intent classification system |
CN111352348A (en) * | 2018-12-24 | 2020-06-30 | 北京三星通信技术研究有限公司 | Device control method, device, electronic device and computer-readable storage medium |
US20210042372A1 (en) * | 2019-08-09 | 2021-02-11 | Microsoft Technology Licensing, Llc | Query entity-experience classification |
WO2021120631A1 (en) * | 2019-12-19 | 2021-06-24 | 深圳壹账通智能科技有限公司 | Intelligent interaction method and apparatus, and electronic device and storage medium |
CN111860462A (en) * | 2020-08-07 | 2020-10-30 | 多点(深圳)数字科技有限公司 | Shelf display feedback method and device |
CN111930854A (en) * | 2020-10-10 | 2020-11-13 | 北京福佑多多信息技术有限公司 | Intention prediction method and device |
CN114694646A (en) * | 2020-12-31 | 2022-07-01 | 华为技术有限公司 | Voice interaction processing method and related device |
CN113220839A (en) * | 2021-05-13 | 2021-08-06 | 湖北亿咖通科技有限公司 | Intention identification method, electronic equipment and computer readable storage medium |
CN113672696A (en) * | 2021-07-08 | 2021-11-19 | 浙江一山智慧医疗研究有限公司 | Intention recognition method, device, computer equipment and computer readable storage medium |
CN113886577A (en) * | 2021-09-10 | 2022-01-04 | 润联软件系统(深圳)有限公司 | Text classification method, device, equipment and storage medium |
CN114254111A (en) * | 2021-12-21 | 2022-03-29 | 北京小鹏汽车有限公司 | Voice interaction method, vehicle, server, voice system and storage medium |
CN114564964A (en) * | 2022-02-24 | 2022-05-31 | 杭州中软安人网络通信股份有限公司 | Unknown intention detection method based on k-nearest neighbor comparison learning |
CN114676689A (en) * | 2022-03-09 | 2022-06-28 | 青岛海尔科技有限公司 | Sentence text recognition method and device, storage medium and electronic device |
CN114925158A (en) * | 2022-03-15 | 2022-08-19 | 青岛海尔科技有限公司 | Sentence text intention recognition method and device, storage medium and electronic device |
CN115470796A (en) * | 2022-09-14 | 2022-12-13 | 四川大学 | Text instruction generation method and equipment for air traffic control simulation training |
CN115689672A (en) * | 2022-09-29 | 2023-02-03 | 广州欢聚时代信息科技有限公司 | Chat type commodity shopping guide method and device, equipment and medium thereof |
CN116187335A (en) * | 2022-12-22 | 2023-05-30 | 深圳绿米联创科技有限公司 | Intention recognition method and device, storage medium and electronic equipment |
Non-Patent Citations (1)
Title |
---|
魏志强 等: "面向智能家庭的动态自适应软件基础平台研究", 中国海洋大学学报(自然科学版), no. 05, pages 1056 - 1060 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116959433A (en) * | 2023-09-18 | 2023-10-27 | 腾讯科技(深圳)有限公司 | Text processing method, device, electronic equipment and storage medium |
CN116959433B (en) * | 2023-09-18 | 2023-12-08 | 腾讯科技(深圳)有限公司 | Text processing method, device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116662555B (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109165291B (en) | Text matching method and electronic equipment | |
CN110069709B (en) | Intention recognition method, device, computer readable medium and electronic equipment | |
CN110543637A (en) | Chinese word segmentation method and device | |
CN116662555B (en) | Request text processing method and device, electronic equipment and storage medium | |
CN112948669A (en) | Business processing method based on big data and artificial intelligence and block chain financial platform | |
CN110955766A (en) | Method and system for automatically expanding intelligent customer service standard problem pairs | |
WO2021001517A1 (en) | Question answering systems | |
CN112100374A (en) | Text clustering method and device, electronic equipment and storage medium | |
CN116542297A (en) | Method and device for generating countermeasure network based on text data training | |
CN117523218A (en) | Label generation, training of image classification model and image classification method and device | |
CN114218381B (en) | Method, device, equipment and medium for identifying position | |
CN116127001A (en) | Sensitive word detection method, device, computer equipment and storage medium | |
CN110059743B (en) | Method, apparatus and storage medium for determining a predicted reliability metric | |
CN115858776B (en) | Variant text classification recognition method, system, storage medium and electronic equipment | |
CN114254622B (en) | Intention recognition method and device | |
CN111382265A (en) | Search method, apparatus, device and medium | |
CN111831823B (en) | Corpus generation and model training method | |
CN112735395A (en) | Voice recognition method, electronic equipment and storage device | |
CN112199492A (en) | Rumor propagation control method and device in complex network | |
CN115329751B (en) | Keyword extraction method, device, medium and equipment for network platform text | |
CN117874239B (en) | Content generation method, device, equipment and storage medium | |
US11934794B1 (en) | Systems and methods for algorithmically orchestrating conversational dialogue transitions within an automated conversational system | |
CN114529191B (en) | Method and device for risk identification | |
CN115563990A (en) | Information classification method, information classification device, and readable storage medium | |
CN116796254A (en) | Telecommunication anti-fraud method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240117 Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039 Patentee after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd. Address before: No. 801, 8th Floor, Building 2, No. 168 Tianfu Fifth Street, Chengdu High tech Zone, China (Sichuan) Pilot Free Trade Zone, Chengdu City, Sichuan Province, 610095 Patentee before: Chengdu Thalys Technology Co.,Ltd. |