CN116881410A - Person setting consistency method and device based on dialogue system, electronic equipment and medium - Google Patents

Person setting consistency method and device based on dialogue system, electronic equipment and medium Download PDF

Info

Publication number
CN116881410A
CN116881410A CN202310648633.2A CN202310648633A CN116881410A CN 116881410 A CN116881410 A CN 116881410A CN 202310648633 A CN202310648633 A CN 202310648633A CN 116881410 A CN116881410 A CN 116881410A
Authority
CN
China
Prior art keywords
text
setting information
reply
preset
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310648633.2A
Other languages
Chinese (zh)
Inventor
林凌峰
李剑锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202310648633.2A priority Critical patent/CN116881410A/en
Publication of CN116881410A publication Critical patent/CN116881410A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Databases & Information Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to the field of natural language, and discloses a person setting consistent method, a device, electronic equipment and a storage medium based on a dialogue system, which can be used for a question-answering scene of an intelligent outbound robot in the financial industry, wherein the method comprises the following steps: carrying out data enhancement on the person setting information text to obtain a target person setting information text; when receiving a current question text input by a user, splicing the historical dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text according to the spliced text; the candidate reply text sets are subjected to scoring rearrangement, and the candidate reply text with the highest score is used as the best reply text; calculating the similarity between the optimal reply text and the target person setting information text, and selecting the preset number of target person setting information with the highest similarity; and correcting the optimal reply text according to the target person setting information to obtain a target reply text. The invention can improve the consistency of the personnel setting and the reply diversity of the dialogue system.

Description

