CN115640392A - Method and device for optimizing dialog system, storage medium and electronic equipment - Google Patents

Method and device for optimizing dialog system, storage medium and electronic equipment Download PDF

Info

Publication number
CN115640392A
CN115640392A CN202211558771.3A CN202211558771A CN115640392A CN 115640392 A CN115640392 A CN 115640392A CN 202211558771 A CN202211558771 A CN 202211558771A CN 115640392 A CN115640392 A CN 115640392A
Authority
CN
China
Prior art keywords
sentence
determining
participle
dialogue
score
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
Application number
CN202211558771.3A
Other languages
Chinese (zh)
Other versions
CN115640392B (en
Inventor
应翔
盖冉翔
魏佳乐
刘若晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Xinzhi Cosmos Technology Co ltd
Original Assignee
Hangzhou Xinzhi Cosmos Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Xinzhi Cosmos Technology Co ltd filed Critical Hangzhou Xinzhi Cosmos Technology Co ltd
Priority to CN202211558771.3A priority Critical patent/CN115640392B/en
Publication of CN115640392A publication Critical patent/CN115640392A/en
Application granted granted Critical
Publication of CN115640392B publication Critical patent/CN115640392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Machine Translation (AREA)

Abstract

The specification discloses a dialogue system optimization method, a dialogue system optimization device, a storage medium and an electronic device, which respond to a dialogue system optimization instruction of a user and acquire a historical dialogue record. And aiming at each statement output by the dialogue system in the historical dialogue record, performing word segmentation processing on the statement, determining the total number of each word segmentation and each word segmentation in the statement, and determining the user input statement corresponding to the statement. And determining the grade of the sentence on a plurality of preset characteristic dimensions at least partially according to the sentence input by the user, each participle in the sentence, the position of each participle, the number of the participles and a preset stop word list. And determining the optimization direction of the dialogue system according to the grade of the determined at least one sentence on each characteristic dimension, and adjusting the parameters of the dialogue system. The output sentences of the dialogue system can be scored on the single-round dialogue, multi-round dialogue and system level, the optimization direction is determined, the parameter adjustment is carried out on the dialogue system, and the dialogue capacity of the dialogue system is improved.

Description

Method and device for optimizing dialog system, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for optimizing a dialog system, a storage medium, and an electronic device.
Background
With the development of science and technology, human-computer interaction is increasingly concerned by the public. Among them, the application of the dialog system is very wide, and the quality requirements of people on the dialog system are higher and higher. More advanced areas of application for dialog systems include: and the application dialogue system realizes dialogue between the virtual human and the user.
The virtual human is a 'virtual' user which can spontaneously communicate with the user and transmit information to the user. Moreover, the virtual human has the settings similar to the real human such as personality and character. The final goal of the dialogue ability of the avatar is to make the avatar have the same expression ability as a real human.
However, the above objective is still difficult to achieve by the current dialog system, and based on this, the present specification provides a method for optimizing the dialog system.
Disclosure of Invention
The present specification provides a method and apparatus for dialog system optimization, a storage medium, and an electronic device to at least partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a method of dialog system optimization, the method comprising:
responding to a dialog system optimization instruction of a user, and acquiring a historical dialog record in the dialog system;
for each statement output by the dialog system in the historical dialog record, performing word segmentation processing on the statement, and determining each word segmentation in the statement and the number of words segmentation contained in the statement;
determining a user input statement corresponding to the statement according to the historical dialogue record;
determining the score of the sentence on a plurality of preset characteristic dimensions at least partially according to the user input sentence, each participle in the sentence, the position of each participle, the number of the participles and a preset stop word list;
determining an optimization direction of the dialogue system according to the determined scores of at least one sentence on each feature dimension, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
Optionally, determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, a position of each participle, the number of participles, and a preset stop word list, specifically including:
aiming at each participle, inputting the participle into a preset prediction model, and determining the probability of connecting each prediction participle after the prediction model outputs the participle;
determining adjacent participles after the participle according to the position of each participle;
determining a predicted participle matched with the adjacent participle from each predicted participle, and determining the probability corresponding to the matched predicted participle as the position score of the adjacent participle;
and determining the score of the fluency characteristic dimension of the sentence according to the determined position score of each adjacent word and the number of the words in the sentence.
Optionally, determining the predicted participle matched with the adjacent participle from each predicted participle specifically includes:
determining the similarity between the adjacent participles and each predicted participle;
and determining the predicted participles matched with the adjacent participles according to the determined similarity.
Optionally, determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, a position of each participle, the number of participles, and a preset stop word list, specifically including:
aiming at each participle, inputting the participle and the user input sentence into a preset prediction model, and determining the probability corresponding to each prediction participle connected with the participle in the sentence output by the prediction model;
determining adjacent participles after the participle according to the position of each participle in the sentence;
determining a predicted participle matched with the adjacent participle from each predicted participle, and determining the probability corresponding to the matched predicted participle as the position score of the adjacent participle;
determining the probability of the sentence output by the dialogue system when the user inputs the sentence according to the position score of each adjacent participle;
and determining the score of the relevance characteristic dimension of the sentence according to the determined probability of the sentence and the number of the participles in the sentence.
Optionally, determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, a position of each participle, the number of participles, and a preset stop word list, specifically including:
determining the word segmentation length of each word segmentation in the sentence;
determining the number of the participles corresponding to different participle lengths according to the participle lengths;
for each word segmentation length, determining the probability of the word segmentation with the word segmentation length in the sentence according to the number of the words corresponding to the word segmentation length and the number of the words in the sentence;
and determining the score of the diversity characteristic dimension of the sentence according to the determined probability of the occurrence of the participles with the participle length in the sentence.
Optionally, determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, the position of each participle, the number of participles, and a preset stop word list, specifically including:
determining stop words and non-stop words in each participle according to a preset stop word list;
and determining the score of the richness characteristic dimension of the sentence according to the proportion of the participles belonging to the non-stop words in the sentence.
Optionally, the method further comprises:
combining and determining a plurality of conversation contexts according to preset identity information and conversation rules;
inputting preset psychological consistency problems into the dialogue system aiming at each determined context, and determining reply sentences of the dialogue system under the context;
aiming at least one preset psychological consistency problem, determining the grade of the stability characteristic dimension of the dialogue system according to reply sentences output by the dialogue system under each context;
wherein the stability score represents the stability of the dialog system.
Optionally, determining a score of a stability feature dimension of the dialog system according to a reply sentence output by the dialog system in each context includes:
aiming at least one preset psychological consistency problem, determining a reply sentence preset in each context in the dialogue system for the preset psychological consistency problem;
determining the occurrence frequency of the reply sentences with the same content and the maximum occurrence frequency of the reply sentences as a first numerical value and determining the total number of the reply sentences as a second numerical value for each determined reply sentence;
determining a stability score of the dialog system based on the first value and the second value.
Optionally, determining an optimization direction of the dialog system according to the score of the determined at least one sentence in each feature dimension, specifically including:
determining the total number of sentences output by the dialogue system and the score of each sentence on each characteristic dimension in a historical dialogue record in the dialogue system;
determining the average score of each sentence on a plurality of preset characteristic dimensions according to the determined scores of each sentence on the plurality of preset characteristic dimensions and the total number of the sentences output by the dialogue system;
determining an optimization direction of the dialog system according to the average score, and adjusting parameters of the dialog system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
Optionally, determining an optimization direction of the dialog system according to the score of the determined at least one sentence on each feature dimension, specifically including:
determining a score of each statement output by the dialog system in each feature dimension in a plurality of historical dialog records in the dialog system, and determining a number of the plurality of historical dialog records;
for each historical dialogue record, determining the total number of sentences output by the dialogue system in the historical dialogue record, and determining the average score of the historical dialogue record on a plurality of preset characteristic dimensions according to the score of each sentence output by the dialogue system in the historical dialogue record on each characteristic dimension and the total number of sentences output by the dialogue system in the historical dialogue record;
determining system scores of the dialogue system on a plurality of preset characteristic dimensions according to the average scores of the historical dialogue records on the plurality of preset characteristic dimensions and the number of the historical dialogue records;
determining an optimization direction of the dialogue system according to system scores of the dialogue system on a plurality of preset feature dimensions, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
The present specification provides an apparatus for dialog system optimization, comprising:
the acquisition module is used for responding to a dialogue system optimization instruction of a user and acquiring historical dialogue records in the dialogue system;
the first determining module is used for performing word segmentation processing on each statement output by the dialogue system in the historical dialogue record, and determining each word segmentation in the statement and the number of the words comprised in the statement;
the second determining module is used for determining a user input statement corresponding to the statement according to the historical dialogue record;
a scoring module for determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, the position of each participle, the number of the participles and a preset stop word list;
the optimization module is used for determining the optimization direction of the dialogue system according to the grade of the determined at least one sentence on each feature dimension, and adjusting the parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
The present specification provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the above-described method of dialog system optimization.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above method of dialog system optimization when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the method for dialog system optimization provided in this specification, first, in response to a dialog system optimization instruction of a user, a server may acquire a history dialog record in a dialog system. And performing word segmentation processing on each statement output by the dialog system in the historical dialog record, and determining each word segmentation in the statement and the number of words segmentation contained in the statement. Then, a user input sentence corresponding to the sentence is determined from the history dialog record. And determining the grade of the sentence on a plurality of preset characteristic dimensions at least partially according to the input sentence of the user, each participle in the sentence, the position of each participle, the number of the participles and a preset stop word list. And finally, determining the optimization direction of the dialogue system according to the score of the determined at least one sentence on each characteristic dimension, and adjusting the parameters of the dialogue system based on the determined optimization direction, wherein different characteristic dimensions correspond to different optimization directions.
As can be seen from the foregoing method, for each sentence in the historical dialogue record of the dialogue system, the user input sentence corresponding to the sentence, each participle in the sentence, the position of each participle, the number of participles, each participle, and a preset stop word table are determined, so as to determine a score of the sentence in a preset plurality of feature dimensions, and then an optimization direction of the dialogue system can be determined according to a score of at least one sentence in the preset plurality of feature dimensions. The method can score output sentences of the dialogue system on the single-round dialogue, multi-round dialogue and system level, then determine the optimization direction according to the scores, and adjust parameters of the dialogue system, thereby improving the 'dialogue' capability of the dialogue system and people.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a schematic flow chart of a method for optimizing a dialog system;
FIG. 2 is a schematic diagram of an apparatus for dialog system optimization provided herein;
fig. 3 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step shall fall within the scope of protection of the specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a dialog system optimization method provided in this specification, which may specifically include the following steps:
s100: and responding to a dialog system optimization instruction of a user, and acquiring historical dialog records in the dialog system.
S102: and performing word segmentation processing on each statement output by the dialog system in the historical dialog record, and determining each word segmentation in the statement and the number of words segmentation contained in the statement.
At present, the application of the virtual human is more and more extensive, and what is most important for the virtual human is the ability of the virtual human to talk with a human, and the virtual human communicates with a user and transmits information to the user based on the setting of the virtual human. Every sentence output by the avatar is extremely important, because it represents the information transferred by the avatar to the user, which reflects the quality of the conversation. Therefore, the dialogue capability of the avatar is very important. Therefore, the description provides an optimization method of a dialogue system, which scores the dialogue system of the virtual human on the level of single-round dialogue, multi-round dialogue and system, and combines the score of stability dimension obtained based on the problem of psychological consistency to realize the optimization of the dialogue system and improve the dialogue capability of the virtual human.
Specifically, first, the server that can optimize the dialog system can acquire a history dialog record in the dialog system in response to the dialog system optimization instruction of the user. Wherein the historical conversation record refers to a conversation generated in a conversation system in a time period based on a topic. For example, the avatar corresponding to the dialog system communicates with user a at9 am, the content is a question about whether breakfast is important or not, then the dialog ends at 10 am, and communicates again at 20 am at 10 am, talking about problems about lunch ends at 11 am, then the dialog between user a and avatar can be marked as two historical dialogues. In one or more embodiments of the present description, the server may obtain historical conversation records for one, more, or all conversation systems to enable optimization of the conversation systems at a single-turn conversation, multiple-turn conversation, and system level in subsequent steps. In this step and the following steps, how to grade different feature dimensions of the dialogue system on the unitheory dialogue level is mainly described, so that the server can obtain any one historical dialogue record first.
Then, for each sentence output by the dialogue system in the historical dialogue record, performing word segmentation processing on the sentence, and determining each word segmentation in the sentence and the number of words segmentation included in the sentence. Following the above example, assuming that the server obtains a historical dialogue record of the question whether breakfast eating is important or not, which is spoken by the corresponding avatar of the dialogue system and the user a, and assuming that 10 sentences are output by the dialogue system in the historical dialogue record, the server may perform word segmentation on the 10 sentences and determine each word segmentation and the total number of words in each sentence. For example, one sentence output by the dialog system is "breakfast can supplement body energy, and we must eat breakfast. "the result of the word segmentation processing on this sentence is" breakfast/ok/complement/body/energy/,/we/must/want/eat/breakfast/. V ", thus, each participle is determined and the sentence is found to contain 12 participles. Through the determination of each participle and the total number of the participles, the server can determine the scores of the sentence on different characteristic dimensions in the subsequent steps so as to determine the optimization direction of the dialogue system.
The server can realize word segmentation processing on the sentences through a preset word segmentation algorithm. Based on different scenes and requirements, different word segmentation algorithms are set, the word segmentation algorithms are widely used in the aspect of natural language processing, and how to implement the word segmentation algorithms is not described in detail in the specification.
S104: and determining the user input sentence corresponding to the sentence according to the historical dialogue record.
S106: and determining the score of the sentence on a plurality of preset characteristic dimensions at least partially according to the user input sentence, each participle in the sentence, the position of each participle, the number of the participles, each participle and a preset stop word list.
In one or more embodiments of the present specification, after performing word segmentation processing on each sentence output by the dialog system in the history dialog record through the server in the foregoing steps S100 and S102, and determining each word segmentation in the sentence and the number of words segmentation included in the sentence, a user input sentence corresponding to the sentence may also be determined, and a score of the sentence in a plurality of preset feature dimensions is determined at least partially according to the user input sentence, each word segmentation in the sentence, a position of each word segmentation in the sentence, the number of words segmentation in the sentence, and each word segmentation in the sentence and a preset stop word table.
Because the virtual person corresponding to the dialog system can spontaneously initiate a dialog with the user, the dialog can not only answer based on the question of the user, but also have different identities and characters like a 'person', and can communicate with other users 'person-to-person', that is, when the dialog system is optimized, not only the correctness of the output statement of the dialog system but also the identity and character of the corresponding virtual person when the dialog system outputs the statement are emphasized. Therefore, in one or more embodiments of the present specification, the dialog system needs to be scored on different feature dimensions, that is, comprehensively scored, so as to optimize the places where the dialog system is insufficient according to the scores of the different feature dimensions.
Specifically, the server may determine, according to the historical dialogue record, a user input sentence corresponding to a sentence output by the dialogue system in the historical dialogue record, and determine a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, a position of each participle, a number of participles, each participle, and a preset stop word list. Wherein the plurality of feature dimensions includes four aspects: fluency (fluent) feature dimensions, association (Context) feature dimensions, statement Diversity (Diversity) feature dimensions, and Richness of statements (Richness) feature dimensions.
First, the fluency feature dimension is a score for the continuity of preceding and following words within a sentence, so when scoring the dialog system at the single-turn dialog level, scoring of different feature dimensions can be performed on at least one sentence in a history. Specifically, after determining each participle and the number of the participles in a sentence, the server may input the participle into a preset prediction model for each participle, and determine the probability of connecting each prediction participle after the prediction model outputs the participle. And determining the adjacent participles after the participle according to the position of each participle. And the server determines the prediction participles matched with the adjacent participles from the prediction participles, and determines the probability corresponding to the matched prediction participles as the position scores of the adjacent participles. And finally, determining the fluency characteristic dimension score of the sentence according to the determined position score of each adjacent word and the number of the words in the sentence.
When calculating the fluency characteristic dimension score of the sentence, a formula can be adopted:
Figure 911892DEST_PATH_IMAGE001
Figure 563453DEST_PATH_IMAGE002
indicating the number of participles in a sentence, t indicating the position of each participle,
Figure 15294DEST_PATH_IMAGE003
representing a participle at position t within the sentence,
Figure 941662DEST_PATH_IMAGE004
representing the probability of obtaining a participle at position t within the sentence,
Figure 756034DEST_PATH_IMAGE005
representing the score of the sentence in the fluency feature dimension. Following the above example, the result of word segmentation processing on a sentence is "breakfast/ok/complement/body/energy/,/we/certain/want/eat/breakfast/. The word segmentation at each position is sequentially input into a preset prediction model, if the word segmentation with the position of 1 is input into the prediction model, the prediction model can predict the usable word segmentations at the next position and the probability thereof, if the word segmentation at the next position predicted by the model has the value of 30%, "can be 60%," can be 10% ", then the server can find out the probability of the word segmentation closest to the word segmentation at the position in the sentence from the word segmentations predicted by the prediction model according to the preset word segmentation similarity, namely, the probability of" can "is 60%, therefore, the word segmentation at the second position is input into the prediction model in sequence, and the probability of the word segmentation at the next position predicted by the prediction model is not less than the preset probability of" can "60%"The word segmentation probability of (1) is "60%". Then inputting the word segmentation of 'can' into the prediction model, and continuing to determine the word segmentation probability of the next position until the word segmentation probability of each position of the sentence is determined. And then calculating the score of the feature dimension of the fluency of the sentence by adopting the scoring formula for determining the feature dimension of the fluency of the sentence.
Second, the relevance feature dimension is a score of the degree of relevance of a sentence in the dialog system to its corresponding user input sentence. Specifically, the server may input the word and the user sentence corresponding to the sentence into the prediction model for each word, and determine the probability corresponding to each prediction word after the word output by the prediction model is connected when the input sentence is the user input sentence. Then, the adjacent participles after the participle can be determined according to the positions of the participles in the sentence. And then the server determines the prediction participles matched with the adjacent participles from the prediction participles, and determines the probability corresponding to the matched prediction participles as the position scores of the adjacent participles. And determining the probability of the sentence output by the dialogue system when the user inputs the sentence according to the position score of each adjacent participle. And finally, determining the score of the relevancy feature dimension of the sentence according to the determined probability of the sentence and the number of the participles in the sentence.
When calculating the sentence relevancy characteristic dimension score, a formula can be adopted:
Figure 234289DEST_PATH_IMAGE006
Figure 235743DEST_PATH_IMAGE002
indicating the number of participles in a sentence, t indicating the position of each participle,
Figure 231381DEST_PATH_IMAGE007
representing a participle at position t within the sentence,
Figure 900260DEST_PATH_IMAGE008
indicating that the input sentence is a user input word corresponding to the sentenceObtaining the probability of the participle at the position t in the sentence during the sentence operation,
Figure 628044DEST_PATH_IMAGE009
representing the score of the sentence in the fluency feature dimension. Following the above example, the server obtains a statement in the historical dialog record of the dialog system that "breakfast supplements body energy and we must eat breakfast. "and the user input sentence in the history dialog record corresponding to the sentence is to ask" we do not eat breakfast woollen ". Therefore, the user can input the sentence input by the user as the question "we want not to eat breakfast woollen" and the participle "breakfast" at the first position in the sentence output by the dialogue system into the prediction model, and the prediction model can determine that, in the case that the input sentence is the question "we want not to eat breakfast woollen", the participle at the next position of "breakfast" in the output sentence is determined, and if "can 10%", "can 60%", and "needs 30%", the probability that the participle at the next position, namely "can" is determined to be "60%" according to the preset participle similarity. Then, the server can input the predictive model with the word segmentation of the next position, namely ' can ' and the user input sentence is a question that ' we do not need to eat breakfast '. The probability of the word segmentation of the next position is continuously determined until ' breakfast can supplement body energy, and we need to eat breakfast certainly. "in this sentence, the segmentation probability is determined for each position, and the above calculation can be used
Figure 54478DEST_PATH_IMAGE010
The formula (2) obtains the score of the relevancy feature dimension of the sentence.
The sentence diversity characteristic dimension is then a score for the diversity of words within a sentence in the dialog system. Specifically, the server can determine the word segmentation length of each word segmentation in the sentence, and determine the number of the word segmentation corresponding to different word segmentation lengths according to the word segmentation length. And then determining the probability of the participle with each participle length in the sentence according to the number of the participles corresponding to the participle length and the participle number in the sentence. And then determining the score of the diversity characteristic dimension of the sentence according to the determined probability of the occurrence of the participle with each participle length in the sentence.
When the diversity characteristic dimension score of the statement sentence is calculated, a formula can be adopted:
Figure 525910DEST_PATH_IMAGE011
n _ gram represents a segmentation of length n from front to back within a sentence,
Figure 846033DEST_PATH_IMAGE012
representing the probability of the occurrence of the current n _ gram,
Figure 10298DEST_PATH_IMAGE013
representing the score of the sentence in the sentence diversity feature dimension. Following the above example, the result of the word segmentation process performed by the server on a sentence is "breakfast/can/complement/body/energy/,/we/must/eat/breakfast/. V ", therefore, there are two types of length of word segmentation in this sentence, 1 and 2. For a 1 \ gram, that is, the participles with participle length of 1 are sequentially "breakfast, ok, complement, body, energy, we, definite, breakfast", for a total of 8 participles, therefore,
Figure 173295DEST_PATH_IMAGE014
is 8/12. Then, the probability of the 2 \ gram is obtained by the same method, and the score of the sentence diversity characteristic dimension can be obtained according to the formula for calculating the score of the sentence diversity characteristic dimension.
Finally, the sentence richness feature dimension is a score on the length of information contained in a sentence in the dialog system. Specifically, the server may determine the stop word and the non-stop word in each participle in the sentence according to a preset stop word table, and further determine the score of the richness feature dimension of the sentence according to the proportion of the participles belonging to the non-stop word in the sentence.
When the richness characteristic dimension score of the sentence is calculated, a formula can be adopted:
Figure 182839DEST_PATH_IMAGE015
Figure 623048DEST_PATH_IMAGE002
indicating the number of participles in a sentence, t indicating the position of each participle,
Figure 692635DEST_PATH_IMAGE003
representing the participle at position t within the sentence, stopwords representing the stop word,
Figure 93661DEST_PATH_IMAGE016
representing the score of the sentence in the feature dimension of sentence richness. Following the above example, the server obtains a statement in the historical dialog record of the dialog system that "breakfast supplements body energy and we must eat breakfast. "suppose that the stop words in the sentence are" possible "," in "," certain "," to "and" to "are determined by comparing the sentence with the preset stop word list. ", there are 5, the sentence has 12 participles, so the sentence has 5/12 of scores in the feature dimension of the sentence richness.
It should be noted that the preset prediction model may adopt a generation pretraining-2 (generic Pre-Training-2, gpt 2) model, a language model Embedding (ELMo) model, and the like, and what model is specifically used is not specifically limited in this specification, and it is sufficient to predict the text, and of course, the more powerful the model used, the better the prediction function. Moreover, because each participle or each sentence predicted by the model is not always the same as each participle or each sentence in the sentence, a similarity can be preset according to a specific scene or a requirement, so that the server can determine the probability of the participle or the sentence according to the preset similarity of the participle or the sentence, for example, for some stop words, namely words without any actual meaning, the stop words can be replaced under the condition that the expressed meaning is the same, for the participle with the actual meaning, the similarity can be set, and then the predicted participle matched with the adjacent participle can be determined according to the determined similarity.
S108: determining an optimization direction of the dialogue system according to the determined scores of at least one sentence on each feature dimension, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
In one or more embodiments of the present specification, after determining the score of a sentence in the preset fluency feature dimension, association feature dimension, sentence diversity feature dimension, and sentence richness feature dimension through the above steps S100 to S106, the server may further determine an optimization direction of the dialog system according to the determined score of at least one sentence in each feature dimension, and adjust parameters of the dialog system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
Specifically, after determining scores of different feature dimensions of at least one sentence in a history of the dialog system, the server may determine the optimization direction according to the scores. And then the parameters of the dialog system can be adjusted according to the optimization direction. If the scores of a sentence obtained by the server in the preset fluency feature dimension, relevance feature dimension, sentence diversity feature dimension, and sentence richness feature dimension are 0.8, 0.6, 0.2, and 0.5, respectively, it is said that the sentence output by the dialog system does not perform well on the sentence diversity, and therefore, the related parameters of the dialog system can be adjusted based on the optimization direction corresponding to the score, that is, the sentence diversity direction, to improve the sentence diversity of the sentence output by the dialog system.
In the above-described dialog system optimization method provided based on the present specification shown in fig. 1, first, a historical dialog record in the dialog system is obtained in response to a dialog system optimization instruction of a user. And performing word segmentation processing on each statement output by the dialog system in the historical dialog record, and determining each word segmentation in the statement and the number of words segmentation contained in the statement. Then, a user input sentence corresponding to the sentence is determined from the history dialog record. Determining the score of the sentence on a plurality of preset characteristic dimensions at least partially according to the sentence input by the user, each participle in the sentence, the position of each participle, the number of the participles, each participle and a preset stop word list. And finally, determining the optimization direction of the dialogue system according to the grade of the determined at least one sentence on each characteristic dimension, and adjusting the parameters of the dialogue system based on the determined optimization direction, wherein different characteristic dimensions correspond to different optimization directions. According to the method, aiming at each statement in a historical dialogue record of a dialogue system, determining a user input statement corresponding to the statement, each participle in the statement, the position and the number of the participles, each participle and a preset stop word list, further determining the score of the statement on a plurality of preset characteristic dimensions, and then determining the optimization direction of the dialogue system according to the score of at least one statement on the plurality of preset characteristic dimensions. The output sentences of the dialogue system can be scored on the single-round dialogue level, the multi-round dialogue level and the system level, then the optimization direction is determined according to the scoring, the parameter adjustment is carried out on the dialogue system based on the optimization direction, and the 'dialogue' capability of the dialogue system and people is improved.
In one or more embodiments of the present specification, instead of scoring a sentence by using a plurality of feature dimensions using the method in step S106, scoring may be performed by using another method.
Firstly, when the fluency feature dimension of the sentences is scored, the whole sentences can be input into the model through the pre-trained model, and the score of the fluency feature dimension is obtained. And comparing the connected participles in the sentence with a preset word bank capable of connecting the participles to obtain the connection degree of each connected participle of the sentence, determining the connection degree score of each connected participle, and determining the score of the fluency characteristic dimension of the sentence according to the determined connection degree score of each connected participle.
Secondly, when the sentence relevancy feature dimension is evaluated, each participle in a sentence and each participle in a user input sentence corresponding to the sentence can be used as a sample, each participle group with the relevance being in a preset range and the similarity being in a preset range after the sentence is compared with the user input sentence corresponding to the sentence is used as a label, and the evaluation model is trained. And then, applying a score model to the score of the relevance characteristic dimension of the sentence, inputting each participle in the sentence and each participle in the sentence input by the user into the score model, and determining the proportion of each participle group output by the prediction model in the total participle number of the sentence as the score of the sentence in the relevance characteristic dimension.
Then, when the sentence diversity characteristic dimension is scored, the number of the participles of each participle of the sentence in the word stock can be determined according to a preset diversity word stock, and the proportion of the participles is calculated to serve as the score of the sentence diversity characteristic dimension. A composite score may also be calculated as the sentence diversity score for the sentence, in conjunction with the grammar and sentence structure used by the sentence.
Finally, when the sentence richness degree is graded, not only the occupation ratio of the non-stop words can be calculated, but also the occupation ratio of idioms or unusual words used in the sentence can be calculated, the unusual words are some words containing uncommon words or some words with low use rate, a word bank can be preset, and the idioms and the unusual words in the sentence are compared. The sentence can also be compared with the corresponding user input sentence, and the occupation ratio of the participles which are different from the stop word is calculated.
It should be noted that, when the fluency feature dimension, the relevance feature dimension, the sentence diversity feature dimension, and the sentence richness feature dimension of a sentence are evaluated, the method used is not limited to the above method.
Further, since the dialog system can be applied to different "identity and character" virtual persons, the response of the dialog system to the question applied to the different "identity and character" virtual persons should have consistency, i.e. stability of the dialog system. Thus, in one or more embodiments of the present description, the stability feature dimension of a dialog system may be scored, with a higher score representing a better stability of the dialog system.
Specifically, the server may first determine a plurality of dialogue contexts in combination according to preset identity information and dialogue rules, and for each determined context, input a preset psychological consistency problem into the dialogue system, and determine a reply sentence of the dialogue system in the context. And then, aiming at least one preset psychological consistency problem, determining the grade of the stability characteristic dimension of the dialogue system according to the reply sentences output by the dialogue system under each context.
When the stability feature dimension of the dialog system is evaluated, the number of occurrences of the output response with the largest number of occurrences may be determined as a first numerical value and the total number of occurrences of the output response may be determined as a second numerical value for at least one preset psychological consistency question based on the output responses preset for each context in the dialog system for the preset psychological consistency question, and the stability score of the dialog system may be determined based on the first numerical value and the second numerical value. By scoring the stability feature dimension of the dialog system, the dialog system can still have stability when applied to virtual persons with different identity information and dialog rules, namely, the response to the question is consistent.
When the psychological consistency problem is preset, it may be a problem as shown in table 1, but is not limited to the psychological consistency problem shown in table 1. For convenience of illustration, it is assumed that the preset psychological consistency problem is the 10 th psychological consistency problem "do you donate money to charity" in table 1, and the reply sentences of the dialogue system corresponding to the virtual human obtained for the psychological consistency problem may be different due to the different preset identities and characters of the virtual human applied by the dialogue system. It can be further assumed that the preset avatar a is a luxury, the preset character of avatar B is selfish, the preset character of avatar C is goodwill, the identity of avatar D is a kid who does not know anything, and the preset dialog rule of avatar E is an aspect that answers to any questions tend to be "good". Therefore, assuming that the answers obtained after the question is input to the avatars a to E corresponding to the dialog system are "meeting", "don't see", "meeting", "don't know", and "meeting", respectively, it can be seen that, of the five answers, the answer that appears most frequently is "meeting", and therefore "meeting" can be set as a stable answer, and the proportion of the stable answer is determined to be 3/5, that is, 3/5 is the stability score of the dialog system.
Figure 906896DEST_PATH_IMAGE018
It should be noted that the above steps S100-S108 determine the scores of different feature dimensions of at least one sentence, and thus are based on the optimization direction of the dialog system obtained by a single round of dialog. In one or more embodiments of the present description, multiple rounds of conversations may also be scored to derive a direction of optimization for the conversation system based on the scoring of the multiple rounds of conversations.
Specifically, the server may determine the total number of sentences output by the dialog system in one historical dialog record in the dialog system and the score of each sentence in each feature dimension, and determine an average score of each sentence in the preset feature dimensions according to the determined scores of each sentence in the preset feature dimensions and the total number of sentences output by the dialog system. And further determining the optimization direction of the dialogue system according to the average scores of the sentences on a plurality of preset feature dimensions, and adjusting the parameters of the dialogue system based on the optimization direction.
That is, in order to provide a more accurate optimization direction for the dialog system, the server may determine the optimization direction of the dialog system by determining scores of different feature dimensions of a plurality of or all sentences (i.e., multiple rounds of dialog) in a historical dialog record, then averaging the scores of different feature dimensions of the historical dialog record, and determining the optimization direction of the dialog system based on the scores. By scoring different feature dimensions of the dialog system on all the multiple rounds of dialog to obtain the optimization direction of the dialog system, the special situation of single round of dialog can be avoided, and the optimization direction of the dialog system is more accurate.
Further, in one or more embodiments of the present description, system-level scoring of the dialog system may also be implemented to derive an optimal direction to the dialog system.
In particular, the server may determine a score in each feature dimension for each statement output by the dialog system in a plurality of historical dialog records in the dialog system, and determine a number of the plurality of historical dialog records. And then, for each historical dialogue record, determining the total number of sentences output by the dialogue system in the historical dialogue record, and determining the average score of the historical dialogue record on a plurality of preset characteristic dimensions according to the score of each sentence output by the dialogue system in the historical dialogue record on each characteristic dimension and the total number of sentences output by the dialogue system in the historical dialogue record. And the server can further determine the system scores of the dialogue system on the preset characteristic dimensions according to the average scores of the historical dialogue records on the preset characteristic dimensions and the number of the historical dialogue records. Finally, the server can determine the optimization direction of the dialog system according to the system scores of the dialog system on a plurality of preset feature dimensions, and adjust the parameters of the dialog system based on the optimization direction.
In a simple way, the server may obtain all historical dialogue records of the dialogue system, and then calculate scores of each sentence in each historical dialogue record in different feature dimensions, so as to obtain scores of each historical dialogue record in different feature dimensions. Then, according to the total number of the historical dialogue records in the dialogue system and the scores of each historical dialogue record in different feature dimensions, the average score of each historical dialogue record in different feature dimensions is determined, and the scores of the dialogue system in different feature dimensions are obtained. And obtaining scores of the dialogue system in different feature dimensions based on a system level, further obtaining an optimization direction according to the scores, and adjusting parameters of the dialogue system based on the optimization direction to score the dialogue system to a greater extent. Thus, the resulting optimization direction is made more accurate.
It should be noted that, in one or more embodiments of the present specification, when the dialog system is scored based on single-turn dialog, multiple-turn dialog, and system level, the scoring of the stability feature dimension may be combined to make the optimization of the dialog system better, that is, make the dialog capability of the optimized dialog system stronger.
Based on the above method for optimizing a dialog system, an embodiment of the present specification further provides a schematic diagram of an apparatus for optimizing a dialog system, as shown in fig. 2.
Fig. 2 is a schematic diagram of an apparatus for dialog system optimization provided in an embodiment of the present specification, where the apparatus includes:
an obtaining module 200, configured to respond to a dialog system optimization instruction of a user, and obtain a historical dialog record in the dialog system;
a first determining module 202, configured to perform word segmentation processing on each statement output by the dialog system in the historical dialog record, and determine each word segmentation in the statement and the number of words segmentation included in the statement;
a second determining module 204, configured to determine, according to the historical dialog record, a user input sentence corresponding to the sentence;
a scoring module 206, configured to determine a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, a position of each participle, the number of participles, and a preset stop word list;
an optimization module 208, configured to determine an optimization direction of the dialog system according to the score of the determined at least one statement in each feature dimension, and adjust a parameter of the dialog system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
Optionally, the scoring module 206 is specifically configured to, for each segmented word, input the segmented word into a preset prediction model, and determine a probability that the prediction model connects each prediction segmented word after outputting the segmented word; determining adjacent participles after the participle according to the position of each participle; determining a predicted participle matched with the adjacent participle from each predicted participle, and determining the probability corresponding to the matched predicted participle as the position score of the adjacent participle; and determining the score of the fluency characteristic dimension of the sentence according to the determined position score of each adjacent word and the number of the words in the sentence.
Optionally, the scoring module 206 is specifically configured to determine similarity between the adjacent segmented words and each predicted segmented word; and determining the predicted participles matched with the adjacent participles according to the determined similarity.
Optionally, the scoring module 206 is specifically configured to, for each participle, input the participle and the user input sentence into a preset prediction model, and determine a probability that each prediction participle is connected after the participle in the sentence output by the prediction model is output; determining adjacent participles after the participle according to the position of each participle in the sentence; determining a prediction participle matched with the adjacent participle from each prediction participle, and determining the probability corresponding to the matched prediction participle as a position score of the adjacent participle; determining the probability of the sentence output by the dialogue system when the user inputs the sentence according to the position score of each adjacent participle; and determining the score of the relevance characteristic dimension of the sentence according to the determined probability of the sentence and the number of the participles in the sentence.
Optionally, the scoring module 206 is specifically configured to determine a word segmentation length of each word segmentation in the sentence; determining the number of the participles corresponding to different participle lengths according to the participle lengths; for each word segmentation length, determining the probability of the word segmentation with the word segmentation length in the sentence according to the number of the word segmentation corresponding to the word segmentation length and the number of the word segmentation in the sentence; and determining the score of the diversity characteristic dimension of the sentence according to the determined probability of the occurrence of the participles with the participle length in the sentence.
Optionally, the scoring module 206 is specifically configured to determine a stop word and a non-stop word in each participle according to a preset stop word table; and determining the score of the richness characteristic dimension of the sentence according to the proportion of the participles belonging to the non-stop words in the sentence.
Optionally, the scoring module 206 is further configured to combine and determine a plurality of conversation contexts according to preset identity information and conversation rules; inputting preset psychological consistency problems into the dialogue system aiming at each determined context, and determining a reply sentence of the dialogue system under the context; aiming at least one preset psychological consistency problem, determining the grade of the stability characteristic dimension of the dialogue system according to reply sentences output by the dialogue system under each context; wherein the stability score represents a stability of the dialog system.
Optionally, the scoring module 206 is further configured to determine, for at least one preset psychological consistency problem, a preset reply sentence for the preset psychological consistency problem in each context in the dialogue system; determining the occurrence frequency of the reply sentences with the same content and the maximum occurrence frequency of the reply sentences as a first numerical value and determining the total number of the reply sentences as a second numerical value for each determined reply sentence; determining a stability score of the dialog system based on the first value and the second value.
Optionally, the optimization module 208 is specifically configured to determine a total number of sentences output by the dialog system and a score of each sentence in each feature dimension in one historical dialog record in the dialog system; determining the average score of each sentence on a plurality of preset characteristic dimensions according to the determined scores of each sentence on the plurality of preset characteristic dimensions and the total number of the sentences output by the dialogue system; determining an optimization direction of the dialog system according to the average score, and adjusting parameters of the dialog system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
Optionally, the optimization module 208 is specifically configured to determine a score of each statement output by the dialog system in each feature dimension in a plurality of historical dialog records in the dialog system, and determine the number of the plurality of historical dialog records; for each historical dialogue record, determining the total number of sentences output by the dialogue system in the historical dialogue record, and determining the average score of the historical dialogue record on a plurality of preset characteristic dimensions according to the score of each sentence output by the dialogue system in the historical dialogue record on each characteristic dimension and the total number of sentences output by the dialogue system in the historical dialogue record; determining system scores of the dialogue system on a plurality of preset characteristic dimensions according to the average scores of the historical dialogue records on the plurality of preset characteristic dimensions and the number of the historical dialogue records; determining the optimization direction of the dialogue system according to system scores of the dialogue system on a plurality of preset feature dimensions, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
The present specification also provides a computer readable storage medium, which stores a computer program, and the computer program can be used to execute the dialog system optimization method described above.
Based on the above-mentioned method for optimizing a dialog system, an embodiment of the present specification further provides a schematic structural diagram of the electronic device shown in fig. 3. As shown in fig. 3, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs the computer program, so as to implement the method for optimizing the dialog system described above.
Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises that element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present specification should be included in the scope of the claims of the present application.

Claims (13)

1. A method for dialog system optimization, the method comprising:
responding to a dialog system optimization instruction of a user, and acquiring a historical dialog record in the dialog system;
for each statement output by the dialog system in the historical dialog record, performing word segmentation processing on the statement, and determining each word segmentation in the statement and the number of words segmentation contained in the statement;
determining a user input statement corresponding to the statement according to the historical dialogue record;
determining a score of the sentence in a plurality of preset feature dimensions at least partially according to the user input sentence, each participle in the sentence, the position of each participle, the number of the participles and a preset stop word list;
determining an optimization direction of the dialogue system according to the determined scores of at least one sentence on each feature dimension, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
2. The method of claim 1, wherein determining a score for a sentence in a predetermined plurality of feature dimensions based at least in part on the user input sentence, each participle in the sentence, a location of the participle, a number of the participles, and a predetermined stop word list comprises:
aiming at each participle, inputting the participle into a preset prediction model, and determining the probability of connecting each prediction participle after the prediction model outputs the participle;
determining adjacent participles after the participle according to the position of each participle;
determining a predicted participle matched with the adjacent participle from each predicted participle, and determining the probability corresponding to the matched predicted participle as the position score of the adjacent participle;
and determining the score of the fluency characteristic dimension of the sentence according to the determined position score of each adjacent word and the number of the words in the sentence.
3. The method of claim 2, wherein determining the predicted participle from each predicted participle that matches the neighboring participle specifically comprises:
determining the similarity between the adjacent participles and each predicted participle;
and determining the predicted participles matched with the adjacent participles according to the determined similarity.
4. The method of claim 1, wherein determining a score for the sentence in a predetermined plurality of feature dimensions based at least in part on the user input sentence, the tokens in the sentence, the positions of the tokens, the number of tokens, and a predetermined stop word list comprises:
aiming at each participle, inputting the participle and the user input sentence into a preset prediction model, and determining the probability corresponding to each prediction participle connected with the participle in the sentence output by the prediction model;
determining adjacent participles after the participle according to the position of each participle in the sentence;
determining a prediction participle matched with the adjacent participle from each prediction participle, and determining the probability corresponding to the matched prediction participle as a position score of the adjacent participle;
determining the probability of the sentence output by the dialogue system when the user inputs the sentence according to the position score of each adjacent participle;
and determining the score of the relevance characteristic dimension of the sentence according to the determined probability of the sentence and the number of the participles in the sentence.
5. The method of claim 1, wherein determining a score for the sentence in a predetermined plurality of feature dimensions based at least in part on the user input sentence, the tokens in the sentence, the positions of the tokens, the number of tokens, and a predetermined stop word list comprises:
determining the word segmentation length of each word segmentation in the sentence;
determining the number of the participles corresponding to different participle lengths according to the participle lengths;
for each word segmentation length, determining the probability of the word segmentation with the word segmentation length in the sentence according to the number of the word segmentation corresponding to the word segmentation length and the number of the word segmentation in the sentence;
and determining the score of the diversity characteristic dimension of the sentence according to the determined probability of the occurrence of the participles with the participle length in the sentence.
6. The method of claim 1, wherein determining a score for a sentence in a predetermined plurality of feature dimensions based at least in part on the user input sentence, each participle in the sentence, a location of the participle, a number of the participles, and a predetermined stop word list comprises:
determining stop words and non-stop words in each participle according to a preset stop word list;
and determining the score of the richness characteristic dimension of the sentence according to the proportion of the participles belonging to the non-stop words in the sentence.
7. The method of claim 1, wherein the method further comprises:
combining and determining a plurality of conversation contexts according to preset identity information and conversation rules;
inputting preset psychological consistency problems into the dialogue system aiming at each determined context, and determining a reply sentence of the dialogue system under the context;
aiming at least one preset psychological consistency problem, determining the grade of the stability characteristic dimension of the dialogue system according to reply sentences output by the dialogue system under each context;
wherein the stability score represents the stability of the dialog system.
8. The method of claim 7, wherein determining a score for a stability feature dimension of the dialog system based on reply sentences output by the dialog system in each context comprises:
for at least one preset psychological consistency problem, determining a reply sentence preset in each context of the dialogue system for the preset psychological consistency problem;
determining the occurrence frequency of the reply sentences with the same content and the maximum occurrence frequency of the reply sentences as a first numerical value and determining the total number of the reply sentences as a second numerical value for each determined reply sentence;
determining a stability score of the dialog system based on the first value and the second value.
9. The method according to claim 1, wherein determining an optimization direction of the dialog system based on the determined scores of the at least one sentence in the feature dimensions comprises:
determining the total number of sentences output by the dialogue system and the score of each sentence on each characteristic dimension in a historical dialogue record in the dialogue system;
determining the average score of each sentence on a plurality of preset characteristic dimensions according to the determined scores of each sentence on the plurality of preset characteristic dimensions and the total number of the sentences output by the dialogue system;
determining an optimization direction of the dialog system according to the average score, and adjusting parameters of the dialog system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
10. The method according to claim 1, wherein determining an optimization direction of the dialog system based on the determined scores of the at least one sentence in each feature dimension comprises:
determining a score of each statement output by the dialog system in each feature dimension in a plurality of historical dialog records in the dialog system, and determining a number of the plurality of historical dialog records;
for each historical dialogue record, determining the total number of sentences output by the dialogue system in the historical dialogue record, and determining the average score of the historical dialogue record on a plurality of preset characteristic dimensions according to the score of each sentence output by the dialogue system in the historical dialogue record on each characteristic dimension and the total number of the sentences output by the dialogue system in the historical dialogue record;
determining system scores of the dialogue system on a plurality of preset characteristic dimensions according to the average scores of the historical dialogue records on the plurality of preset characteristic dimensions and the number of the historical dialogue records;
determining an optimization direction of the dialogue system according to system scores of the dialogue system on a plurality of preset feature dimensions, and adjusting parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
11. An apparatus for dialog system optimization, the apparatus comprising:
the acquisition module is used for responding to a dialogue system optimization instruction of a user and acquiring a historical dialogue record in the dialogue system;
the first determining module is used for performing word segmentation processing on each statement output by the dialog system in the historical dialog record, and determining each word segmentation in the statement and the number of the words segmentation contained in the statement;
the second determining module is used for determining a user input statement corresponding to the statement according to the historical dialogue record;
a scoring module for determining a score of the sentence in a plurality of predetermined feature dimensions based at least in part on the user input sentence, each participle in the sentence, a position of each participle, the number of participles, and a predetermined stop word list;
the optimization module is used for determining the optimization direction of the dialogue system according to the score of the determined at least one statement on each feature dimension, and adjusting the parameters of the dialogue system based on the optimization direction; wherein different feature dimensions correspond to different optimization directions.
12. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 10.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1-10 when executing the program.
CN202211558771.3A 2022-12-06 2022-12-06 Method and device for optimizing dialog system, storage medium and electronic equipment Active CN115640392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211558771.3A CN115640392B (en) 2022-12-06 2022-12-06 Method and device for optimizing dialog system, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211558771.3A CN115640392B (en) 2022-12-06 2022-12-06 Method and device for optimizing dialog system, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN115640392A true CN115640392A (en) 2023-01-24
CN115640392B CN115640392B (en) 2023-04-07

Family

ID=84948411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211558771.3A Active CN115640392B (en) 2022-12-06 2022-12-06 Method and device for optimizing dialog system, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115640392B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080256052A1 (en) * 2007-04-16 2008-10-16 International Business Machines Corporation Methods for determining historical efficacy of a document in satisfying a user's search needs
EP3244403A1 (en) * 2016-05-09 2017-11-15 Fujitsu Limited Dialogue processing program, dialogue processing method, and information processing device
CN109977207A (en) * 2019-03-21 2019-07-05 网易(杭州)网络有限公司 Talk with generation method, dialogue generating means, electronic equipment and storage medium
CN111984770A (en) * 2020-07-17 2020-11-24 深思考人工智能科技(上海)有限公司 Man-machine conversation method and device
CN113793611A (en) * 2021-08-27 2021-12-14 上海浦东发展银行股份有限公司 Scoring method, scoring device, computer equipment and storage medium
WO2022048170A1 (en) * 2020-09-02 2022-03-10 平安科技(深圳)有限公司 Method and apparatus for conducting human-machine conversation, computer device, and storage medium
CN115186096A (en) * 2021-04-07 2022-10-14 腾讯科技(深圳)有限公司 Recognition method, device, medium and electronic equipment for specific type word segmentation
CN115203394A (en) * 2022-07-20 2022-10-18 北京三快在线科技有限公司 Model training method, service execution method and device
CN115391503A (en) * 2022-08-09 2022-11-25 北京三快在线科技有限公司 Application method and device of session flow

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080256052A1 (en) * 2007-04-16 2008-10-16 International Business Machines Corporation Methods for determining historical efficacy of a document in satisfying a user's search needs
EP3244403A1 (en) * 2016-05-09 2017-11-15 Fujitsu Limited Dialogue processing program, dialogue processing method, and information processing device
CN109977207A (en) * 2019-03-21 2019-07-05 网易(杭州)网络有限公司 Talk with generation method, dialogue generating means, electronic equipment and storage medium
CN111984770A (en) * 2020-07-17 2020-11-24 深思考人工智能科技(上海)有限公司 Man-machine conversation method and device
WO2022048170A1 (en) * 2020-09-02 2022-03-10 平安科技(深圳)有限公司 Method and apparatus for conducting human-machine conversation, computer device, and storage medium
CN115186096A (en) * 2021-04-07 2022-10-14 腾讯科技(深圳)有限公司 Recognition method, device, medium and electronic equipment for specific type word segmentation
CN113793611A (en) * 2021-08-27 2021-12-14 上海浦东发展银行股份有限公司 Scoring method, scoring device, computer equipment and storage medium
CN115203394A (en) * 2022-07-20 2022-10-18 北京三快在线科技有限公司 Model training method, service execution method and device
CN115391503A (en) * 2022-08-09 2022-11-25 北京三快在线科技有限公司 Application method and device of session flow

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ZHU XIAO-LIANG: "Design of Integrated Multi-mode Service Platform for E-learning" *
方艺臻: "基于深度学习的开放域情感对话生成研究" *
贾熹滨;李让;胡长建;陈军成;: "智能对话系统研究综述" *

Also Published As

Publication number Publication date
CN115640392B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
Williams et al. A broad-coverage challenge corpus for sentence understanding through inference
CN107368524B (en) Dialog generation method and device and electronic equipment
CN105575386B (en) Audio recognition method and device
WO2019165331A1 (en) Systems and methods for generating jokes
CN116227474B (en) Method and device for generating countermeasure text, storage medium and electronic equipment
CN106776936A (en) intelligent interactive method and system
CN112735374B (en) Automatic voice interaction method and device
CN110457449B (en) Method, device, equipment and storage medium for training model online
CN110032730B (en) Text data processing method, device and equipment
CN109284502B (en) Text similarity calculation method and device, electronic equipment and storage medium
CN109165291A (en) A kind of text matching technique and electronic equipment
CN110633359B (en) Sentence equivalence judgment method and device
CN115545002B (en) Model training and business processing method, device, storage medium and equipment
CN114880472A (en) Data processing method, device and equipment
WO2022226131A1 (en) Active listening for assistant systems
CN113887206B (en) Model training and keyword extraction method and device
Basu et al. Multimodal sentiment analysis of# metoo tweets using focal loss (grand challenge)
CN117392694B (en) Data processing method, device and equipment
CN117076650B (en) Intelligent dialogue method, device, medium and equipment based on large language model
CN116127328B (en) Training method, training device, training medium and training equipment for dialogue state recognition model
CN115640392B (en) Method and device for optimizing dialog system, storage medium and electronic equipment
CN117113174A (en) Model training method and device, storage medium and electronic equipment
CN114676257A (en) Conversation theme determining method and device
CN116127316A (en) Model training method, text abstract generating method and related equipment
Liu et al. Out-of-scope domain and intent classification through hierarchical joint modeling

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