CN116956856A - Data processing method and device, storage medium and electronic equipment - Google Patents

Data processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116956856A
CN116956856A CN202310521368.1A CN202310521368A CN116956856A CN 116956856 A CN116956856 A CN 116956856A CN 202310521368 A CN202310521368 A CN 202310521368A CN 116956856 A CN116956856 A CN 116956856A
Authority
CN
China
Prior art keywords
data
candidate
dialogue
prediction
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
CN202310521368.1A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310521368.1A priority Critical patent/CN116956856A/en
Publication of CN116956856A publication Critical patent/CN116956856A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • 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
    • G06N3/0455Auto-encoder networks; Encoder-decoder 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/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

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

Abstract

The application discloses a data processing method, a device, a storage medium and electronic equipment, and relates to the technical field of artificial intelligence, wherein the method provides a mode for obtaining a target prompt template based on bias evaluation values, obtains at least one candidate prompt template associated with dialogue data based on scene intention represented by the dialogue data to be predicted, obtains at least one designated attribute with gain function on generating the bias data, and then respectively obtains bias evaluation values corresponding to the at least one candidate prompt template based on the at least one designated attribute, wherein each bias evaluation value represents: and under the influence of at least one designated attribute, generating the possibility of a dialogue prediction result containing prejudice data based on the corresponding candidate prompt template, and obtaining a target dialogue prediction result corresponding to the dialogue data based on the target prompt template, so that prejudice prediction on the at least one designated attribute is reduced, prejudice data generation is reduced, and fairness of the target dialogue prediction result is improved.

Description