Person setting consistency method and device based on dialogue system, electronic equipment and medium
Technical Field
The present invention relates to the field of natural language, and in particular, to a method, an apparatus, an electronic device, and a readable storage medium for human setting consistency based on a dialogue system.
Background
The dialogue system refers to a question and answer system which can respond to the questions presented by the user according to the set personal settings, for example, in a credit card center department of the financial industry, the user can be guided to conduct operations such as card handling through an intelligent outbound robot method.
The conventional method for setting consistency by people based on a dialogue system mostly carries out intention recognition on a user question, when the user question does not directly contain the setting information of the question dialogue system, the user cannot be accurately recognized by an intention recognition module in the dialogue system to be related to the setting information of the person, but the user can directly use a dialogue model to generate a reply, so that the reply is inconsistent with the setting information of the person.
Disclosure of Invention
The invention provides a person setting consistency method, device, electronic equipment and readable storage medium based on a dialogue system, which effectively solve the problem that an intelligent external calling robot of a customer service department in the financial field replies non-uniquely or returns errors.
In order to achieve the above object, the present invention provides a method for people to agree on a dialogue system, the method comprising:
acquiring a person setting information text of a dialogue system, and carrying out data enhancement on the person setting information text to obtain a target person setting information text;
acquiring a history dialogue text, when receiving a current question text input by a user, splicing the history dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text;
grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, and taking the candidate reply text with the highest grading in the candidate reply text set as the best reply text;
calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
And correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
Optionally, the predicting, according to the spliced text, the candidate reply text set of the current question text by using a preset dialogue generation model includes:
extracting a history reply text in a dialogue system corresponding to the history dialogue text;
splicing each historical reply text with the spliced text to obtain a secondary spliced text, and adding a preset spacer at the spliced position of each secondary spliced text to obtain a target spliced text;
coding the target spliced text to obtain a target spliced text coding vector;
performing linear transformation on the target spliced text coding vector, and mapping the target spliced text coding vector after linear transformation into a spliced text scalar;
calculating the probability of the spliced text scalar by using a preset normalization function;
selecting the spliced text scalar with the probability larger than a preset threshold value from the target spliced text scalar as a target spliced text scalar;
and taking the historical reply text corresponding to the target spliced text scalar as a candidate reply text, and summarizing all the candidate reply texts to obtain a candidate reply text set.
Optionally, the scoring rearrangement of the candidate reply text set by using a preset dialogue evaluation model includes:
splicing the current question text with each candidate reply text in the candidate reply text set to obtain a user personalized spliced text;
coding each user individual spliced text by using a coding module in a preset dialogue evaluation model to obtain a user individual spliced text coding vector;
calculating a personality weight value of each user personality splicing text encoding vector by using a self-attention mechanism module in the dialogue evaluation model;
and sequencing the candidate reply texts in the candidate reply text set according to the personality weight value to obtain a rearranged candidate reply text set.
Optionally, the calculating the similarity between the best reply text and the target person information text by using a preset vector similarity calculation model includes:
dividing the best reply text to obtain a best reply clause set;
coding the best reply clause set and the target person set information text by using a coding module in a preset vector similarity calculation model to obtain clause coding vectors and person set coding vectors;
Respectively carrying out pooling dimension reduction on the clause coding vector and the human-set coding vector by using a pooling module in a preset vector similarity calculation model to obtain a dimension-reduced clause vector and a dimension-reduced human-set vector;
and calculating the similarity between the dimensionality reduction clause vector and the dimensionality reduction human set vector by using a cosine similarity calculation formula.
Optionally, the calculating the similarity between the dimensionality reduction clause vector and the dimensionality reduction human set vector by using a cosine similarity calculation formula includes:
calculating the similarity score of the dimension reduction clause vector and the dimension reduction human set vector by using the following formula i
wherein ,representing the dimension-reducing human set vector, V i T A transpose matrix of the dimensionality reduction clause vector representing the ith clause, V i And the dimension-reducing clause vector representing the ith clause, wherein i represents the ith clause.
Optionally, the correcting the best reply text by using a preset text correction model according to the preset number of target people setting information to obtain a target reply text includes:
coding the target person setting information and the optimal reply text by using a coding module in a preset text error correction model to obtain person setting information coding vectors and reply text coding vectors;
According to the person-set information coding vector, calculating a weight value of the reply text coding vector by using an attention mechanism module in the text error correction model;
searching a target person setting information text corresponding to the reply text coding vector with low weight value in the weight values;
and replacing the reply text corresponding to the reply text coding vector with low weight value in the weight value by using the target person setting information text corresponding to the reply text coding vector with low weight value in the weight value to obtain the reply text.
Optionally, the data enhancement is performed on the person setting information text to obtain a target person setting information text, including:
performing back translation on the human-set information text by using a preset translation dictionary to obtain a back-translated human-set information text;
extracting text keywords in the personal information text;
matching the text keywords with phrases in a preset synonym dictionary to obtain synonym phrases successfully matched;
replacing the text keywords with the synonym phrases successfully matched to obtain a replacing person setting information text;
and integrating the back translation setting information text and the replacement setting information text to obtain a target setting information text.
In order to solve the above problems, the present invention also provides a personal setting conforming device based on a dialogue system, the device comprising:
the personal setting information enhancement module is used for acquiring a personal setting information text of the dialogue system and carrying out data enhancement on the personal setting information text to obtain a target personal setting information text;
the system comprises a person setting information selection module, a user setting information selection module and a target person setting information processing module, wherein the person setting information selection module is used for acquiring a historical dialogue text, splicing the historical dialogue text and the current question text when receiving a current question text input by a user, obtaining a spliced text, predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text, grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, taking the candidate reply text with the highest grading in the candidate reply text set as an optimal reply text, calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
and the reply text correction module is used for correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one computer program; and
And the processor executes the computer program stored in the memory to realize the person setting consistency method based on the dialogue system.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned dialog system based person agreement method.
According to the method, the target person setting information text is obtained through data enhancement of the person setting information sentence, diversity of the reply text is improved, further, a specific dialogue generation model is utilized to predict candidate reply texts of the current question text of a user, special training is not needed to be conducted on the model, difficulty in keeping person setting consistency in a dialogue system is reduced, secondly, a preset vector similarity calculation model is utilized to calculate the best reply text and the similarity of the target person setting information text, the target person setting information with the highest similarity is selected from the target person setting information text, the problem that only according to the problem but not generated reply judgment in the existing method is solved, whether person setting information is contained is guaranteed, accordingly, person setting consistency of the dialogue system is guaranteed, finally, the best reply text is corrected by utilizing a preset text error correction model, the person setting consistency of the reply text can be achieved without constructing a special data set for training the model, and sentence logic smoothness can be guaranteed. Therefore, the person setting consistency method, the device, the equipment and the storage medium based on the dialogue system can keep the person setting consistency and the reply diversity of the intelligent calling robot dialogue system of the credit card center department in the financial industry, reduce the working content of financial workers and improve the working efficiency of the financial workers.
Drawings
FIG. 1 is a flow chart of a method for human interaction based on a dialog system according to an embodiment of the present application;
FIGS. 2-3 are flowcharts illustrating a detailed implementation of one of the steps in a dialog system-based person-to-person method according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a dialog system-based personal identification assistant apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of an internal structure of an electronic device for implementing a person setting consistency method based on a dialogue system according to an embodiment of the present application;
the achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a person setting consistency method based on a dialogue system. The execution subject of the dialog system-based person-setting agreement method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the dialog system based person-to-person method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server may include an independent server, and may also include a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a method for setting consistency of people based on a dialogue system according to an embodiment of the present invention is shown, where in the embodiment of the present invention, the method for setting consistency of people based on a dialogue system includes:
s1, acquiring a person setting information text of a dialogue system, and carrying out data enhancement on the person setting information text to obtain a target person setting information text.
In the embodiment of the invention, the dialogue system can be an intelligent robot in man-machine interaction, for example, a dialogue guiding robot commonly found in a service hall in the financial industry. The person setting information text may be personal information set by a person responsible for the dialogue system, for example, the person setting information text of a common dialogue guiding robot in a service hall may be a name of a soldier, an age of 3 years, a hobby to play basketball, etc. The target personally set information text may be a different expression of the personally set information text, for example, the age 3 may be birth 2019, etc.
In an alternative embodiment of the invention, the person setting information of the dialogue system is known to the person responsible for the dialogue system, and then the person setting information is textized to obtain the person setting information text of the dialogue system, so that the person responsible for the dialogue system is convenient for carrying out data enhancement on the person setting information text, the person setting information of the dialogue system is diversified, for example, in the financial field, the person setting information text of the intelligent outbound robot in the center of the credit card needs to be acquired, the person setting information of the related outbound robot needs to be known to the person responsible for the intelligent outbound system, and the acquired person setting information is textized.
According to the embodiment of the invention, the target person setting information text is obtained by carrying out data enhancement on the person setting information text, so that the diversity of the person setting information of the dialogue system is ensured, the possibility of contradiction between the dialogue system reply and the person setting is reduced, and the consistency of the person setting of the dialogue system is ensured.
Further, as an optional embodiment of the present invention, referring to fig. 2, the step S1 of performing data enhancement on the text of the person setting information to obtain a text of the target person setting information includes:
s11, performing back translation on the person setting information text by using a preset translation dictionary to obtain a back translation person setting information text;
s12, extracting text keywords in the personal information text;
s13, matching the text keywords with phrases in a preset synonym dictionary to obtain synonym phrases successfully matched;
s14, replacing the text keywords with the synonymous word groups successfully matched to obtain a replacing person information text;
and S15, integrating the back translation setting information text and the replacement setting information text to obtain a target setting information text.
In the embodiment of the invention, the preset translation dictionary can be common translation software disclosed, for example, channel translation and the like. The preset synonym dictionary is composed of the phrase itself and synonyms of the phrase, for example, the synonyms of the age may be years.
In the alternative embodiment of the invention, the Chinese people setting information text can be translated into the English people setting information text by using the translation software, and then the English people setting information text is translated into the Chinese people setting information text by using the other translation software, so that the back translation people setting information text is obtained, and the diversity of the people setting information text is enriched.
Further, in another optional embodiment of the invention, the diversity of the personal information text is enriched from the keyword dimension by the way of synonym replacement, and the dialogue experience of the user is improved.
S2, acquiring a history dialogue text, when receiving a current question text input by a user, splicing the history dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text.
In the embodiment of the invention, the historical dialog text can be all dialog texts received by the dialog system in the past. The current question text may be a question posed by the current user, e.g., how old you are. The preset dialog generation model may be a GPT (generating Pre-Training) model for predicting text context.
In an alternative embodiment of the invention, the historical dialogue text can be obtained by searching a database storing the historical dialogue data in the dialogue system, so that the accuracy of prediction of the dialogue generation model is improved, and the consistency of the personnel setting of the dialogue system is ensured.
In another optional embodiment of the present invention, when receiving a current question text input by a user, the current question text is spliced in the historical dialogue text set, so as to provide more data references for prediction of a dialogue generation model, thereby improving the accuracy of prediction of the dialogue generation model, improving the accuracy of reply, and ensuring the consistency of the personnel settings of a dialogue system.
According to the embodiment of the invention, the candidate reply text set of the current question text is predicted by using the preset dialogue generation model according to the spliced text, and the special GPT model is adopted to intervene when the user interacts with the dialogue system, so that special training on the model is avoided, and the consumption of resources is reduced.
Further, as an optional embodiment of the present invention, referring to fig. 3, the predicting, in S2, the candidate reply text set of the current question text according to the spliced text by using a preset dialog generation model includes:
S21, extracting a history reply text in a dialogue system corresponding to the history dialogue text;
s22, splicing each historical reply text with the spliced text respectively to obtain a secondary spliced text, and adding a preset spacer at the spliced position of each secondary spliced text to obtain a target spliced text;
s23, coding the target spliced text to obtain a target spliced text coding vector;
s24, performing linear transformation on the target spliced text coding vector, and mapping the target spliced text coding vector after linear transformation into a spliced text scalar;
s25, calculating the probability of the spliced text scalar by using a preset normalization function;
s26, selecting the spliced text scalar with the probability larger than a preset threshold value from the target spliced text scalar as a target spliced text scalar;
and S27, taking the historical reply text corresponding to the target spliced text scalar as a candidate reply text, and summarizing all the candidate reply texts to obtain a candidate reply text set.
In the embodiment of the invention, the historical reply text may be a text which is replied by the dialogue system in the historical dialogue text, namely a set of reply texts to be selected. The preset spacer may be a < sep > identification. The preset normalization function may be a softmax function.
In an alternative embodiment of the invention, firstly, a history dialogue text and a current question text are subjected to seamless splicing, then the splicing result is respectively subjected to seamless splicing with each history reply text, namely, a < sep > mark is added in the middle of a splicing position, so that a [ history dialogue text, the current question text, < sep >, the history reply text ] target splicing text is obtained, the target splicing text is respectively input into a plurality of GPT structures, the back of each GPT structure is followed by linear transformation, further, the output of each GPT is mapped into a scalar, a plurality of scalars are obtained, and then the scalar is subjected to integral probability by using softmax, so that probability distribution in a scalar answer space is obtained, and the probability of the splicing text is calculated.
And S3, grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, and taking the candidate reply text with the highest grading in the candidate reply text set as the best reply text.
In the embodiment of the present invention, the preset dialogue evaluation model may be a transform-based ranking model, for example, a DialoGPT (dialogue generative pre-trained transformer, neural dialogue response generation) model, and the like. The set of candidate reply texts may be a set comprising a plurality of candidate reply texts.
According to the embodiment of the invention, the candidate reply text set is scored and rearranged by using the preset dialogue evaluation model, so that the best candidate reply text is selected from the candidate reply text set, the accuracy of the reply text is further improved, and the consistency of the dialogue system set by people is maintained.
Further, as an optional embodiment of the present invention, the scoring rearrangement of the candidate reply text set using the preset dialogue evaluation model in S3 includes:
splicing the current question text with each candidate reply text in the candidate reply text set to obtain a user personalized spliced text;
coding each user individual spliced text by using a coding module in a preset dialogue evaluation model to obtain a user individual spliced text coding vector;
calculating a personality weight value of each user personality splicing text encoding vector by using a self-attention mechanism module in the dialogue evaluation model;
and sequencing the candidate reply texts in the candidate reply text set according to the personality weight value to obtain a rearranged candidate reply text set.
In an alternative embodiment of the present invention, when a preset dialogue generation model is used to predict the candidate reply text set of the current question text, only candidate reply texts conforming to the dialogue system logic and the human settings are selected, but the candidate reply texts are not screened according to the personality of the user, so that the candidate reply texts also need to be rearranged according to the personality of the user, thereby enabling the dialogue system to more humanize the reply of the user and improving the experience of the user.
In an optional embodiment of the present invention, when the rearrangement of the candidate reply text set is completed, in order to ensure accuracy and consistency of reply text, the candidate reply text with the highest score needs to be selected from the rearranged candidate text set as the best reply text.
S4, calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text.
In the embodiment of the present invention, the preset vector similarity calculation model may be a model for calculating vector similarity based on a Bert (BidirectionalEncoder Representations from Transformer, pre-trained language representation) model, for example, a Sentence-Bert model, etc.
According to the embodiment of the invention, the similarity between the optimal reply text and the target person information text is calculated by using the preset vector similarity calculation model, and the speed of similarity calculation is improved on the premise of ensuring the quality of the optimal reply text, so that the reply efficiency of a dialogue system is improved.
Further, as an optional embodiment of the present invention, the calculating, using a preset vector similarity calculation model, the similarity between the best reply text and the target person information text includes:
Dividing the best reply text to obtain a best reply clause set;
coding the best reply clause set and the target person set information text by using a coding module in a preset vector similarity calculation model to obtain clause coding vectors and person set coding vectors;
respectively carrying out pooling dimension reduction on the clause coding vector and the human-set coding vector by using a pooling module in a preset vector similarity calculation model to obtain a dimension-reduced clause vector and a dimension-reduced human-set vector;
and calculating the similarity between the dimensionality reduction clause vector and the dimensionality reduction human set vector by using a cosine similarity calculation formula.
In the embodiment of the present invention, the pooling module may be a module for performing dimension reduction by using a convolution check to check the clause code vector and the human set code vector.
In an alternative embodiment of the invention, the Sentence-BERT model is adopted to simultaneously encode and pool the best reply clause set and the target person set information text, and further, the similarity between the best reply clause set and the target person set information text after pooling is calculated, thereby saving a great amount of similarity calculation time and improving the reply efficiency of a dialogue system.
Further, as an optional embodiment of the present invention, the calculating, using a cosine similarity calculation formula, a similarity between the dimension-reducing clause vector and the dimension-reducing human set vector includes:
calculating the similarity score of the dimension reduction clause vector and the dimension reduction human set vector by using the following formula i
wherein ,representing the dimension-reducing human set vector, V i T A transpose matrix of the dimensionality reduction clause vector representing the ith clause, V i And the dimension-reducing clause vector representing the ith clause, wherein i represents the ith clause.
In the embodiment of the invention, the similarity between the dimension-reducing clause vector and the dimension-reducing person setting vector is calculated, and the preset number of target person setting information with the highest similarity is selected from the target person setting information texts, so that the content of person setting information packages of the text replied by the dialogue system is ensured, the precision of the text replied by the dialogue system is improved, and the consistency of person setting of the dialogue system is ensured.
S5, correcting the optimal reply text by using a preset text error correction model according to the preset number of target person setting information to obtain a target reply text.
In the embodiment of the present invention, the preset number may be a number set in advance by a researcher of the dialogue system. The preset text error correction model may be a model trained based on GPT.
According to the preset number of target person setting information, the embodiment of the invention corrects the optimal reply text by using the preset text error correction model to obtain the target reply text, thereby completing interaction between a user and a dialogue system, reducing the error rate of the reply text of the dialogue system and ensuring the consistency of the dialogue system.
Further, as an optional embodiment of the present invention, the step S5 includes:
coding the target person setting information and the optimal reply text by using a coding module in a preset text error correction model to obtain person setting information coding vectors and reply text coding vectors;
according to the person-set information coding vector, calculating a weight value of the reply text coding vector by using an attention mechanism module in the text error correction model;
searching a target person setting information text corresponding to the reply text coding vector with low weight value in the weight values;
and replacing the reply text corresponding to the reply text coding vector with low weight value in the weight value by using the target person setting information text corresponding to the reply text coding vector with low weight value in the weight value to obtain the reply text.
In an alternative embodiment of the invention, a text error correction model is utilized to screen out phrases or clauses which do not accord with the target person setting information from the optimal reply text, and the phrases or clauses are modified according to the target person setting information text to obtain the target reply text, thereby ensuring the consistency of the dialogue system reply text and the dialogue system person setting, avoiding the occurrence of contradictions and improving the user experience.
Fig. 4 is a functional block diagram of a personal setting agreement device based on the dialogue system according to the present invention.
The dialog system based personal setting agreement device 100 of the present invention may be installed in an electronic apparatus. Depending on the implementation, the dialog system based personally configuring means 100 may include a personally configuring information enhancing module 101, a personally configuring information selecting module 102, and a reply text modifying module 103, which may also be referred to as a unit, which refers to a series of computer program segments capable of being executed by a processor of an electronic device and performing a fixed function, and stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the person setting information enhancement module 101 is configured to obtain a person setting information text of a dialogue system, and perform data enhancement on the person setting information text to obtain a target person setting information text.
The person setting information selection module 102 is configured to obtain a history dialogue text, splice the history dialogue text and the current question text when receiving a current question text input by a user, obtain a spliced text, predict a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text, score and reorder the candidate reply text set by using a preset dialogue evaluation model, use a candidate reply text with the highest score in the candidate reply text set as an optimal reply text, calculate similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and select a preset number of target person setting information with the highest similarity from the target person setting information text.
The reply text correction module 103 is configured to correct the best reply text by using a preset text correction model according to the preset number of target people setting information, so as to obtain a target reply text.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a person setting agreement method based on a dialogue system according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a personal profile based dialog system.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes based on a personal agreement program of a dialogue system, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, executes or executes programs or modules (e.g., a person-based agreement program based on a dialogue system, etc.) stored in the memory 11, and invokes data stored in the memory 11 to perform various functions of the electronic device and process the data.
The communication bus 12 may be a peripheral component interconnect standard (PerIPheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Fig. 5 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 5 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
Optionally, the communication interface 13 may comprise a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The dialog system based person agreement program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs which, when run in the processor 10, can realize:
acquiring a person setting information text of a dialogue system, and carrying out data enhancement on the person setting information text to obtain a target person setting information text;
acquiring a history dialogue text, when receiving a current question text input by a user, splicing the history dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text;
Grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, and taking the candidate reply text with the highest grading in the candidate reply text set as the best reply text;
calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
and correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the electronic device 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. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the 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).
Embodiments of the present invention may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a person setting information text of a dialogue system, and carrying out data enhancement on the person setting information text to obtain a target person setting information text;
acquiring a history dialogue text, when receiving a current question text input by a user, splicing the history dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text;
grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, and taking the candidate reply text with the highest grading in the candidate reply text set as the best reply text;
calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
and correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed electronic device, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention 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. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method for person-to-person correspondence based on a dialog system, the method comprising:
acquiring a person setting information text of a dialogue system, and carrying out data enhancement on the person setting information text to obtain a target person setting information text;
acquiring a history dialogue text, when receiving a current question text input by a user, splicing the history dialogue text and the current question text to obtain a spliced text, and predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text;
Grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, and taking the candidate reply text with the highest grading in the candidate reply text set as the best reply text;
calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
and correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
2. The dialog system based person-to-person correspondence method of claim 1, wherein predicting the candidate reply text set of the current question text using a preset dialog generation model from the spliced text comprises:
extracting a history reply text in a dialogue system corresponding to the history dialogue text;
splicing each historical reply text with the spliced text to obtain a secondary spliced text, and adding a preset spacer at the spliced position of each secondary spliced text to obtain a target spliced text;
Coding the target spliced text to obtain a target spliced text coding vector;
performing linear transformation on the target spliced text coding vector, and mapping the target spliced text coding vector after linear transformation into a spliced text scalar;
calculating the probability of the spliced text scalar by using a preset normalization function;
selecting the spliced text scalar with the probability larger than a preset threshold value from the target spliced text scalar as a target spliced text scalar;
and taking the historical reply text corresponding to the target spliced text scalar as a candidate reply text, and summarizing all the candidate reply texts to obtain a candidate reply text set.
3. The dialog system based person-to-person correspondence method of claim 1, wherein the scoring rearrangement of the candidate reply text sets using a preset dialog assessment model comprises:
splicing the current question text with each candidate reply text in the candidate reply text set to obtain a user personalized spliced text;
coding each user individual spliced text by using a coding module in a preset dialogue evaluation model to obtain a user individual spliced text coding vector;
Calculating a personality weight value of each user personality splicing text encoding vector by using a self-attention mechanism module in the dialogue evaluation model;
and sequencing the candidate reply texts in the candidate reply text set according to the personality weight value to obtain a rearranged candidate reply text set.
4. The dialog system-based person-to-person correspondence method of claim 1, wherein calculating the similarity of the best reply text and the target person-to-person information text using a preset vector similarity calculation model comprises:
dividing the best reply text to obtain a best reply clause set;
coding the best reply clause set and the target person set information text by using a coding module in a preset vector similarity calculation model to obtain clause coding vectors and person set coding vectors;
respectively carrying out pooling dimension reduction on the clause coding vector and the human-set coding vector by using a pooling module in a preset vector similarity calculation model to obtain a dimension-reduced clause vector and a dimension-reduced human-set vector;
and calculating the similarity between the dimensionality reduction clause vector and the dimensionality reduction human set vector by using a cosine similarity calculation formula.
5. The dialog system based person-setting agreement method of claim 4, wherein the calculating the similarity of the dimension-reduction clause vector and the dimension-reduction person-setting vector using a cosine similarity calculation formula includes:
calculating the similarity score of the dimension reduction clause vector and the dimension reduction human set vector by using the following formula i
wherein ,representing the dimension-reducing human set vector, < >>A transpose matrix of the dimensionality reduction clause vector representing the ith clause, V i And the dimension-reducing clause vector representing the ith clause, wherein i represents the ith clause.
6. The method for matching people settings based on a dialogue system according to claim 1, wherein said correcting said best reply text by using a preset text correction model according to said preset number of target people setting information to obtain a target reply text comprises:
coding the target person setting information and the optimal reply text by using a coding module in a preset text error correction model to obtain person setting information coding vectors and reply text coding vectors;
according to the person-set information coding vector, calculating a weight value of the reply text coding vector by using an attention mechanism module in the text error correction model;
Searching a target person setting information text corresponding to the reply text coding vector with low weight value in the weight values;
and replacing the reply text corresponding to the reply text coding vector with low weight value in the weight value by using the target person setting information text corresponding to the reply text coding vector with low weight value in the weight value to obtain the reply text.
7. The method for matching people's settings based on a dialogue system according to claim 1, wherein said data enhancement of said people's settings information text to obtain a target people's settings information text comprises:
performing back translation on the human-set information text by using a preset translation dictionary to obtain a back-translated human-set information text;
extracting text keywords in the personal information text;
matching the text keywords with phrases in a preset synonym dictionary to obtain synonym phrases successfully matched;
replacing the text keywords with the synonym phrases successfully matched to obtain a replacing person setting information text;
and integrating the back translation setting information text and the replacement setting information text to obtain a target setting information text.
8. A personal presence compliance device based on a dialog system, the device comprising:
The personal setting information enhancement module is used for acquiring a personal setting information text of the dialogue system and carrying out data enhancement on the personal setting information text to obtain a target personal setting information text;
the system comprises a person setting information selection module, a user setting information selection module and a target person setting information processing module, wherein the person setting information selection module is used for acquiring a historical dialogue text, splicing the historical dialogue text and the current question text when receiving a current question text input by a user, obtaining a spliced text, predicting a candidate reply text set of the current question text by using a preset dialogue generation model according to the spliced text, grading and rearranging the candidate reply text set by using a preset dialogue evaluation model, taking the candidate reply text with the highest grading in the candidate reply text set as an optimal reply text, calculating the similarity between the optimal reply text and the target person setting information text by using a preset vector similarity calculation model, and selecting a preset number of target person setting information with the highest similarity from the target person setting information text;
and the reply text correction module is used for correcting the optimal reply text by using a preset text correction model according to the preset number of target person setting information to obtain a target reply text.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the dialog system based person reconciliation method of any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the dialog system based person reconciliation method of any of claims 1 to 7.
CN202310648633.2A 2023-06-02 2023-06-02 Person setting consistency method and device based on dialogue system, electronic equipment and medium Pending CN116881410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310648633.2A CN116881410A (en) 2023-06-02 2023-06-02 Person setting consistency method and device based on dialogue system, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310648633.2A CN116881410A (en) 2023-06-02 2023-06-02 Person setting consistency method and device based on dialogue system, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN116881410A true CN116881410A (en) 2023-10-13

Family

ID=88268709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310648633.2A Pending CN116881410A (en) 2023-06-02 2023-06-02 Person setting consistency method and device based on dialogue system, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN116881410A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117131182A (en) * 2023-10-26 2023-11-28 江西拓世智能科技股份有限公司 AI-based dialogue reply generation method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117131182A (en) * 2023-10-26 2023-11-28 江西拓世智能科技股份有限公司 AI-based dialogue reply generation method and system

Similar Documents

Publication Publication Date Title
CN111680168B (en) Text feature semantic extraction method and device, electronic equipment and storage medium
CN111639153B (en) Query method and device based on legal knowledge graph, electronic equipment and medium
CN112559687B (en) Question identification and query method and device, electronic equipment and storage medium
CN113515938B (en) Language model training method, device, equipment and computer readable storage medium
CN114822812A (en) Character dialogue simulation method, device, equipment and storage medium
CN116881410A (en) Person setting consistency method and device based on dialogue system, electronic equipment and medium
CN113435180B (en) Text error correction method and device, electronic equipment and storage medium
CN116702761A (en) Text error correction method, device, equipment and storage medium
CN116341646A (en) Pretraining method and device of Bert model, electronic equipment and storage medium
CN115169330B (en) Chinese text error correction and verification method, device, equipment and storage medium
CN116719920A (en) Dynamic sampling dialogue generation model training method, device, equipment and medium
CN114757154B (en) Job generation method, device and equipment based on deep learning and storage medium
CN114676307A (en) Ranking model training method, device, equipment and medium based on user retrieval
CN111680515B (en) Answer determination method and device based on AI (Artificial Intelligence) recognition, electronic equipment and medium
CN111414452B (en) Search word matching method and device, electronic equipment and readable storage medium
CN112749264A (en) Problem distribution method and device based on intelligent robot, electronic equipment and storage medium
CN115204120B (en) Insurance field triplet extraction method and device, electronic equipment and storage medium
CN115525730B (en) Webpage content extraction method and device based on page weighting and electronic equipment
CN115146622B (en) Data annotation error correction method and device, electronic equipment and storage medium
CN118312778A (en) Training method, device, equipment and medium of text classification model
CN114546882B (en) Intelligent question-answering system testing method and device, electronic equipment and storage medium
CN113157865B (en) Cross-language word vector generation method and device, electronic equipment and storage medium
CN116629256A (en) Multi-mode text error detection method, device, equipment and medium
CN118246553A (en) Question answering method, device, equipment and storage medium based on question main component
CN116579349A (en) Text semantic segmentation method, device, 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