Data processing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a data processing method, a device, a storage medium, and an electronic apparatus.
Background
In recent years, with the rapid development of artificial intelligence technology, a prediction model for a dialog scene is derived, and the prediction model can understand dialog data input by a target object and automatically generate corresponding dialog prediction results, for example: large language models (Large Language Model, LLM) that can be used to understand meaning of language text and automatically generate natural language text, etc.
In the related technology, a large language model can understand the input intention of a target object in a dialogue scene, so that the interpretability, the controllability and the prediction efficiency of the model are improved; however, with the wide application of the large language model, the large language model is affected by prejudice data with discrimination in the training process, so that the large language model can unfairly predict the attribute of prejudice data in the prediction process, and a prediction result with prejudice is output, and the prediction result is spread through the public, so that some harmful impressive impressions are continuously strengthened, and even distortion facts are caused.
For example, in the context of resume scoring, the large language model gives a lower predictive rating score for a female resume and a higher predictive rating score for a male resume in the actual prediction process, subject to gender bias.
In view of this, there is a need for a method to reduce the influence of data bias on predictive models and thus generate dialog predictors including biased data.
Disclosure of Invention
The application provides a dialogue method, a dialogue device, a dialogue storage medium and an electronic device, which are used for reducing prejudice prediction of at least one appointed attribute, inhibiting generation of prejudice data and improving fairness of a finally generated target dialogue prediction result.
In a first aspect, the present application provides a data processing method, including:
based on scene intent of dialog data characterization to be predicted, at least one candidate prompt template associated with the dialog data is obtained, each candidate prompt template for: completing the dialogue data under a dialogue scene to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data;
acquiring at least one designated attribute, wherein the designated attribute is as follows: the attribute has a gain effect on generating bias data, the bias data being: characterizing evaluation data of a portion of the objects in the specified population that deviate from a preset population evaluation criterion;
acquiring bias evaluation values corresponding to the at least one candidate prompt template respectively based on the at least one specified attribute; wherein each of the bias evaluation values characterizes: triggering the prediction model to generate a likelihood of a dialog prediction result containing the bias data based on the corresponding candidate prompt template under the influence of the at least one specified attribute;
Selecting a candidate prompt template with the bias evaluation value meeting a preset screening condition as a target prompt template, and obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template.
Optionally, the acquiring at least one specified attribute includes:
extracting at least one specified attribute of the dialogue data;
or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data;
or, acquiring historical dialogue data, and extracting the historical dialogue data and at least one appointed attribute of the dialogue data;
or, in response to the received attribute instruction, extracting at least one designated attribute carried in the attribute instruction.
In a second aspect, the present application provides a data processing apparatus comprising:
the first acquisition module acquires at least one candidate prompt template associated with dialogue data based on scene intention characterized by the dialogue data to be predicted, wherein each candidate prompt template is used for: completing the dialogue data under a dialogue scene to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data;
the second acquisition module acquires at least one designated attribute, wherein the designated attribute is as follows: the attribute has a gain effect on generating bias data, the bias data being: characterizing evaluation data of a portion of the objects in the specified population that deviate from a preset population evaluation criterion;
The third acquisition module is used for acquiring bias evaluation values corresponding to the at least one candidate prompt template respectively based on the at least one designated attribute; wherein each of the bias evaluation values characterizes: triggering the prediction model to generate a likelihood of a dialog prediction result containing the bias data based on the corresponding candidate prompt template under the influence of the at least one specified attribute;
and the obtaining module is used for selecting a candidate prompt template with the bias evaluation value meeting the preset screening condition as a target prompt template and obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template.
Optionally, the second obtaining module is specifically configured to:
extracting at least one specified attribute of the dialogue data;
or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data;
or, acquiring historical dialogue data, and extracting the historical dialogue data and at least one appointed attribute of the dialogue data;
or, in response to the received attribute instruction, extracting at least one designated attribute carried in the attribute instruction.
Optionally, the third obtaining module is specifically configured to:
For the at least one candidate prompt template, respectively executing the following operations:
triggering the prediction model to generate first probability distribution of each first prediction data of the dialogue data based on a candidate prompt template by adopting the at least one appointed attribute; wherein each of the first predicted data comprises at least one of the biased data and non-biased data, the first probability distribution characterizing: the distribution rule of the occurrence probability of each first prediction data;
triggering the prediction model to generate second probability distribution of each second prediction data of the dialogue data based on the candidate prompt template by adopting the modification attribute corresponding to each of the at least one designated attribute; wherein each of the modification attributes is: and modifying the attribute category of the corresponding appointed attribute, wherein each second prediction data comprises at least one of the prejudice data and the non-prejudice data, and the second probability distribution represents: the distribution rule of the occurrence probability of each second prediction data;
and taking the distribution similarity between the first probability distribution and the second probability distribution as a bias evaluation value corresponding to the candidate prompt template.
Optionally, in the third obtaining module, the distribution similarity between the first probability distribution and the second probability distribution is obtained by adopting the following manner:
performing dimension transformation on the first probability distribution or the second probability distribution to obtain first transformation probability distribution and second transformation probability distribution with consistent dimensions;
obtaining a distribution distance between the first transformation probability distribution and the second transformation probability distribution;
and obtaining the distribution similarity between the first probability distribution and the second probability distribution based on the distribution distance.
Optionally, the obtaining module is configured to select, as the target alert template, a candidate alert template whose bias evaluation value meets a preset screening condition, and specifically configured to:
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting a candidate prompt template corresponding to the bias evaluation value of the target position as a target prompt template according to the arrangement result;
or alternatively, the process may be performed,
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting candidate prompt templates corresponding to a plurality of bias evaluation values which are continuously arranged according to a set number as target prompt templates according to the arrangement result.
Optionally, the obtaining module is configured to obtain, based on the target prompt template, a target dialog prediction result corresponding to the dialog data, and specifically configured to:
when one target prompt template is selected, triggering the prediction model to generate target probability distribution of each candidate prediction data of the dialogue data based on the one target prompt template; wherein the candidate prediction data comprises at least one of the biased data and non-biased data, the target probability distribution characterizing: the distribution rule of the occurrence probability of each candidate prediction data;
and obtaining a target dialogue prediction result of the dialogue data based on the target probability distribution and candidate prediction data with occurrence probability meeting a preset probability screening condition.
Optionally, the obtaining module is configured to obtain, based on the target prompt template, a target dialog prediction result corresponding to the dialog data, and specifically configured to:
when a plurality of target prompt templates are selected, the following operations are respectively executed for the plurality of target prompt templates: triggering the prediction model to generate candidate probability distribution of each candidate prediction data of the dialogue data based on a target prompt template; wherein the candidate prediction data comprises at least one of the biased data and non-biased data, the candidate probability distribution characterizing: the distribution rule of the occurrence probability of each candidate prediction data;
Based on bias estimation values corresponding to the target prompt templates, performing fusion operation on the obtained candidate probability distributions to obtain fused probability distributions; wherein the fusion probability distribution characterizes: the distribution rule of the occurrence probability of each fusion prediction data of the dialogue data comprises at least one of the prejudice data and the non-prejudice data;
and obtaining a target dialogue prediction result of the dialogue data based on the fusion probability distribution and fusion prediction data of which the occurrence probability meets a preset probability screening condition.
Optionally, the obtaining module is configured to perform a fusion operation on the obtained multiple candidate probability distributions based on bias estimation values corresponding to the multiple target alert templates, so as to obtain a fused probability distribution, which is specifically used for:
respectively carrying out normalization processing on bias estimation values corresponding to the target prompt templates to obtain a plurality of processing values;
and based on the plurality of processing values, weighting and summing the plurality of obtained candidate probability distributions to obtain the fused probability distribution after fusion.
Optionally, the first obtaining module is specifically configured to:
Performing recognition processing on the dialogue data to generate recognizable dialogue data;
for at least one candidate alert template, the candidate alert templates are obtained by:
acquiring a prompt associated with the scene intention data based on the scene intention data in the identifiable dialog data, and acquiring at least one training sample associated with the scene intention data, wherein each training sample comprises historical identifiable dialog data and a corresponding dialog marking result;
respectively adding the prompt into the identifiable dialogue data and the at least one training sample to generate at least two data to be processed added with the prompt;
and after the splicing operation is carried out on the at least two data to be processed, obtaining a candidate prompt template.
Optionally, the prediction model is obtained through pre-training, and each candidate prompt template comprises: identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
the third obtaining module is configured to trigger, based on a candidate alert template, the prediction model to generate a first probability distribution of each first prediction data of the session data using the at least one specified attribute, specifically configured to:
And performing iterative training again on the prediction model based on the at least one training sample by adopting the at least one appointed attribute to obtain a first prediction model after retraining.
The first prediction model is triggered to generate a first probability distribution of each first prediction data of the dialogue data based on a candidate prompt template.
Optionally, the prediction model is obtained through pre-training, and each candidate prompt template comprises: identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
the third obtaining module is configured to trigger, based on the one candidate alert template, the prediction model to generate a second probability distribution of each second prediction data of the dialogue data using the modified attribute corresponding to each of the at least one specified attribute, where the second probability distribution is specifically configured to:
performing iterative training again on the prediction model based on the at least one training sample by adopting the modified attribute corresponding to each of the at least one designated attribute to obtain a second prediction model after retraining;
Triggering the second prediction model to generate a second probability distribution of each second prediction data of the dialogue data based on the one candidate prompt template.
In a third aspect, the present application provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any one of the data processing methods of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer storage medium having stored therein computer program instructions for execution by a processor of any one of the data processing methods of the first aspect described above.
In a fifth aspect, an embodiment of the present application provides a computer program product, including computer program instructions, which when executed by a processor implement any one of the data processing methods of the first aspect.
The application has the following beneficial effects:
in the embodiment of the application, the electronic equipment acquires at least one candidate prompt template associated with dialogue data based on scene intention of dialogue data characterization to be predicted, wherein each candidate prompt template is used for: and under a dialogue scene, complementing the dialogue data to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data. Here, each candidate hint template obtained may be used to excite the prediction potential of the prediction model, so that the subsequent prediction dialogue data obtains a more consistent scene intent of the target dialogue prediction result, in other words, different candidate hint templates may trigger the same prediction model to generate different dialogue prediction results for the same dialogue data (the generated dialogue prediction results may be the same, which is not limited herein); for example, in a dialogue scene, a pre-trained prediction model (such as a large language model) is run on the electronic device, at least one candidate prompt template associated with dialogue data is obtained, the candidate prompt template is used as a model input to excite prediction potential of different dimensions of the large language model, the dimension of the prediction potential is related to the complement data of the candidate prompt template for the dialogue data, the different candidate prompt templates can trigger the prediction model to generate different dialogue prediction results because the different candidate prompt templates are different from the complement data of the dialogue data, and further, the follow-up target dialogue prediction results for inhibiting the generation of the bias data can be obtained by screening out the target prompt templates in order to avoid the bias data (the bias data is the evaluation data for representing partial objects in a specified group) related to the bias data.
Furthermore, in order to reduce the generation of the bias data in the target prediction dialogue data, at least one piece of specified data with gain function on the generated bias data is obtained, and based on the extracted at least one specified attribute, bias evaluation values corresponding to the at least one candidate prompt template are obtained, wherein one bias evaluation value represents: the likelihood of dialog predictors containing biased data is generated based on the corresponding candidate prompt templates, subject to at least one specified attribute. Thus, the gain degree of the bias data generated by the prediction model triggered by different candidate prompt templates can be evaluated, and the evaluation thought is derived from: the different candidate prompt templates have a degree of attention, either high or low, to the at least one specified attribute, which affects the prediction potential of the different dimensions of the subsequent trigger prediction model, so that the at least one specified attribute is taken as a whole of attention, and the obtained bias evaluation values corresponding to the at least one candidate prompt template are used for evaluating the influence degree of each candidate prompt template on the prediction potential of the different dimensions of the subsequent prediction model.
And selecting a candidate prompt template with the bias evaluation value meeting the preset screening condition as a target prompt template, and obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template. As can be easily understood, the preset screening conditions can be set according to actual application scenes, for example, in some application scenes in which bias data generation needs to be reduced, the preset screening conditions are smaller bias evaluation values, for example, in some application scenes in which bias data generation needs to be tested, the preset screening conditions are larger bias evaluation values; therefore, screening of the at least one bias evaluation value can be based on unified conditions (namely, aiming at a prediction model influenced by at least one appointed attribute), and screening of the possibility that different candidate prompt templates are influenced by the at least one appointed attribute to trigger the prediction model to generate bias data can be achieved, and further suppression of bias data generation in some application scenes can be achieved, namely, the smaller the bias evaluation value is, the smaller the possibility that bias data is contained in target dialog prediction data generated based on the corresponding candidate prompt templates is represented, at least one bias evaluation value is screened at the moment, namely, screening of the at least one candidate prompt template is achieved, namely, screening of the attention degree of each candidate prompt template to the at least one appointed attribute is achieved, and accordingly the occurrence probability of bias data in target dialog prediction results is reduced.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1A to 1B are schematic diagrams of optional application scenarios in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application;
fig. 3A to 3B are schematic diagrams of a dialogue scene according to an embodiment of the application;
FIGS. 4A-4C are schematic diagrams illustrating a process of obtaining candidate alert templates according to embodiments of the present application;
FIG. 5 is a flowchart of acquiring a bias evaluation value according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a training process of a predictive model in an embodiment of the application;
fig. 7A to 7C are schematic views of a process for obtaining a bias evaluation value according to an embodiment of the present application;
Fig. 8A to fig. 8B are schematic diagrams of a process of obtaining a target prompt template according to an embodiment of the present application;
FIG. 9 is a flowchart of generating a target prediction result according to an embodiment of the present application;
FIG. 10 is a flowchart illustrating a method for processing resume evaluation data according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
In the embodiment of the application, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
In order to facilitate understanding of the technical solution provided by the embodiments of the present application, some key terms used in the embodiments of the present application are first explained.
The prediction model in the embodiment of the application refers to a pre-training model for performing dialogue prediction in a dialogue scene, and particularly can be a deep learning model trained based on a large amount of sample data, and further, the prediction model performs iterative training again based on training data of a small sample aiming at tasks of different dialogue scenes so as to excite prediction potential in the corresponding dialogue scene.
The pre-training model is a machine learning model derived from a traditional machine learning method. Specifically, the conventional machine learning method is: the method is characterized in that some data are sampled from some unlabeled data, then a model is trained through manual labeling, and the derivation of the pre-trained model is used for solving the problem that the unlabeled data are difficult to label one by one along with the increase of the unlabeled data. The training of the pre-training model is based on a non-guiding method, or a self-guiding and self-supervising method. The pre-training model has the advantages that the model with high adaptation degree to the target task can be obtained only by fine tuning according to the target task (such as retraining based on training data of a small sample) without retraining for different tasks, in other words, compared with the pre-training model, the traditional model needs retraining every time a new task is encountered (such as initial training based on training data of a large sample), so that unnecessary calculation resources and time are wasted.
A Prompt (Prompt) may be a natural language sentence or question, a code segment or command, or any combination of text or codes. Specifically, the prompt is used as an input prompt provided by the target object to the prediction model to cause the large language model to perform specific response to the corresponding scene, so as to indicate the action or output of the large language model.
The scheme provided by the embodiment of the application relates to technologies such as Computer Vision (CV), voice technology (Speech Technology), natural language processing (Nature Language processing, NLP) and the like of artificial intelligence (Artificial Intelligence, AI), and is further suitable for various fields applying the artificial intelligence technology, such as common intelligent home, intelligent wearing equipment, virtual assistant, intelligent sound box, intelligent marketing, unmanned driving, automatic driving, unmanned aerial vehicle, robot, intelligent medical treatment, intelligent customer service and the like.
Artificial intelligence is a theory, method, technique and application system that utilizes a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, sense the environment, acquire knowledge and use the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice technology, a natural language processing technology, machine learning/deep learning and other directions.
The computer vision technology is a science for researching how to make a machine "see", and further means that a camera and a computer are used for replacing human eyes to perform machine vision such as target identification and measurement, and further performing graphic processing, so that the computer is processed into an image which is more suitable for human eyes to observe or transmit to an instrument to detect. As a scientific discipline, computer vision research-related theory and technology has attempted to build artificial intelligence systems that can acquire information from images or multidimensional data. Computer vision techniques typically include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content/behavior recognition, three-dimensional object reconstruction, 3D techniques, virtual reality, augmented reality, synchronous positioning, and map construction, among others, as well as common biometric recognition techniques such as face recognition, fingerprint recognition, and others.
The key technologies of speech technology are automatic speech recognition technology (ASR) and speech synthesis technology (TTS) and voiceprint recognition technology. The method can enable the computer to listen, watch, say and feel, is the development direction of human-computer interaction in the future, and voice becomes one of the best human-computer interaction modes in the future.
Natural language processing is an important direction in the fields of computer science and artificial intelligence. It is studying various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relationship with the research in linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic questions and answers, knowledge graph techniques, and the like.
Machine learning is a method of implementing artificial intelligence that aims at designing and analyzing algorithms (i.e., models) that allow a computer to automatically "learn," the designed algorithms being referred to as machine learning models. The machine learning model is an algorithm for automatically analyzing and obtaining rules from data and predicting unknown data by using the rules. The machine learning model includes various, and according to whether need rely on the label that training data corresponds when model training, the machine learning model can divide into: a supervised learning model and an unsupervised learning model.
Deep learning is a new technical field generated in the research process of machine learning, and specifically, the deep learning is a method for deep characterization learning based on data in the machine learning, and the deep learning interprets the data by establishing a neural network simulating human brain for analysis learning.
Since in the machine learning method almost all features need to be determined by industry experts, the features are then encoded. However, the deep learning algorithm tries to learn features from the data by itself, and an algorithm designed according to the deep learning idea is called a deep learning model.
It should be noted that, the prediction model related to the embodiment of the present application may be a deep learning model; for example: generating a pre-training transformation model (Chat Generative Pre-trained Transformer, chatGPT), a pre-training language model (Bidirectional Encoder Representations from Transformers, BERT), and the like.
The following briefly describes the design concept of the embodiment of the present application.
In recent years, along with the growth of high-quality data accumulated in industry, the growth of computing resources and the development of machine learning model architecture and machine learning model training technology, a predictive model obtained through pre-training is widely applied to various real dialogue scenes, and a predictive model such as a large language model is taken as an example, and the large language model has a remarkably high model parameter number, calculated amount and storage capacity, so that the predictive model has stronger expressive power and data fitting capability, and the performance ceilings of the predictive model in various services can be greatly improved, so that the prediction results in a plurality of predictive tasks exceed the human expert level.
Further, taking the large language model represented by ChatGPT 3 as an example, it is able to perform small sample Learning through scene Learning (In-context Learning) without adjusting the original model parameters, and further quickly migrate to various downstream tasks, and downstream developers can quickly build new applications by virtue of this capability of the large model.
Currently, based on the characteristics of the large language model, the large language model is widely applied to various decision prediction fields, such as: talent resume evaluation is performed based on the large language model, first, resume text information of a given candidate is used for constructing prompt input (namely a prompt template) of the large language model, and then, the large language model learns resume scored by the past resume before scoring the resume of the given candidate based on the prompt input, so that better performance is realized.
However, the social bias contained in the past resume with the resume score can lead the large language model to finally output a prediction result unfair to a certain attribute, so as to obtain a prediction result containing bias data; for example, a resume having a resume score in the past contains a gender bias, resulting in a final prediction result of the large language model also containing a bias for gender (i.e., bias data), and a situation in which the resume score for a non-married female is lower.
Considering that the prompt input of the large predictive model is at least one candidate prompt template associated with the dialogue data to be predicted, as different training samples are defined in different prompt templates and the arrangement order of the training samples is different, the attention degree of different attributes is affected after the large predictive model is trained again. Therefore, the target prompt templates are screened by evaluating the possibility that different candidate prompt templates are influenced by at least one appointed attribute and generating bias data, and target dialog prediction results corresponding to dialog data are obtained based on the target prompt templates, so that the generation of the bias data is reduced.
In view of this, an embodiment of the present application provides a method of data processing, in which a manner of obtaining at least one candidate alert template is provided, based on a scene intention of a dialog data characterization to be predicted, obtaining at least one candidate alert template associated with the dialog data, each candidate alert template being for: in a dialogue scene, the dialogue data is completed, so that a prediction model is triggered to generate a dialogue prediction result corresponding to the dialogue data, and at least one appointed attribute is obtained, wherein the appointed attribute is as follows: the attribute with gain function on generating bias data is: the method comprises the steps of representing evaluation data of partial objects in a designated group, deviating from a preset group evaluation standard, and then respectively obtaining bias evaluation values corresponding to at least one candidate prompt template based on at least one designated attribute; wherein each bias evaluation value characterizes: the likelihood of dialog predictors containing biased data is obtained based on the corresponding candidate prompt templates, subject to at least one specified attribute. Thus, each bias evaluation value can be used as a fairness index, so that the construction of a target prompt template based on the fairness index is realized.
Further, the embodiment of the application also provides a prediction mode based on the prediction fairness index, wherein the candidate prompt template with the bias evaluation value meeting the preset screening condition is selected as the target prompt template, and the target dialog prediction result corresponding to the dialog data is generated based on the target prompt template. In this way, the generation of biased data is reduced, thereby eliminating the bias of the target dialog prediction result.
The following description is made for some simple descriptions of application scenarios applicable to the technical solution of the embodiment of the present application, and it should be noted that the application scenarios described below are only used for illustrating the embodiment of the present application, but not limiting. In the specific implementation process, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
The scheme provided by the embodiment of the application can be applied to most scenes involving man-machine interaction, for example: translation, dialog systems, advertisement recommendations, etc. As shown in fig. 1A, an application scenario is schematically provided in an embodiment of the present application, where the scenario may include a terminal device 110 and a server 120.
The terminal device 110 may be, for example, a mobile phone, a tablet computer (PAD), a notebook computer, a desktop computer, a smart television, a smart car device, a smart wearable device, etc. The terminal device 110 may install or access a prediction model obtained through training and capable of performing dialogue prediction, the prediction model may be a large language model, etc., the prediction model according to the embodiment of the present application may be installed on a client, the client may be a client such as an applet, a browser, or software, and the server 120 is a background server corresponding to the client such as the applet, the browser, or the software, and the specific type of the prediction model and the client installed therein is not limited.
The server 120 may be a background server corresponding to a prediction model installed or accessed on the terminal device 110, and may implement a background function of the prediction model to implement the steps of the data processing method provided by the embodiment of the present application. For example, the cloud server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, namely, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligence platforms, etc., but the present application is not limited thereto.
A direct or indirect communication connection may be made between terminal device 110 and server 120 via one or more networks 130. The network 130 may be a wired network, or may be a Wireless network, for example, a mobile cellular network, or may be a Wireless-Fidelity (WIFI) network, or may be other possible networks, which are not limited in this embodiment of the present application.
The data processing method provided by the embodiment of the present application may be performed by the terminal device 110 or the server 120, or may also be performed by a combination of the terminal device 110 and the server 120. Either the terminal device 110 or the server 120 can include one or more processors, memory, and I/O interfaces to interact with the terminals, etc. In addition, the terminal device 110 or the server 120 may also configure a database or interact with the server 120 configured with the database. Program instructions of the data processing method provided by the embodiment of the present application may also be stored in the memory of the terminal device 110 or the server 120, where the program instructions, when executed by the processor, can be used to implement steps of the data processing method provided by the embodiment of the present application, so as to reduce generation of bias data in the target session prediction result.
In particular, the solution provided by the embodiment of the present application may also be applied to most scenarios involving man-machine conversations, for example: automatic questions and answers, machine translation, picture prediction, video prediction, intelligent writing, and the like.
As shown in fig. 1B, an application scenario diagram of a man-machine conversation provided by an embodiment of the present application is shown, in this scenario, a server 120 is used as a background server of a prediction model, and a terminal device 110 is used as a main body of interaction between the prediction model and a target object; the target object may use the predictive model on the terminal device 110 to view the target dialog prediction results presented on the terminal device 110 by sending dialog data to be predicted to the predictive model.
In one embodiment, the application scenario may be a human-computer interaction scenario of automatic question and answer, in which the terminal device 110 is a browser client for running a prediction model, where the prediction model is deployed in a background server, and the target object implements automatic question and answer by directly interacting with the browser client; then, in connection with the scenario of fig. 1B: the terminal device 110 obtains the dialogue data to be predicted "failed, difficult to meet the demands", "transmits the dialogue data to the server 120 through the network 130, so that the server 120 enables the prediction model, and further obtains at least one candidate prompt template associated with the dialogue data based on the scene intention characterized by the dialogue data, wherein each candidate prompt template is used for: under a dialogue scene, the dialogue data are complemented to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data, at least one appointed attribute is obtained, namely, an attribute with gain effect on generated bias data (evaluation data used for representing partial objects in an appointed group and deviating from a preset group evaluation standard) is obtained, and then bias evaluation values corresponding to at least one candidate prompt template are respectively obtained based on the at least one appointed attribute, wherein each bias evaluation value represents: generating a possibility of a dialog prediction result containing prejudice data based on the corresponding candidate prompt templates under the influence of at least one designated attribute, selecting the candidate prompt templates with prejudice evaluation values meeting preset screening conditions as target prompt templates, and generating a target dialog prediction result corresponding to the dialog data based on the target prompt templates, namely 'graying out', which is just a failure, i believe that you are the most excellent-! The target session prediction result is returned to the terminal device 110 through the network 130, and thus displayed on the browser client. It can be seen that the target prediction result does not contain prejudice data, so that generation of the target prediction result containing prejudice data, such as "how worry is easy for females", based on an inappropriate candidate prompt template is avoided.
It should be noted that, in the embodiment of the present application, the number of the terminal devices 110 may be one or more, and similarly, the number of the servers 120 may be one or more, that is, the number of the terminal devices 110 or the servers 120 is not limited.
In one possible application scenario, in order to facilitate reducing the communication delay of the search, the servers 120 may be deployed in each region, or for load balancing, different servers 120 may serve the terminal devices 110 in different regions, for example, the terminal device 110 is located at the site a, a communication connection is established with the server 120 serving the site a, the terminal device 110 is located at the site b, a communication connection is established with the server 120 serving the site b, and multiple servers 120 form a data sharing system to implement data sharing through a blockchain.
For each server 120 in the data sharing system having a node identifier corresponding to the server 120, each server 120 in the data sharing system may store the node identifiers of other servers 120 in the data sharing system, so that the generated block may be subsequently broadcast to other servers 120 in the data sharing system according to the node identifiers of the other servers 120. A list of node identifiers may be maintained in each server 120, and the server 120 name and node identifier may be stored in the list of node identifiers. The node identity may be a protocol (Internet Protocol, IP) address of the interconnection between networks, as well as any other information that can be used to identify the node.
Of course, the method provided by the embodiment of the present application is not limited to the application scenario shown in fig. 1A or fig. 1B, but may be used in other possible application scenarios, and the embodiment of the present application is not limited. The functions that can be implemented by each device in the application scenario shown in fig. 1A or fig. 1B will be described together in the following method embodiments, which are not described here again.
The method flow provided in the embodiments of the present application with reference to the drawings may be performed by the server 120 or the terminal device 110 in fig. 1A or fig. 1B, or may be performed by the terminal device 110 and the server 120 together, and will be mainly described herein by way of example as being performed by the terminal device 110.
Referring to fig. 2, a flow chart of an application development method according to an embodiment of the present application is shown.
Step 201: based on scene intents of dialog data characterization to be predicted, at least one candidate prompt template associated with the dialog data is obtained, each candidate prompt template being for: and completing the dialogue data in a dialogue scene to trigger the prediction model to generate a dialogue prediction result corresponding to the dialogue data.
In the embodiment of the application, the terminal equipment can be any electronic equipment, and particularly, the dialogue data to be predicted is obtained through a client (such as a client accessed to a prediction model) running on the terminal equipment.
The dialogue data may be data that is sent by one interaction object participating in dialogue interaction and is expected to be replied by another interaction object participating in dialogue interaction in a dialogue scene. Further, another interactive object will understand the received dialogue data based on its own knowledge, so as to reply to the interactive object that sent the dialogue data, and this reply is the dialogue prediction result of the dialogue data in the embodiment of the application.
It should be noted that two interactive objects in the same dialog scene generally belong to the same category, such as two person dialogues, two cat dialogues, two machine dialogues, and the like. Of course, in the embodiment of the present application, the two interactive objects may also belong to different categories, such as a human-machine dialogue, a cat-machine dialogue, etc., where a terminal device is taken as an interactive object as an example, but the category of another interactive object in the same dialogue scene, its interaction mode, and the number of interactions are not specifically limited.
In addition, the dialogue description related in the embodiment of the application is not limited to a voice dialogue, a text dialogue, an image dialogue, and the like, and can also be data transmission, namely, the dialogue description is applicable to any dialogue scene comprising at least two interaction subjects.
In a conventional dialogue scenario, referring to fig. 3A, which is a schematic diagram of a dialogue scenario, taking an interactive object as two examples, the interactive object a sends dialogue data, which includes: the file data of "[ resume text information ]", and the text data of "resume of small Ming", at this time, the interactive object A expects to obtain the dialogue prediction result that the interactive object B replies "score to resume of small Ming"; further, the interactive object B may generate a different dialog prediction result to reply to the interactive object a based on its own understanding of the dialog data.
In a dialogue scene, referring to fig. 3B, an interactive object is a person and a device as an example, where the difference between the interactive object a and the dialogue scene shown in fig. 3A is that the interactive object B is a person and the interactive object B is a device, so that the description is not repeated here. However, it should be noted that in the embodiment of the present application, the interaction object B is mainly used as an execution body, so that man-machine interaction is similar to man-machine interaction.
In addition, the content of the dialogue data includes, but is not limited to, text, pictures, audio, video, etc.; for example, the dialogue data is text data, voice data, picture data, video data, file data, or the like input by the target object on the client, and the manner of acquiring the dialogue data is not particularly limited herein.
In one embodiment, the terminal device obtains the dialogue data by directly or indirectly interacting with the target object. For example, the target object directly enables a client accessing the prediction model in the terminal device, inputs dialogue data to be predicted in a front end interface of the client, and the terminal device acquires the dialogue data; for another example, the target object sends a prediction trigger instruction carrying the dialogue data to be predicted to the terminal device through other communication devices connected with the terminal device, and the terminal device responds to the prediction trigger instruction to acquire the dialogue data.
Further, in the embodiment of the present application, in order to excite the prediction potential of the prediction model, the meaning of the dialogue data is better understood, so as to output the target dialogue prediction result, and after the dialogue data to be predicted is obtained, at least one candidate prompt template associated with the dialogue data is obtained based on the scene intention represented by the dialogue data.
In one embodiment, a way to obtain candidate alert templates is provided. In this manner, the terminal device performs recognition processing on dialogue data to be predicted, and after generating recognizable dialogue data, performs the following acquisition operations to acquire at least one candidate prompt template.
For the above-mentioned acquisition operation, taking an example of acquiring a candidate prompt template, the terminal device acquires a prompt associated with scene intention data based on scene intention data in identifiable dialogue data, and acquires at least one training sample associated with scene intention data, wherein each training sample comprises historical identifiable dialogue data and a corresponding dialogue marking result, then adds the prompt into the identifiable dialogue data and the at least one training sample respectively, generates at least two pieces of data to be processed with the added prompt, and after performing a splicing operation on the at least two pieces of data to be processed, acquires a candidate prompt template.
Specifically, the process of adding a prompt to identifiable dialogue data, in which dialogue data to be predicted is "text information of a small resume" which is converted into identifiable dialogue data X, can be seen in fig. 4A text And based on the resume evaluation intention characterized by the dialogue data, acquiring a prompt word T ():how you evaluate the resume "to obtain recognizable dialogue data (i.e., a piece of data to be processed) with the addition of a prompt based on the dialogue data.
As an example, for the above-described process of recognizable dialogue data after adding a prompt, see formula 1.
t text =T(x text ) 1 (1)
Wherein x is text For recognizable dialog data, T () is a text transformation (e.g., T (x) text ) Characterizing the conversion process of adding a prompt to identifiable dialog data), t text To add recognizable dialogue data (i.e., a piece of data to be processed) after the prompt.
Similarly, taking a process of adding the prompt into at least one training sample as an example, a process of adding the prompt into the ith training sample can be shown in fig. 4B, where the training sample i is a history resume i including a resume evaluation' (i.e. a dialogue mark result), and based on a resume evaluation intention represented by the training sample i, a prompt T () "how to evaluate the resume" is obtained, so that based on the training sample i, the ith training sample (i.e. a to-be-processed data) after adding the prompt is obtained.
As an example, for the above procedure of obtaining the ith training sample after adding the prompt, see formula 2.
t i =T(x i y i ) 2, 2
Wherein x is i For the history identifiable dialog data in the ith training sample, for the corresponding dialog token result in the ith training sample, T () is a text transformation (e.g., T (x) i y i ) Characterizing the conversion process of adding a prompt to the ith training sample), t i To add the ith training sample (i.e. a piece of data to be processed) after the prompt.
Further, taking the example of obtaining m (m is an integer and m is greater than or equal to 1) training samples, the above process of performing the splicing operation on at least two data to be processed may be shown in fig. 4C, and it should be noted that, here, different numbers of training samples participating in the splicing operation, and training samples participating in different splicing orders of the splicing operation will all generate different candidate prompt templates.
As an example, for the procedure of the above-described splicing operation, see formula 3.
t p =concat(t 1 ,…,t m ,t test ) 3
Wherein t is p For a candidate prompt template, t 1 ,…,t m Respectively training samples added with prompt, t test To add recognizable dialogue data after the cue, concat () is the above-described concatenation operation.
In the embodiment of the application, a mode of acquiring candidate prompt templates is provided, based on scene intentions represented by dialogue data to be predicted, at least one candidate prompt template associated with the dialogue data is acquired, and is used for complementing the dialogue data under one dialogue scene, so as to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data, and each candidate prompt template obtained can be used for exciting the prediction potential of the prediction model, so that the following prediction dialogue data can acquire more consistent scene intentions of target dialogue prediction results, namely, each candidate prompt template is helpful for exciting the prediction potential of different dimensions of the prediction model, and further acquiring the target dialogue prediction results more consistent with the scene intentions.
Step 202: acquiring at least one designated attribute, wherein the designated attribute is as follows: the attribute with gain function on generating bias data is: evaluation data for characterizing a portion of the subjects in a given population that deviate from a preset population evaluation criteria.
In the embodiment of the application, in order to avoid that the candidate prompt template has too high attention degree on certain appointed attributes related to generating bias data, a great amount of bias data is contained in a target prediction dialogue result generated based on the candidate prompt template, and the appointed attributes with gain function on the generated bias data are acquired.
In one embodiment, the acquiring manner may include: extracting at least one specified attribute of the dialogue data; or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data; or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data and dialogue data; or, in response to the received attribute instruction, extracting at least one designated attribute carried in the attribute instruction. Of course, the same holds true for the above-described plurality of acquisition modes, and the combination modes are not particularly limited herein.
Optionally, extracting specified attributes for dialogue data (or historical dialogue data), and in one possible implementation manner, the terminal device may extract each attribute in the dialogue data according to a preset algorithm, so as to identify at least one specified attribute having a gain for generating bias data; in one possible implementation manner, the terminal device may extract at least one specified attribute of the dialogue data by acquiring an extraction instruction sent by the target object; the manner of acquisition and the number of acquisitions of the specified attribute are not particularly limited herein.
In the embodiment of the application, at least one appointed attribute with a gain function for generating the bias data is extracted to pay attention to the possibility that each candidate prompting template is influenced by the at least one appointed attribute, so that the prediction model is triggered to generate the bias data.
Step 203: based on at least one designated attribute, obtaining bias evaluation values corresponding to at least one candidate prompt template respectively, wherein each bias evaluation value represents: the likelihood that the predictive model will generate a dialog prediction result containing biased data is triggered based on the corresponding candidate prompt template, subject to the influence of the at least one specified attribute.
In one embodiment, at least one bias evaluation value may be obtained by a preset obtaining manner, and a candidate alert template is taken as an example, and a schematic flow chart of obtaining a bias evaluation value is shown in fig. 5.
Step 501: triggering a prediction model to generate first probability distribution of each first prediction data of dialogue data based on a candidate prompt template by adopting at least one designated attribute; wherein each first predicted data comprises at least one of biased data and non-biased data, the first probability distribution characterizing: the distribution rule of the occurrence probability of each first prediction data.
In one embodiment, the first probability distribution may be obtained by retraining based on a pre-trained prediction model, where the concept of retraining may be as shown in fig. 6, where the prediction model is first pre-trained based on a large number of sample data, and then iteratively trained again using a small number of training samples for the purpose of enhancing the prediction effect of the prediction model on the corresponding dialog scene.
Referring to fig. 7A, a schematic process for obtaining the first probability distribution is shown, which involves model input, training process and model output of the prediction model, and is described below in detail.
For model inputs, the model input of the predictive model may be a candidate hint template, which may include: the system comprises identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results.
And performing iterative training again on the prediction model by adopting at least one designated attribute based on at least one training sample aiming at the training process to obtain a first prediction model (namely, a prediction model after retraining in a dialogue scene), and predicting identifiable dialogue data in the first prediction model by adopting the first prediction model based on a candidate prompt template to obtain first probability distribution of each first prediction data of the dialogue data.
It should be noted that, the use of at least one specific attribute means that the prediction model is affected by the at least one specific attribute during the training process.
For the model output, the model output of the first prediction model is the first probability distribution described above, and can be seen in equation 4.
L=p M (l|t p ) 4. The method is to
Wherein L is a first probability distribution, t p For a candidate hint template (hidden token: first predictive model is trained iteratively again using at least one specified attribute), l is a random vector, p M () Is the output probability of the first predictive model.
In the embodiment of the application, based on at least one designated attribute, the first distribution probability corresponding to each of at least one candidate prompt template is obtained, namely after the attention degree of a training model to the at least one designated attribute is improved, the prediction result of the training model on dialogue data is obtained, and the prediction result is characterized as the first distribution probability.
Step 502: triggering a prediction model to generate second probability distribution of each second prediction data of the dialogue data based on a candidate prompt template by adopting at least one modification attribute corresponding to each designated attribute; wherein each modification attribute is: and modifying the attribute category of the corresponding appointed attribute to obtain an attribute, wherein each second predicted data comprises at least one of prejudice data and non-prejudice data, and the second probability distribution represents: and the distribution rule of the occurrence probability of each second prediction data.
In one embodiment, the second probability distribution may be obtained by retraining based on a prediction model, and the concept of retraining may be shown in fig. 6, which is not repeated here.
Referring to fig. 7B, a schematic diagram of a process for obtaining a second probability distribution, which involves model input, training process, and model output of a predictive model, is described below.
For model inputs, the model inputs of the predictive model are one candidate hint template, which may include: the system comprises identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results.
And performing iterative training again on the prediction model by adopting at least one modified attribute corresponding to each designated attribute according to the training process based on at least one training sample to obtain a retrained second prediction model (namely, the retrained prediction model under another dialogue scene), and then obtaining second probability distribution of each second prediction data of dialogue data by adopting the second prediction model and based on one candidate prompt template.
It should be noted that, the above-mentioned modification property using each of the at least one specified property means that the prediction model is affected by the at least one specified property during the training process. The modification attribute is obtained by modifying the attribute category of the corresponding appointed attribute; for example, one designated attribute is gender, female, the type of gender is modified, and the corresponding modified attribute is male.
For the model output, the model output of the second prediction model is the second probability distribution described above, and can be seen in equation 5.
Wherein, the liquid crystal display device comprises a liquid crystal display device,for the second probability distribution ∈ ->For a candidate hint template (hidden token: second predictive model re-iterated training with at least one modified attribute of each of the specified attributes), l is a random vector, p M () Is the output probability of the first predictive model.
In the embodiment of the application, based on the modification attribute corresponding to each of the at least one designated attribute, the second distribution probability corresponding to each of the at least one candidate prompt template is obtained, namely the attention degree of the training model to the at least one designated attribute is reduced, the attention degree of the training model to the at least one modification attribute is improved, and the prediction result of the training model about dialogue data is obtained and is characterized as the first distribution probability.
Step 503: and taking the distribution similarity between the first probability distribution and the second probability distribution as a bias evaluation value corresponding to a candidate prompt template.
In one embodiment, referring to fig. 7C, a dimension transformation is performed on the first probability distribution or the second probability distribution, so as to obtain a first transformation probability distribution and a second transformation probability distribution with consistent dimensions, thereby obtaining a distribution distance between the first transformation probability distribution and the second transformation probability distribution, and then obtaining a distribution similarity between the first probability distribution and the second probability distribution based on the distribution distance, and using the distribution similarity as a bias evaluation value of the corresponding candidate prompt template.
Specifically, the distribution similarity may be calculated by using a KL (Kullback-Leibler Divergence) distance, where the KL distance is used to measure a distribution difference between two vectors, and the first probability distribution and the second probability distribution may be regarded as two vectors, and the distribution similarity is calculated based on the KL distance, and the i candidate alert template is shown in reference formula 6.
Wherein, the liquid crystal display device comprises a liquid crystal display device,for the distribution similarity between the first probability distribution and the second probability distribution,is the first outlineThe distribution distance between the rate distribution and the second probability distribution, L (i) is the first probability distribution of the ith candidate alert template,/for the first candidate alert template>For a second probability distribution of i candidate prompt templates, bias (t pi ) Prompting template t for the ith candidate pi Corresponding bias evaluation values.
It can be seen that, if the acquired bias evaluation value is larger, the bias of the corresponding candidate prompting template to at least one designated attribute is also characterized to be larger, that is, the bias data generated based on the corresponding candidate prompting template is more likely to be generated by adopting the at least one designated attribute; if the acquired bias evaluation value is smaller, the bias of the corresponding candidate prompt template to at least one designated attribute is also smaller, namely, the bias data generated based on the corresponding candidate prompt template is less likely to be generated by adopting the at least one designated attribute.
In the embodiment of the application, under the condition that other attributes except at least one appointed attribute are kept unchanged, the bias evaluation value can be used for measuring the influence degree of one candidate prompt template by the at least one appointed attribute and generating bias data; for example, on the basis of one candidate alert template, by keeping the other attributes than the gender attribute unchanged, the distribution similarity between the first probability distribution and the second probability distribution corresponding to the dialogue data of different sexes is measured, and the distribution similarity is used as the bias evaluation value of the one candidate alert template.
In summary, by calculating the bias evaluation value corresponding to each candidate prompt template, the bias evaluation value is used to evaluate the gain degree of the corresponding candidate prompt template for triggering the prediction model to generate bias data, and since different candidate prompt templates have different or higher or lower attention degrees based on at least one designated attribute (as the whole attention), the bias evaluation value obtained herein can be used to evaluate the influence degree of each candidate prompt template on the prediction potential of different dimensions of the subsequent prediction model.
Step 204: and selecting the candidate prompt templates with the bias evaluation values meeting the preset screening conditions as target prompt templates, and obtaining target dialog prediction results corresponding to the dialog data based on the target prompt templates.
In the embodiment of the application, the preset screening conditions can be designed according to actual application conditions; for example, in some application scenes in which bias data generation needs to be reduced, a preset screening condition is to screen smaller bias evaluation values; for example, in some application scenes where more bias data needs to be tested to generate, a screening condition is preset to screen larger bias evaluation values; the application scenario in which the bias data needs to be reduced is further described below, but it will be understood by those skilled in the art that the present solution is equally applicable to another application scenario, and the logic may be implemented in the opposite manner based on the same implementation concept.
As an example, for an application scenario in which bias data needs to be reduced, preset screening conditions may be divided into two cases: firstly, selecting a corresponding target prompt template based on a minimum bias evaluation value; for another example: and a second case: selecting corresponding m target prompt templates based on smaller m (m is more than or equal to 1) bias evaluation values; the following describes the above two cases in detail.
In the first case, a corresponding target prompt template is selected.
The selecting operation specifically includes: based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting a candidate prompt template corresponding to the bias evaluation value of the target position as a target prompt template according to the arrangement result.
Referring to FIG. 8A, a template Pool is shown P N (N is larger than or equal to 1) candidate alert templates in the dialog data, wherein the N candidate alert templates are used as candidate alert templates associated with the dialog data and can be respectively characterized as follows: p is p 1 、p 2 、……、p N The bias evaluation values corresponding to the bias evaluation values are respectively: bias (t) p1 )、Bias(t p2 )、……、Bias(t pN ) The N bias evaluation values are evaluated in order of arrangement from small to large, and the arrangement can be determinedThe Bias evaluation value Bias listed in the first (t p2 ) The corresponding candidate prompt template p is adopted 2 As a target hint template.
It should be noted that, the above-mentioned order of arrangement from small to large is a possible ordering manner, and may also be ordered from large to small, or an ordering manner such as bubbling ordering may be adopted, and of course, as the ordering manner changes, correspondingly, the selection of the target position will also change, which is not limited in particular in the embodiment of the present application.
Further, the terminal device generates a target dialogue prediction result corresponding to the dialogue data based on the selected target prompt template.
In one embodiment, the terminal device obtains a target probability distribution of each candidate prediction data of the dialogue data based on a target prompt template, wherein the candidate prediction data comprises at least one of prejudice data and non-prejudice data, and the target probability distribution is characterized by: and obtaining a target dialogue prediction result of the dialogue data based on the distribution rule of the occurrence probability of each candidate prediction data.
And a second case: and selecting corresponding m target prompt templates.
The selecting operation specifically includes: based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting candidate prompt templates corresponding to a plurality of bias evaluation values which are arranged continuously according to the set number as target prompt templates according to the arrangement result.
Referring to FIG. 8B, taking selecting 2 corresponding target prompt templates as an example, a template Pool P N (N.gtoreq.2) candidate alert templates in the dialog data, as candidate alert templates associated with the dialog data, the N candidate alert templates may be characterized as: p is p 1 、p 2 、……、p N The bias evaluation values corresponding to the bias evaluation values are respectively: bias (t) p1 )、Bias(t p2 )、……、Bias(t pN ) The N bias evaluation values are arranged in order from small to large, and the first bias evaluation value can be determinedBias evaluation value Bias (t) p2 ) And a second Bias evaluation value Bias (t pN ) Corresponding candidate prompt templates P 2 And candidate hint template p N As two selected target prompt templates.
It should be noted that, the above-mentioned order of arrangement from small to large is a possible ordering manner, and may also be ordered from large to small, or an ordering manner such as bubbling ordering may be adopted, and of course, as the ordering manner changes, correspondingly, the selection of the target position will also change, which is not limited in particular in the embodiment of the present application.
Further, in order to improve the stability of scene learning, the m selected target prompt templates are fused, and a method for fusing candidate probability distributions corresponding to the m selected target prompt templates is provided, so that the difference between prediction models is reduced to improve the robustness of the prediction models, and the performance fluctuation of the prediction models in different specific dialogue scenes is effectively reduced.
In one embodiment, referring to fig. 9, a flow chart for generating a target prediction result is shown, and herein, a description will be mainly given of generating a target prediction result corresponding to dialogue data based on a plurality of (i.e., m) target alert templates, specifically, the following steps 901 to 903.
Step 901: when a plurality of target prompt templates are selected, the following operations are respectively executed for the plurality of target prompt templates: triggering a prediction model to generate candidate probability distribution of each candidate prediction data of dialogue data based on a target prompt template; wherein the candidate prediction data comprises at least one of biased data and non-biased data, and the candidate probability distribution characterizes: and the distribution rule of the occurrence probability of each candidate prediction data.
As an example, the above-mentioned plurality of target alert templates are respectively written as: p is p 1 、p 2 、…、p m The method comprises the steps of carrying out a first treatment on the surface of the Accordingly, candidate probability distributions of each candidate prediction data of the dialogue data are obtained for a single target cue template, as shown in equation 7.
r i =p M (l|cat(p i X) type 7
Wherein r is i For candidate probability distribution of each candidate prediction data obtained based on the ith target prompt template, x is dialogue data to be predicted, and p i For the ith target hint template, cat () characterizes the splice operation, p M () Is the output probability of the first predictive model.
Further, based on the plurality of target prompt templates, corresponding candidate distribution probabilities are respectively obtained.
Step 902: based on bias estimated values corresponding to the target prompt templates, performing fusion operation on the obtained candidate probability distributions to obtain fused probability distribution, wherein the fused probability distribution represents: the distribution rule of the occurrence probability of each fusion prediction data of the dialogue data comprises at least one of prejudice data and non-prejudice data.
Specifically, normalization processing is performed on bias estimation values corresponding to the target prompt templates respectively to obtain a plurality of processing values, and weighting summation is performed on the obtained candidate probability distributions based on the processing values to obtain fused probability distributions.
As an example, the normalization processing for the ith bias estimation value described above can be described as shown in equation 8.
Wherein, the liquid crystal display device comprises a liquid crystal display device,a processed value, b, normalized for the ith bias estimate i For the ith bias estimate, exp (x) is the power of e to x.
And further, processing is performed on the bias estimation values respectively, so that a plurality of corresponding processing values can be obtained, and based on the processing values, weighting and summing are performed on the obtained candidate probability distributions, so as to obtain a fused probability distribution after fusion.
As an example, the calculation method of the weighted summation can be referred to as formula 9.
Wherein r is the fusion probability distribution,a processed value, r, obtained by normalizing the ith bias estimate i For the ith candidate probability distribution, +.>For weighted summation over a plurality of processed values and a plurality of candidate probability distributions.
Step 903: and obtaining a target dialogue prediction result of the dialogue data based on the fusion probability distribution and fusion prediction data based on the occurrence probability meeting a preset probability screening condition.
In the embodiment of the application, the target dialogue prediction result can not only reduce the generation of prejudice data, but also improve the coincidence degree of the target dialogue prediction result to scene intention.
In summary, through screening at least one bias evaluation value, in an application scenario in which bias data generation needs to be reduced, suppression of at least one specified attribute is achieved, that is, bias data contained in a target dialog prediction result is reduced, and as the bias evaluation value is smaller, the probability that bias data is contained in target dialog prediction data generated based on a corresponding candidate prompt template is represented to be smaller, screening of at least one bias evaluation value is equivalent to screening of at least one candidate prompt template, and screening of attention degree of each candidate prompt template to at least one specified attribute is also equivalent to reducing probability of occurrence of bias data in the target dialog prediction result.
In a specific implementation scenario, the session prediction may relate to a decision field, where the decision field may include smart marketing, smart medical treatment, smart diagnosis, smart evaluation, etc., and for ease of understanding, the session prediction of resume evaluation is specifically described below as an example.
Referring to fig. 10, a flow chart of a data processing method for resume evaluation according to an embodiment of the present application is shown.
Step 1001: and acquiring a test resume of the object to be evaluated, and then acquiring at least one candidate prompt template associated with the test resume based on the scene intention characterized by the test resume.
The scene is used for representing a response result expected to be received by a sender of the test resume; for example, referring to fig. 3A or 3B, the sender a expects to receive a corresponding scoring result when sending a brief of a small mine as a test duration.
The candidate prompt template is used for complementing the corresponding test resume under a resume evaluation scene so as to trigger the prediction model to generate a pair of prediction results corresponding to the test resume; for example, different candidate alert templates employ different alert languages; for another example, different candidate alert templates may be selected from different resume samples, and so on. As can be easily understood, the candidate prompt templates represent the data required to be obtained by the test model for testing the test resume, so that when different candidate prompt templates contain different prompt languages, different resume samples or resume sample data with different arrangement orders, the dialogue prediction result of the test model is affected; for example, an inappropriate candidate prompt template is selected, resulting in the dialog prediction result output by the test model including biased data.
Step 1002: and extracting at least one designated attribute of the test resume, and respectively acquiring bias evaluation values corresponding to the at least one prompt template based on the at least one designated attribute.
The above specified attributes are: generating attribute with gain function of bias data, namely generating evaluation data which is used for standard weighing of partial objects in a specified group and deviates from a preset group standard by gain; for example, in the resume evaluation process, the attention degree of the prediction model to the gender attribute is too high, so that in the dialog prediction result, when the attribute categories of other attributes are consistent, the evaluation score of the female resume is lower, and the evaluation score of the male resume is higher, however, the female and the male respectively belong to part of the objects in the same designated group, the scores given by the gender influence in the preset group criteria should be identical, in other words, the dialog prediction result contains the bias data, and at this time, the gender attribute can be regarded as a designated attribute with a gain function for generating the bias data.
The bias evaluation value is characterized by being influenced by at least one appointed attribute, and the possibility of a prediction result containing bias data is generated based on a corresponding candidate prompt template; taking the process of the resume evaluation as an example, for the same candidate prompt template, after all attribute categories of the gender attribute are modified into females, a first probability distribution of a dialog prediction result is obtained based on a prediction model, then all attribute categories of the gender attribute are modified into males, a second probability distribution of the dialog prediction result is obtained based on the prediction model, and then the distribution similarity between the first probability distribution and the second probability distribution is obtained to be used as a corresponding bias evaluation value.
Step 1003: and selecting a candidate prompt template with the bias evaluation value meeting the preset screening condition as a target prompt template, and obtaining a target dialogue prediction result corresponding to the test resume based on the target prompt template.
The design concept of the preset screening conditions is mainly based on the following steps: if the bias evaluation value is lower, the probability of generating target dialogue prediction results to contain bias data is lower based on the corresponding candidate prompt templates; if the bias evaluation value is higher, the probability of generating target dialog prediction results to contain bias data is higher based on the corresponding candidate prompt templates.
And further, a mode of selecting a target prompt template corresponding to the minimum bias evaluation value and triggering the prediction model to generate a target dialogue prediction result is provided, wherein the attention degree of the prediction model about at least one appointed attribute is reduced to the greatest extent, so that the bias of the target dialogue prediction result is eliminated, and the fairness of prediction is improved.
In addition, a fairness integration mode is provided, in which a plurality of target prompt templates corresponding to the smaller bias evaluation values are selected, and then a target dialogue prediction result is generated, in the mode, an output average value or a weighted average value of a prediction model is combined with the plurality of better target prompt templates, so that differences of the prediction model among the plurality of target prompt templates are reduced, robustness of the prediction model is improved, and performance fluctuation of the prediction model in different scenes is reduced.
In summary, an embodiment of the present application provides a data processing method, in which a manner of obtaining at least one candidate alert template is provided, based on a scene intention of a dialog data characterization to be predicted, obtaining at least one candidate alert template associated with the dialog data, where each candidate alert template is used for: in a dialogue scenario, the dialogue data is complemented, and then at least one specified attribute of the dialogue data is extracted, where the specified attribute is: the attribute with gain function on the generated bias data is further based on at least one appointed attribute, and bias evaluation values corresponding to at least one candidate prompt template are respectively obtained; wherein each bias evaluation value characterizes: the likelihood of dialog predictors containing biased data is generated based on the corresponding candidate prompt templates, subject to at least one specified attribute. Thus, each bias evaluation value can be used as a fairness index, so that the construction of a target prompt template based on the fairness index is realized.
Further, the embodiment of the application also provides a prediction mode based on the prediction fairness index, wherein the candidate prompt template with the bias evaluation value meeting the preset screening condition is selected as the target prompt template, and the target dialog prediction result corresponding to the dialog data is generated based on the target prompt template. In this way, the generation of biased data is reduced, thereby eliminating the bias of the target dialog prediction result.
Referring to fig. 11, based on the same inventive concept, an embodiment of the present application further provides a data processing apparatus 1100, including:
the first obtaining module 1101 obtains at least one candidate alert template associated with the dialogue data based on the scene intent characterized by the dialogue data to be predicted, each candidate alert template for: under a dialogue scene, the dialogue data is completed, so that a prediction model is triggered to generate a dialogue prediction result corresponding to the dialogue data;
the second obtaining module 1102 obtains at least one specified attribute, where the specified attribute is: the attribute has a gain effect on generating bias data, the bias data being: characterizing evaluation data of a portion of the objects in the specified population that deviate from a preset population evaluation criterion;
a third obtaining module 1103, configured to obtain bias evaluation values corresponding to the at least one candidate alert template based on the at least one specified attribute; wherein each bias evaluation value characterizes: triggering a prediction model to generate a probability of a dialog prediction result containing biased data based on the corresponding candidate prompt template under the influence of at least one specified attribute;
the obtaining module 1104 selects the candidate prompt template with the bias evaluation value meeting the preset screening condition as the target prompt template, and obtains the target dialog prediction result corresponding to the dialog data based on the target prompt template.
Optionally, the second obtaining module 1102 is specifically configured to:
extracting at least one specified attribute of the dialogue data;
or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data;
or, acquiring historical dialogue data, and extracting at least one appointed attribute of the historical dialogue data and dialogue data;
or, in response to the received attribute instruction, extracting at least one specified attribute carried in the attribute instruction.
Optionally, the third obtaining module 1103 is specifically configured to:
for at least one candidate alert template, the following operations are performed:
triggering a prediction model to generate first probability distribution of each first prediction data of dialogue data based on a candidate prompt template by adopting at least one designated attribute; wherein each first predicted data comprises at least one of biased data and non-biased data, the first probability distribution characterizing: distribution rules of occurrence probabilities of the first prediction data;
triggering a prediction model to generate second probability distribution of each second prediction data of the dialogue data based on a candidate prompt template by adopting at least one modification attribute corresponding to each designated attribute; wherein each modification attribute is: and modifying the attribute category of the corresponding appointed attribute to obtain an attribute, wherein each second predicted data comprises at least one of prejudice data and non-prejudice data, and the second probability distribution represents: distribution rules of occurrence probabilities of the second prediction data;
And taking the distribution similarity between the first probability distribution and the second probability distribution as a bias evaluation value corresponding to a candidate prompt template.
Optionally, in the third obtaining module 1103, the distribution similarity between the first probability distribution and the second probability distribution is obtained in the following manner:
performing dimension transformation on the first probability distribution or the second probability distribution to obtain first transformation probability distribution and second transformation probability distribution with consistent dimensions;
obtaining a distribution distance between the first transformation probability distribution and the second transformation probability distribution;
based on the distribution distance, a distribution similarity between the first probability distribution and the second probability distribution is obtained.
Optionally, the obtaining module 1104 is configured to select, as the target alert template, a candidate alert template whose bias evaluation value meets a preset screening condition, specifically:
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting a candidate prompt template corresponding to the bias evaluation value of the target position as a target prompt template according to the arrangement result;
or alternatively, the process may be performed,
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting candidate prompt templates corresponding to a plurality of bias evaluation values which are arranged continuously according to the set number as target prompt templates according to the arrangement result.
Optionally, the obtaining module 1104 is configured to obtain, based on the target prompt template, a target dialog prediction result corresponding to the dialog data, and specifically configured to:
when a target prompt template is selected, triggering a prediction model to generate target probability distribution of each candidate prediction data of the dialogue data based on the target prompt template; wherein the candidate prediction data comprises at least one of biased data and non-biased data, and the target probability distribution characterizes: distribution rules of occurrence probabilities of the candidate prediction data;
and obtaining a target dialogue prediction result of the dialogue data based on the target probability distribution and candidate prediction data of which the occurrence probability meets a preset probability screening condition.
Optionally, the obtaining module 1104 is configured to obtain, based on the target prompt template, a target dialog prediction result corresponding to the dialog data, and specifically configured to:
when a plurality of target prompt templates are selected, the following operations are respectively executed for the plurality of target prompt templates: triggering a prediction model to generate candidate probability distribution of each candidate prediction data of dialogue data based on a target prompt template; wherein the candidate prediction data comprises at least one of biased data and non-biased data, and the candidate probability distribution characterizes: distribution rules of occurrence probabilities of the candidate prediction data;
Based on bias estimation values corresponding to the target prompt templates, performing fusion operation on the obtained candidate probability distributions to obtain fused probability distributions; wherein, fusion probability distribution characterization: the distribution rule of the occurrence probability of each fusion prediction data of the dialogue data comprises at least one of prejudice data and non-prejudice data;
and obtaining a target dialogue prediction result of the dialogue data based on the fusion probability distribution and fusion prediction data based on the occurrence probability meeting a preset probability screening condition.
Optionally, the obtaining module 1104 is configured to perform a fusion operation on the obtained multiple candidate probability distributions based on bias estimation values corresponding to the multiple target alert templates, so as to obtain a fused probability distribution, which is specifically configured to:
respectively carrying out normalization processing on bias estimation values corresponding to the target prompt templates to obtain a plurality of processing values;
and based on the plurality of processing values, weighting and summing the plurality of obtained candidate probability distributions to obtain the fused probability distribution after fusion.
Optionally, the first obtaining module 1101 is specifically configured to:
carrying out recognition processing on the dialogue data to generate recognizable dialogue data;
For at least one candidate alert template, the candidate alert templates are obtained by:
acquiring a prompt associated with the scene intention data based on the scene intention data in the identifiable dialog data, and acquiring at least one training sample associated with the scene intention data, wherein each training sample comprises historical identifiable dialog data and a corresponding dialog marking result;
respectively adding the prompt into identifiable dialogue data and at least one training sample to generate at least two data to be processed added with the prompt;
and after the splicing operation is carried out on at least two data to be processed, obtaining a candidate prompt template.
Optionally, the predictive model is obtained through pre-training, and each candidate prompt template comprises: the system comprises identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
the third obtaining module 1103 is configured to trigger the prediction model to generate a first probability distribution of each first prediction data of the dialogue data based on the candidate alert template using at least one specified attribute, specifically configured to:
And performing iterative training again on the prediction model based on at least one training sample by adopting at least one designated attribute to obtain a first retrained prediction model.
Based on a candidate prompt template, the first prediction model is triggered to generate a first probability distribution of each first prediction data of the dialogue data.
Optionally, the predictive model is obtained through pre-training, and each candidate prompt template comprises: the system comprises identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
the third obtaining module 1103 is configured to trigger the prediction model to generate a second probability distribution of each second prediction data of the dialogue data based on a candidate prompt template by using the modified attribute corresponding to each of the at least one specified attribute, specifically configured to:
adopting at least one modified attribute corresponding to each designated attribute, and performing iterative training again for the prediction model based on at least one training sample to obtain a second prediction model after retraining;
based on a candidate prompt template, a second predictive model is triggered to generate a second probability distribution for each second predictive data of the dialogue data.
The apparatus may be configured to perform the method shown in the embodiments of the present application, so that the foregoing manner of obtaining the target alert template based on the bias evaluation value may be implemented, that is, based on the scene intention of the dialog data to be predicted, obtaining at least one candidate alert template associated with the dialog data, and obtaining at least one specified attribute, that is, an attribute having a gain effect on generating the bias data, and further based on the at least one specified attribute, obtaining bias evaluation values corresponding to the at least one candidate alert template, each bias evaluation value representing: and generating a target dialog prediction result corresponding to the dialog data based on the target prompt template, thereby reducing the generation of the bias data and generating a bias of the target dialog prediction result generated from the suppression prediction model.
It should be noted that, for the functions and the like that can be implemented by each functional module of the device, reference may be made to the description of the foregoing embodiments, which is not repeated.
Referring to fig. 12, based on the same technical concept, the embodiment of the present application further provides a computer device 1200, where the computer device 1200 may be a terminal device or a server shown in fig. 1A or fig. 1B, and the computer device 1200 may include a memory 1201 and a processor 1202.
The memory 1201 is used for storing a computer program executed by the processor 1202. The memory 1201 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. The processor 1202 may be a central processing unit (central processing unit, CPU), or a digital processing unit, or the like. The specific connection medium between the memory 1201 and the processor 1202 is not limited in this embodiment of the application. In the embodiment of the present application, the memory 1201 and the processor 1202 are connected by the bus 1203 in fig. 12, the bus 1203 is shown by a thick line in fig. 12, and the connection manner between other components is only schematically illustrated, which is not limited thereto. The bus 1203 may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 12, but not only one bus or one type of bus.
Memory 1201 may be a volatile memory (RAM), such as random-access memory; the memory 1201 may also be a non-volatile memory (non-volatile memory), such as a read-only memory, a flash memory (flash memory), a Hard Disk Drive (HDD) or a Solid State Drive (SSD), or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 1201 may be a combination of the above memories.
A processor 1202 for executing the methods performed by the apparatus in the embodiments of the present application when invoking a computer program stored in a so-called memory 1201.
In some possible embodiments, aspects of the method provided by the application may also be implemented in the form of a program product comprising program code means for causing a so-called computer device to carry out the steps of the method according to the various exemplary embodiments of the application as described in this specification, when the so-called program product is run on a computer device, e.g. the so-called computer device may carry out the method as carried out by the device in the various embodiments of the application.
The program product may take the form of any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (14)

1. A method of processing dialogue data, comprising:
based on scene intent of dialog data characterization to be predicted, at least one candidate prompt template associated with the dialog data is obtained, each candidate prompt template for: completing the dialogue data under a dialogue scene to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data;
acquiring at least one designated attribute, wherein the designated attribute is as follows: the attribute has a gain effect on generating bias data, the bias data being: evaluation data for characterizing a portion of the objects in the specified population that deviate from a preset population evaluation criterion;
Acquiring bias evaluation values corresponding to the at least one candidate prompt template respectively based on the at least one specified attribute; wherein each of the bias evaluation values characterizes: triggering the prediction model to generate a likelihood of a dialog prediction result containing the bias data based on the corresponding candidate prompt template under the influence of the at least one specified attribute;
selecting a candidate prompt template with the bias evaluation value meeting a preset screening condition as a target prompt template, and obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template.
2. The method of claim 1, wherein the obtaining bias estimates for each of the at least one candidate alert template based on the at least one specified attribute comprises:
for the at least one candidate prompt template, respectively executing the following operations:
triggering the prediction model to generate first probability distribution of each first prediction data of the dialogue data based on a candidate prompt template by adopting the at least one appointed attribute; wherein each of the first predicted data comprises at least one of the biased data and non-biased data, the first probability distribution characterizing: the distribution rule of the occurrence probability of each first prediction data;
Triggering the prediction model to generate second probability distribution of each second prediction data of the dialogue data based on the candidate prompt template by adopting the modification attribute corresponding to each of the at least one designated attribute; wherein each of the modification attributes is: and modifying the attribute category of the corresponding appointed attribute, wherein each second prediction data comprises at least one of the prejudice data and the non-prejudice data, and the second probability distribution represents: the distribution rule of the occurrence probability of each second prediction data;
and taking the distribution similarity between the first probability distribution and the second probability distribution as a bias evaluation value corresponding to the candidate prompt template.
3. The method of claim 2, wherein the distribution similarity between the first probability distribution and the second probability distribution is obtained by:
performing dimension transformation on the first probability distribution or the second probability distribution to obtain first transformation probability distribution and second transformation probability distribution with consistent dimensions;
obtaining a distribution distance between the first transformation probability distribution and the second transformation probability distribution;
And obtaining the distribution similarity between the first probability distribution and the second probability distribution based on the distribution distance.
4. A method according to any one of claims 1 to 3, wherein selecting, as the target alert template, a candidate alert template whose bias evaluation value satisfies a preset screening condition, comprises:
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting a candidate prompt template corresponding to the bias evaluation value of the target position as a target prompt template according to the arrangement result;
or alternatively, the process may be performed,
based on the size of at least one bias evaluation value, arranging the at least one bias evaluation value to obtain an arrangement result, and selecting candidate prompt templates corresponding to a plurality of bias evaluation values which are continuously arranged according to a set number as target prompt templates according to the arrangement result.
5. The method of claim 4, wherein obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template comprises:
when one target prompt template is selected, triggering the prediction model to generate target probability distribution of each candidate prediction data of the dialogue data based on the one target prompt template; wherein the candidate prediction data comprises at least one of the biased data and non-biased data, the target probability distribution characterizing: the distribution rule of the occurrence probability of each candidate prediction data;
And obtaining a target dialogue prediction result of the dialogue data based on the target probability distribution and candidate prediction data with occurrence probability meeting a preset probability screening condition.
6. The method of claim 4, wherein obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template comprises:
when a plurality of target prompt templates are selected, the following operations are respectively executed for the plurality of target prompt templates: triggering the prediction model to generate candidate probability distribution of each candidate prediction data of the dialogue data based on a target prompt template; wherein the candidate prediction data comprises at least one of the biased data and non-biased data, the candidate probability distribution characterizing: the distribution rule of the occurrence probability of each candidate prediction data;
based on bias estimation values corresponding to the target prompt templates, performing fusion operation on the obtained candidate probability distributions to obtain fused probability distributions; wherein the fusion probability distribution characterizes: the distribution rule of the occurrence probability of each fusion prediction data of the dialogue data comprises at least one of the prejudice data and the non-prejudice data;
And obtaining a target dialogue prediction result of the dialogue data based on the fusion probability distribution and fusion prediction data of which the occurrence probability meets a preset probability screening condition.
7. The method of claim 6, wherein the fusing the obtained plurality of candidate probability distributions based on the bias estimates corresponding to the plurality of target alert templates to obtain the fused probability distribution comprises:
respectively carrying out normalization processing on bias estimation values corresponding to the target prompt templates to obtain a plurality of processing values;
and based on the plurality of processing values, weighting and summing the plurality of obtained candidate probability distributions to obtain the fused probability distribution after fusion.
8. A method according to claim 1, 2 or 3, wherein the obtaining at least one candidate alert template associated with the dialog data based on scene intent characterized by the dialog data to be predicted comprises:
performing recognition processing on the dialogue data to generate recognizable dialogue data;
for at least one candidate alert template, the candidate alert templates are obtained by:
acquiring a prompt associated with the scene intention data based on the scene intention data in the identifiable dialog data, and acquiring at least one training sample associated with the scene intention data, wherein each training sample comprises historical identifiable dialog data and a corresponding dialog marking result;
Respectively adding the prompt into the identifiable dialogue data and the at least one training sample to generate at least two data to be processed added with the prompt;
and after the splicing operation is carried out on the at least two data to be processed, obtaining a candidate prompt template.
9. The method of claim 2, wherein the predictive model is obtained via pre-training, each of the candidate hint templates comprising: identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
said triggering said predictive model to generate a first probability distribution for each first predictive data of said session data based on a candidate prompt template using said at least one specified attribute, comprising:
performing iterative training again on the prediction model based on the at least one training sample by adopting the at least one appointed attribute to obtain a first prediction model after retraining;
the first prediction model is triggered to generate a first probability distribution of each first prediction data of the dialogue data based on a candidate prompt template.
10. The method of claim 2, wherein the predictive model is obtained via pre-training, and wherein each candidate hint template comprises: identifiable dialogue data and at least one training sample, wherein the identifiable dialogue data is generated by identifying the dialogue data, and each training sample comprises historical dialogue data and corresponding dialogue marking results;
triggering the prediction model to generate a second probability distribution of each second prediction data of the dialogue data based on the candidate prompt template by adopting the modification attribute corresponding to the at least one designated attribute, wherein the method comprises the following steps:
performing iterative training again on the prediction model based on the at least one training sample by adopting the modified attribute corresponding to each of the at least one designated attribute to obtain a second prediction model after retraining;
triggering the second prediction model to generate a second probability distribution of each second prediction data of the dialogue data based on the one candidate prompt template.
11. A data processing apparatus, comprising
The first acquisition module acquires at least one candidate prompt template associated with dialogue data based on scene intention characterized by the dialogue data to be predicted, wherein each candidate prompt template is used for: completing the dialogue data under a dialogue scene to trigger a prediction model to generate a dialogue prediction result corresponding to the dialogue data;
The second acquisition module acquires at least one designated attribute, wherein the designated attribute is as follows: the attribute has a gain effect on generating bias data, the bias data being: characterizing evaluation data of a portion of the objects in the specified population that deviate from a preset population evaluation criterion;
the third acquisition module is used for acquiring bias evaluation values corresponding to the at least one candidate prompt template respectively based on the at least one designated attribute; wherein each of the bias evaluation values characterizes: triggering the prediction model to generate a likelihood of a dialog prediction result containing the bias data based on the corresponding candidate prompt template under the influence of the at least one specified attribute;
and the obtaining module is used for selecting a candidate prompt template with the bias evaluation value meeting the preset screening condition as a target prompt template and obtaining a target dialog prediction result corresponding to the dialog data based on the target prompt template.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
the processor, when executing the computer program, implements the steps of the method of any one of claims 1 to 10.
13. A computer storage medium having stored thereon computer program instructions, characterized in that,
the computer program instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 10.
14. A computer program product comprising computer program instructions, characterized in that,
the computer program instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 10.
CN202310521368.1A 2023-05-09 2023-05-09 Data processing method and device, storage medium and electronic equipment Pending CN116956856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310521368.1A CN116956856A (en) 2023-05-09 2023-05-09 Data processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310521368.1A CN116956856A (en) 2023-05-09 2023-05-09 Data processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116956856A true CN116956856A (en) 2023-10-27

Family

ID=88457192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310521368.1A Pending CN116956856A (en) 2023-05-09 2023-05-09 Data processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116956856A (en)

Similar Documents

Publication Publication Date Title
CN107846350B (en) Method, computer readable medium and system for context-aware network chat
CN111897941B (en) Dialogue generation method, network training method, device, storage medium and equipment
CN110597991B (en) Text classification method and device, computer equipment and storage medium
CN111028827A (en) Interaction processing method, device, equipment and storage medium based on emotion recognition
US11749274B2 (en) Inference on date time constraint expressions
CN110717514A (en) Session intention identification method and device, computer equipment and storage medium
CN113569892A (en) Image description information generation method and device, computer equipment and storage medium
CN111783903B (en) Text processing method, text model processing method and device and computer equipment
EP3884426B1 (en) Action classification in video clips using attention-based neural networks
CN112799747A (en) Intelligent assistant evaluation and recommendation method, system, terminal and readable storage medium
CN117079299B (en) Data processing method, device, electronic equipment and storage medium
CN111539903A (en) Method and device for training face image synthesis model
CN114913590A (en) Data emotion recognition method, device and equipment and readable storage medium
CN116152938A (en) Method, device and equipment for training identity recognition model and transferring electronic resources
CN116975347A (en) Image generation model training method and related device
CN113360630B (en) Interactive information prompting method
CN116955543A (en) Continuity evaluation model training and continuity evaluation method, device and equipment
CN115688758A (en) Statement intention identification method and device and storage medium
CN116956856A (en) Data processing method and device, storage medium and electronic equipment
US20220310087A1 (en) Method and system for tracking in extended reality
CN114201595A (en) Sentence recommendation method and device in conversation, storage medium and electronic equipment
CN115687910A (en) Data processing method and device, computer equipment and readable storage medium
CN116705013B (en) Voice wake-up word detection method and device, storage medium and electronic equipment
CN114048319B (en) Humor text classification method, device, equipment and medium based on attention mechanism
CN113761837B (en) Entity relationship type determining method, device and equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication