User tag prediction method and device, electronic equipment and storage medium
The user label prediction method addresses inefficiencies in manual classification by evaluating dialogue text and training models, resulting in improved accuracy and speed for user label classification.
Patent Information
- Application Number
- CN202411677267.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-14
AI Technical Summary
The inefficiency of manual user label classification due to large user numbers and diverse label types leads to low classification efficiency.
A user label prediction method involving sample dialogue text evaluation using pre-set dialogue label association models, filtering, and training models to enhance label classification accuracy and speed.
The method reduces data quantity and improves training speed and precision, enabling better perception of label associations and accurate user label prediction.
Smart Images

Figure CN119622410A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and in particular to a method and device for predicting user tags, an electronic device, and a storage medium. Background Art
[0002] User tags are identifiers used to describe and classify user characteristics, behaviors, interests or preferences. For example, user tags can be "outdoor enthusiasts", "technology enthusiasts" or "parents with children". In the existing user tag classification, user tag classification is usually performed manually. However, due to the large number of users and a wide variety of tags, manual tag classification for users is inefficient. Therefore, how to improve the efficiency of user tag classification has become an urgent problem to be solved. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a user tag prediction method and device, an electronic device and a storage medium, aiming to improve the efficiency of user tag classification.
[0004] To achieve the above object, a first aspect of an embodiment of the present application proposes a user tag prediction method, the method comprising:
[0005] Obtain a sample conversation text of a sample object, and obtain a sample object label of the sample object;
[0006] Performing a relevance dialogue evaluation on the sample dialogue text based on a preset dialogue tag relevance evaluation model to obtain dialogue relevance evaluation data; wherein the dialogue relevance evaluation data is used to indicate the relevance between the sample dialogue text and the sample object tag;
[0007] Performing text screening on the sample dialogue text according to the dialogue tag evaluation data to obtain associated dialogue text;
[0008] Performing model training on a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model;
[0009] The target dialogue text of the target object is obtained, and label classification prediction is performed on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text to obtain the target object label.
[0010] In some embodiments, the preset dialogue tag relevance evaluation model includes an irrelevant dialogue tag evaluation model and a relevant dialogue tag evaluation model; performing a relevant dialogue evaluation on the sample dialogue text based on the preset dialogue tag relevance evaluation model to obtain dialogue relevance evaluation data includes:
[0011] Performing irrelevant dialogue evaluation on the sample dialogue text based on the irrelevant dialogue label evaluation model to obtain irrelevant dialogue evaluation data;
[0012] Perform irrelevant text screening on the sample conversation text according to the irrelevant conversation evaluation data to obtain a sample initial text;
[0013] Performing a dialogue evaluation on the sample initial text based on the dialogue tag evaluation model to obtain dialogue evaluation data;
[0014] The irrelevant conversation evaluation data and the relevant conversation evaluation data are combined to obtain the conversation relevance evaluation data.
[0015] In some embodiments, the irrelevant dialogue tag evaluation model includes an irrelevant dialogue embedding encoding layer, an irrelevant dialogue decoding layer, and an irrelevant dialogue evaluation layer; performing irrelevant dialogue evaluation on the sample dialogue text based on the irrelevant dialogue tag evaluation model to obtain irrelevant dialogue evaluation data includes:
[0016] Based on the irrelevant dialogue embedding coding layer, the sample dialogue text is embedded and coded to obtain irrelevant dialogue embedding coding features;
[0017] Performing text decoding on the irrelevant dialogue embedding coding features based on the irrelevant dialogue decoding layer to obtain irrelevant dialogue decoding features;
[0018] An irrelevant dialogue evaluation is performed on the irrelevant dialogue decoding feature based on the irrelevant dialogue evaluation layer to obtain the irrelevant dialogue evaluation data.
[0019] In some embodiments, the dialogue tag evaluation model includes a dialogue embedding layer, a dialogue encoding layer, and a dialogue evaluation layer; and performing dialogue evaluation on the sample initial text based on the dialogue tag evaluation model to obtain dialogue evaluation data includes:
[0020] Performing text embedding on the sample initial text based on the relevant dialogue embedding layer to obtain relevant dialogue embedding features;
[0021] Performing text encoding on the relevant conversation embedding features based on the relevant conversation encoding layer to obtain target classification mark features;
[0022] Based on the relevant dialogue evaluation layer, the target classification mark feature is subjected to relevant dialogue evaluation to obtain the relevant dialogue evaluation data.
[0023] In some embodiments, the performing model training on a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model includes:
[0024] Perform label classification prediction on the sample object based on the preset label classification prediction model and the associated dialogue text to obtain a sample prediction label;
[0025] Perform cross entropy loss calculation based on the sample object label and the sample prediction label to obtain a training loss value;
[0026] The preset label classification prediction model is optimized based on the training loss value to obtain the target label classification prediction model.
[0027] In some embodiments, obtaining a sample conversation text of a sample object includes:
[0028] Acquire a sample conversation speech of the sample object;
[0029] Performing speech-to-text conversion according to the sample conversation speech to obtain an original conversation text;
[0030] Keyword screening is performed according to the original dialogue text to obtain the sample dialogue text.
[0031] In some embodiments, the keyword screening according to the original conversation text to obtain the sample conversation text includes:
[0032] Performing word segmentation on the original dialogue text to obtain original dialogue words;
[0033] Matching the original conversation words with a preset keyword word library to obtain keyword matching information;
[0034] The original dialogue text is screened based on the keyword matching information to obtain the sample dialogue text.
[0035] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a user tag prediction device, the device comprising:
[0036] A data acquisition module, used to acquire a sample conversation text of a sample object and acquire a sample object label of the sample object;
[0037] A dialogue evaluation module, configured to perform a dialogue association evaluation on the sample dialogue text based on a preset dialogue tag association evaluation model to obtain dialogue association evaluation data; wherein the dialogue association evaluation data is used to indicate the association between the sample dialogue text and the sample object tag;
[0038] A text screening module, used for screening the sample dialogue text according to the dialogue tag evaluation data to obtain associated dialogue text;
[0039] A model training module, used to perform model training on a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model;
[0040] The label prediction module is used to obtain the target dialogue text of the target object, and perform label classification prediction on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text to obtain the target object label.
[0041] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0042] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0043] The present application proposes a user label prediction method and device, electronic device and storage medium, which obtains a sample conversation text of a sample object and a sample object label of the sample object, and then performs a related conversation evaluation on the sample conversation text based on a preset conversation label relevance evaluation model to obtain conversation relevance evaluation data, and then performs text screening on the sample conversation text according to the conversation label evaluation data to obtain related conversation text, thereby screening out conversations related to label prediction from the conversation records of the sample object, and providing more accurate conversation text data for subsequent training of a preset label classification prediction model, which on the one hand reduces the amount of data and improves the training speed, and on the other hand improves the data accuracy and the training accuracy, so that the preset label classification prediction model has a good perception ability of the potential association between label prediction and conversation data, and obtains a target label classification prediction model that can accurately predict the label of the object; further, the target label classification prediction model, the target conversation text of the target object and the preset conversation label relevance evaluation model are used to perform label classification prediction on the target object to obtain the target object label, thereby realizing rapid label classification of the target object. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flowchart of a user tag prediction method provided by an embodiment of the present application;
[0045] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0046] Figure 3 yes Figure 2 Flow chart of step S203 in FIG.
[0047] Figure 4 yes Figure 1 Flow chart of step S102 in FIG.
[0048] Figure 5 yes Figure 4 Flow chart of step S401 in FIG.
[0049] Figure 6 yes Figure 4 Flow chart of step S403 in FIG.
[0050] Figure 7 yes Figure 1 Flow chart of step S104 in FIG.
[0051] Figure 8 is a schematic diagram of the structure of a user tag prediction device provided in an embodiment of the present application;
[0052] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0056] First, some nouns involved in this application are analyzed:
[0057] Large Language Model (LLM): A software system trained using deep learning technology, specifically designed to understand and generate text in human language. Large language models are important achievements in the fields of artificial intelligence and natural language processing, and are a branch of computer science. These models learn the complexity, grammatical structure, and semantic information of a language by analyzing large amounts of text data. Large language models have a wide range of applications, including but not limited to text generation, machine translation, content summarization, sentiment analysis, dialogue systems, and assisted writing. By simulating the human language understanding and generation process, large language models can demonstrate excellent performance on a variety of language tasks, further promoting the development of artificial intelligence technology and the realization of intelligent applications.
[0058] Bidirectional Encoder Representations from Transformers (BERT): BERT is a Transformer-based deep learning model for processing and understanding natural language. It is an important technology in the field of artificial intelligence and natural language processing, and is a branch of computer science. The BERT model is characterized by its bidirectional training architecture, which learns information from both left-to-right and right-to-left text contexts. This approach can more comprehensively capture contextual relationships in language. The bidirectional encoder representation model performs well in many natural language processing tasks, including but not limited to text classification, question-answering systems, text summarization, and machine translation. By pre-training language models on a large corpus, BERT is able to understand complex language patterns and then fine-tune them on specific tasks to improve the model's understanding ability and performance. This technology has greatly promoted the development of artificial intelligence technology and the application of natural language processing by simulating the human language understanding process.
[0059] User tags are identifiers used to describe and classify user characteristics, behaviors, interests or preferences. For example, user tags can be "outdoor enthusiasts", "technology enthusiasts" or "parents with children". In the existing user tag classification, user tag classification is usually performed manually. However, due to the large number of users and a wide variety of tags, manual tag classification for users is inefficient. Therefore, how to improve the efficiency of user tag classification has become an urgent problem to be solved.
[0060] Based on this, the embodiments of the present application provide a user tag prediction method and device, an electronic device and a storage medium, aiming to improve the efficiency of tag classification for users.
[0061] A user tag prediction method and device, electronic device, and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the user tag prediction method in the embodiments of the present application is described.
[0062] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0063] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0064] The user tag prediction method provided in the embodiment of the present application relates to the field of text processing technology. The user tag prediction method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the user tag prediction method, etc., but is not limited to the above forms.
[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0066] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0067] Figure 1 is an optional flowchart of the user tag prediction method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.
[0068] Step S101, obtaining a sample conversation text of a sample object and obtaining a sample object label of the sample object;
[0069] Step S102, performing a relevance dialogue evaluation on the sample dialogue text based on a preset dialogue tag relevance evaluation model to obtain dialogue relevance evaluation data; wherein the dialogue relevance evaluation data is used to indicate the relevance between the sample dialogue text and the sample object tag;
[0070] Step S103, screening the sample dialogue text according to the dialogue tag evaluation data to obtain the associated dialogue text;
[0071] Step S104, training a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model;
[0072] Step S105, obtaining the target dialogue text of the target object, performing label classification prediction on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text, and obtaining the target object label.
[0073] In steps S101 to S105 shown in the embodiment of the present application, by obtaining a sample conversation text of a sample object and a sample object label of the sample object, then performing a related conversation evaluation on the sample conversation text based on a preset conversation label association evaluation model to obtain conversation association evaluation data, and then performing text screening on the sample conversation text according to the conversation label evaluation data to obtain related conversation text, thereby screening out conversations related to label prediction from the conversation records of the sample object, and providing more accurate conversation text data for subsequent training of a preset label classification prediction model. On the one hand, the amount of data is reduced and the training speed is increased, and on the other hand, the accuracy of the data is improved and the accuracy of the training is improved, so that the preset label classification prediction model has a good perception of the potential association between label prediction and conversation data, and obtains a target label classification prediction model that can accurately predict the label of the object; further, the target label classification prediction model, the target conversation text of the target object and the preset conversation label association evaluation model are used to perform label classification prediction on the target object to obtain the target object label, thereby realizing rapid label classification of the target object.
[0074] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S203:
[0075] Step S201, obtaining a sample conversation speech of a sample object;
[0076] Step S202, performing speech-to-text conversion based on the sample conversation speech to obtain the original conversation text;
[0077] Step S203, performing keyword screening based on the original conversation text to obtain a sample conversation text.
[0078] Steps S201 to S203 shown in the embodiment of the present application obtain sample conversation speech of the sample object, then perform speech-to-text conversion based on the sample conversation speech to obtain the original conversation text, and finally perform keyword screening based on the original conversation text to obtain the sample conversation text, thereby realizing the transformation of speech processing into text processing, so as to use more accurate text processing technology for label prediction. At the same time, keyword-based screening improves the accuracy of conversation data and filters out irrelevant conversations. On the one hand, it improves the training speed of the subsequent target label classification prediction model, and on the other hand, it improves the perception ability of the target label classification prediction model, thereby improving the accuracy and speed of label classification prediction.
[0079] In step S201 of some embodiments, the sample conversation voice of the sample subject refers to a recording of the sample subject communicating with a customer service agent, and the sample conversation voice includes recordings of both the sample subject and the customer service agent.
[0080] In step S202 of some embodiments, speech-to-text conversion refers to converting the sample conversation speech into text to obtain the original conversation text. For example, the original conversation text is:
[0081] Subject: "Oh and that dog training pet store."
[0082] Customer service: “What?”.
[0083] Subject: "Dog training pet store".
[0084] Customer Service: “It’s a pet shop, right?”
[0085] See also Figure 3 In some embodiments, step S203 may include but is not limited to steps S301 to S303:
[0086] Step S301, segmenting the original dialogue text into words to obtain original dialogue words;
[0087] Step S302, matching the original conversation words with a preset keyword word library to obtain keyword matching information;
[0088] Step S303, screening the original dialogue text based on the keyword matching information to obtain a sample dialogue text.
[0089] In steps S301 to S303 shown in the embodiment of the present application, the original dialogue text is segmented to obtain original dialogue words, and then the original dialogue words are matched with a preset keyword vocabulary to obtain keyword matching information. Finally, the original dialogue text is screened based on the keyword matching information to obtain a sample dialogue text, so as to filter the dialogues in the dialogue data that match the keywords, thereby reducing the amount of data and improving the data accuracy. In the training of subsequent models, on the one hand, the training speed of the subsequent target label classification prediction model is improved, and on the other hand, the perception ability of the target label classification prediction model is improved, thereby improving the accuracy and speed of label classification prediction.
[0090] In step S301 of some embodiments, word segmentation refers to the process of dividing a continuous text sequence into independent words or phrases, that is, dividing the original dialogue text into independent words or phrases, and the original dialogue words refer to the independent words or phrases extracted after the word segmentation process. For example, if the original dialogue text is "My child is going to school recently, and I need to renew my car insurance", the original dialogue words are "I / recently / child / goes to school / , / need / renew / car insurance / .".
[0091] In step S302 of some embodiments, the preset keyword word library is a set of keywords that have been defined and organized in advance, such as "children, retirement, white-collar workers, auto insurance, health insurance, and claim application, etc." Matching refers to comparing the original conversation words with the keywords in the preset keyword word library to determine whether there are identical keywords in the original conversation words. If there are identical keywords, the keyword matching information is a match. If there are no identical keywords, the keyword matching information is a mismatch. For example, the original conversation words are "I / recently / children / go to school / , / need / renew / auto insurance / ." 。 The preset keyword vocabulary is "children, retirement, white-collar workers, auto insurance, health insurance and claim application", and the matching information is a match.
[0092] In step S303 of some embodiments, when the keyword matching information is a match, several sentences above and below the sentence corresponding to the keyword are screened out to obtain a sample dialogue text. For example, there are 10 dialogues, namely the first sentence, the second sentence, ... the tenth sentence, and the dialogue screening threshold is set to 3 sentences above and below. When the keyword matching information of the fifth sentence is a match, the second sentence to the eighth sentence are screened out as the sample dialogue text.
[0093] See also Figure 4 In some embodiments, the preset dialogue tag relevance evaluation model includes an irrelevant dialogue tag evaluation model and a relevant dialogue tag evaluation model. Step S102 may include but is not limited to steps S401 to S404:
[0094] Step S401, performing irrelevant dialogue evaluation on the sample dialogue text based on the irrelevant dialogue tag evaluation model to obtain irrelevant dialogue evaluation data;
[0095] Step S402, screening irrelevant texts from the sample conversation text according to the irrelevant conversation evaluation data to obtain a sample initial text;
[0096] Step S403, performing a dialogue evaluation on the sample initial text based on the dialogue tag evaluation model to obtain dialogue evaluation data;
[0097] Step S404: merging the irrelevant conversation evaluation data and the relevant conversation evaluation data to obtain conversation relevance evaluation data.
[0098] In steps S401 to S404 shown in the embodiment of the present application, an irrelevant conversation evaluation is performed on the sample conversation text based on the irrelevant conversation label evaluation model to obtain irrelevant conversation evaluation data, and then the sample conversation text is screened for irrelevant text based on the irrelevant conversation evaluation data to obtain the sample initial text, and then a relevant conversation evaluation is performed on the sample initial text based on the relevant conversation label evaluation model to obtain relevant conversation evaluation data, and finally data is merged based on the irrelevant conversation evaluation data and the relevant conversation evaluation data to obtain conversation relevance evaluation data, so as to provide more accurate conversation text data for subsequent training of the preset label classification prediction model, which, on the one hand, reduces the amount of data and improves the training speed, and on the other hand improves the accuracy of the data and the accuracy of the training, so that the preset label classification prediction model has a good perception of the potential correlation between the label prediction and the conversation data, and obtains a target label classification prediction model that can accurately predict the label of the object.
[0099] See also Figure 5 In some embodiments, the irrelevant dialogue tag evaluation model includes an irrelevant dialogue embedding encoding layer, an irrelevant dialogue decoding layer, and an irrelevant dialogue evaluation layer. Step S401 includes but is not limited to steps S501 to S503:
[0100] Step S501, embedding and encoding the sample conversation text based on the irrelevant conversation embedding coding layer to obtain irrelevant conversation embedding coding features;
[0101] Step S502, text decoding is performed on the irrelevant dialogue embedded coding features based on the irrelevant dialogue decoding layer to obtain irrelevant dialogue decoding features;
[0102] Step S503: performing irrelevant dialogue evaluation on the irrelevant dialogue decoding features based on the irrelevant dialogue evaluation layer to obtain irrelevant dialogue evaluation data.
[0103] In steps S501 to S503 shown in the embodiment of the present application, the sample conversation text is embedded and encoded based on the irrelevant conversation embedding coding layer to obtain irrelevant conversation embedding coding features, and then the irrelevant conversation embedding coding features are text-decoded based on the irrelevant conversation decoding layer to obtain irrelevant conversation decoding features, and finally the irrelevant conversation decoding features are evaluated based on the irrelevant conversation evaluation layer to obtain irrelevant conversation evaluation data, so as to further screen the sample conversation text, determine irrelevant conversations in the sample conversation text, and obtain irrelevant conversation evaluation data.
[0104] In steps S501 to S503 of some embodiments, the irrelevant dialogue label evaluation model is a pre-trained large language model (LLMs), which is based on the Transformer architecture. The large language model based on the Transformer includes an embedding layer, an encoding layer, a decoding layer, and an output layer. The irrelevant dialogue embedding encoding layer in the irrelevant dialogue label evaluation model is the embedding layer and the encoding layer in the Transformer architecture, the irrelevant dialogue decoding layer in the irrelevant dialogue label evaluation model is the encoding layer in the Transformer architecture, and the irrelevant dialogue evaluation layer in the irrelevant dialogue label evaluation model is the decoding layer and the output layer in the Transformer architecture. In the irrelevant dialogue label evaluation model based on the Transformer architecture, the accuracy of irrelevant clue inference for the sample dialogue text is higher, so the irrelevant dialogue label evaluation model based on the Transformer has a better effect in irrelevant dialogue evaluation.
[0105] Irrelevant clues are inferred to determine the relationship between text and labels. For example, if the label is "parents with children" and the sample conversation text is "I recently fell in love with the new mobile phone and I am very satisfied with it." The clue is inferred to be "irrelevant clue" and the irrelevant conversation evaluation data is: "irrelevant."
[0106] For example, if the label is "sports enthusiast" and the sample conversation text data is "I recently bought a new computer and it runs very smoothly.", then the clue is inferred to be "irrelevant clue" and the irrelevant conversation evaluation data is "irrelevant".
[0107] It should be noted that a sample conversation text may be inferred with multiple labels. For example, if the sample conversation data is "I recently bought a new computer, and it runs very smoothly.", irrelevant clues will be inferred for multiple labels separately, such as inferring the labels "parents with children" and "sports enthusiasts" separately, so as to evaluate the sample conversation text for irrelevant conversations. The irrelevant conversation evaluation data includes evaluation data for multiple labels. For example, if there are 10 labels in total, the irrelevant conversation label evaluation model will evaluate the irrelevant conversations for the 10 labels separately. If it is determined that the sample conversation text is irrelevant to all 10 labels, the irrelevant conversation evaluation data is determined to be 1, that is, the sample conversation text is an irrelevant conversation. If it is determined that the sample conversation text is not irrelevant to all labels, the irrelevant conversation evaluation data is determined to be 0, that is, the sample conversation text may be associated with the label.
[0108] In step S402 of some embodiments, irrelevant text is screened for the sample dialogue text according to the irrelevant dialogue evaluation data. For example, if the irrelevant dialogue evaluation data corresponding to the sample dialogue text is 1, the sample dialogue text is screened out. For example, if the irrelevant dialogue evaluation data corresponding to the sample dialogue text is 0, the sample dialogue data is retained, and irrelevant text is screened for each sample dialogue text, and the retained sample dialogue data is used as the sample initial text.
[0109] See also Figure 6 In some embodiments, the conversation tag evaluation model includes a conversation embedding layer, a conversation encoding layer, and a conversation evaluation layer. Step S403 includes but is not limited to steps S601 to S603:
[0110] Step S601, embedding the sample initial text based on the relevant dialogue embedding layer to obtain relevant dialogue embedding features;
[0111] Step S602, text encoding is performed on the relevant dialogue embedding features based on the relevant dialogue encoding layer to obtain target classification mark features;
[0112] Step S603, performing relevant dialogue evaluation on the target classification mark features based on the relevant dialogue evaluation layer to obtain relevant dialogue evaluation data.
[0113] In steps S601 to S603 shown in the embodiment of the present application, text embedding is performed on the sample initial text based on the relevant dialogue embedding layer to obtain relevant dialogue embedding features, and then text encoding is performed on the relevant dialogue embedding features based on the relevant dialogue encoding layer to obtain target classification label features, and relevant dialogue evaluation is performed on the target classification label features based on the relevant dialogue evaluation layer to obtain relevant dialogue evaluation data for further data screening, thereby making the prediction accuracy of the subsequent target label classification prediction model higher.
[0114] In steps S601 to S603 of some embodiments, the dialogue tag evaluation model is a pre-trained bidirectional encoder representation model (Bidirectional Encoder Representations from Transformers, BERT) model, and the BERT model includes an input representation layer, an encoding layer, and an output layer.
[0115] The conversation embedding layer in the conversation tag evaluation model is the input representation layer in the BERT model, which includes the word embedding layer, position embedding layer, and segment embedding layer. The conversation embedding layer is used to convert the sample initial text into a vector representation that BERT can understand.
[0116] The conversation encoding layer in the conversation tag evaluation model is the encoding layer in the BERT model, which specifically includes a multi-head attention layer, a feedforward neural network, a residual connection and normalization, and is used to extract higher-level feature representations from the conversation embedding features and preset classification tag features.
[0117] The conversation evaluation layer in the conversation label evaluation model is the output layer in the BERT model, which specifically includes a fully connected layer and an activation function, which is used to convert the output of the encoder into a binary classification label.
[0118] The conversation embedding layer, the conversation encoding layer and the conversation evaluation layer are connected in sequence to form a conversation label evaluation model. The sample initial text is input into the conversation label evaluation model to obtain the final conversation evaluation data. For example, if the label is "electronic product enthusiast" and the sample conversation text data is "I recently bought a new computer and it runs very smoothly.", the clue is inferred to be "relevant clue" and the conversation evaluation data is "relevant".
[0119] It should be noted that the irrelevant dialogue label evaluation model based on the Transformer architecture is more accurate in inferring irrelevant clues, and the relevant dialogue label evaluation model based on the BERT architecture is more accurate in inferring relevant clues. Preliminary screening is performed through the irrelevant dialogue label evaluation model and further screening is performed through the relevant dialogue label evaluation model. On the one hand, the amount of data is reduced and the training speed is increased, and on the other hand, the data accuracy is improved. The training accuracy is improved, so that the preset label classification prediction model has a good perception of the potential correlation between label prediction and dialogue data, and a target label classification prediction model that can accurately predict the label of the object is obtained.
[0120] In step S404 of some embodiments, data is merged based on the irrelevant conversation evaluation data and the relevant conversation evaluation data to obtain conversation relevance evaluation data. The data is merged in a manner to determine whether there is an association between each sample conversation text and the sample object label based on the irrelevant conversation evaluation data and the relevant conversation evaluation data. If there is an association, the conversation relevance evaluation data is determined to be "associated". If there is no association, the conversation relevance evaluation data is determined to be "unassociated".
[0121] For example, the sample conversation text includes a first conversation. The irrelevant conversation label evaluation model determines that there is no correlation between the first conversation and the first label, that is, the irrelevant conversation evaluation data is 1. In this case, the first conversation will be directly screened out and will not be subsequently evaluated by the relevant conversation label evaluation model. In this case, the relevant conversation evaluation data of the first conversation is empty, and the conversation relevance evaluation data is determined to be "not related" when the data is merged.
[0122] For example, the sample conversation text includes a first conversation. The first conversation and the first label are determined to be related by the irrelevant conversation label evaluation model, that is, the irrelevant conversation evaluation data is 0. Since the irrelevant conversation label evaluation model based on the Transformer architecture is inaccurate in inferring relevant clues, the relevant conversation label evaluation model will be used to further evaluate the first conversation.
[0123] If the relevant dialogue tag evaluation model determines that there is a correlation, that is, the relevant dialogue evaluation data is 1, the dialogue relevance evaluation data of the first dialogue is determined to be "related" when the data is merged.
[0124] If the relevant dialogue label evaluation model determines that there is no correlation, and the judgment results of the irrelevant dialogue label evaluation model and the relevant dialogue label evaluation model conflict, then the first dialogue is determined to be a semantically unclear dialogue, and the dialogue relevance evaluation data of the first dialogue is determined to be "no correlation", thereby filtering out the data to avoid a decrease in accuracy caused by subsequent label predictions based on semantically unclear dialogues.
[0125] In step S103 of some embodiments, text screening is to screen out the dialogue tag evaluation data according to the dialogue tag evaluation data, specifically, to screen out the sample dialogue texts corresponding to "unrelated" in the dialogue tag evaluation data, and to retain the sample dialogue texts corresponding to "related" to obtain the related dialogue texts.
[0126] See also Figure 7 In some embodiments, step S104 may include but is not limited to steps S701 to S703:
[0127] Step S701, performing label classification prediction on the sample object based on a preset label classification prediction model and associated dialogue text to obtain a sample prediction label;
[0128] Step S702, performing cross entropy loss calculation based on the sample object label and the sample prediction label to obtain a training loss value;
[0129] Step S703, optimizing the parameters of the preset label classification prediction model based on the training loss value to obtain the target label classification prediction model.
[0130] In steps S701 to S703 shown in the embodiment of the present application, label classification prediction is performed on the sample object based on the preset label classification prediction model and the associated conversation text to obtain the sample prediction label, and then the cross entropy loss is calculated based on the sample object label and the sample prediction label to obtain the training loss value, and finally the preset label classification prediction model is parameter optimized based on the training loss value to obtain the target label classification prediction model, thereby obtaining a target label classification prediction model that can accurately predict labels from conversations.
[0131] In step S701 of some embodiments, the associated conversation text is input into a preset label classification prediction model, and the preset label classification prediction model performs classification prediction to obtain a sample prediction label, which is a label of the sample object, such as "middle-aged people", "young people", "digital enthusiasts", etc. The preset label classification prediction model is a multi-classification prediction model based on BERT, which can receive text input and output the probability of each preset label, and then determine the label of the sample object based on a predetermined probability threshold. For example, the preset label classification prediction model outputs that the probability of "middle-aged people" is 0.55, the probability of "young people" is 0.45, the probability of "digital enthusiasts" is 0.6, and the probability of "movie enthusiasts" is 0.8. The probability threshold is 0.5, then the sample prediction labels of the sample object are determined to be "digital enthusiasts", "middle-aged people" and "movie enthusiasts".
[0132] In step S702 of some embodiments, the sample object label and the sample prediction label are introduced into a preset cross entropy loss value formula, and the cross entropy loss value is calculated to obtain a training loss value.
[0133] In step S703 of some embodiments, the preset label classification prediction model is optimized based on the training loss value to obtain a target label classification prediction model, and the parameter optimization is to optimize the preset label classification prediction model based on the stochastic gradient descent method, so that the target label classification prediction model can well perceive the relationship between the conversation and the label, and obtain a target label classification prediction model that can make accurate predictions.
[0134] In step S105 of some embodiments, a target conversation text between a target object and a customer service representative is obtained, and then the target conversation text is screened based on a preset conversation tag relevance evaluation model to obtain a target screened text, and then the target screened text is input into a target tag classification prediction model for tag prediction to obtain a target object tag of the target object.
[0135] See also Figure 8 The embodiment of the present application also provides a user tag prediction device, which can implement the above-mentioned user tag prediction method, and the device includes:
[0136] The data acquisition module 801 is used to acquire the sample conversation text of the sample object and acquire the sample object label of the sample object;
[0137] A dialogue evaluation module 802 is used to perform a dialogue correlation evaluation on the sample dialogue text based on a preset dialogue tag correlation evaluation model to obtain dialogue correlation evaluation data; wherein the dialogue correlation evaluation data is used to indicate the correlation between the sample dialogue text and the sample object tag;
[0138] A text screening module 803 is used to screen the sample dialogue text according to the dialogue tag evaluation data to obtain the associated dialogue text;
[0139] A model training module 804 is used to perform model training on a preset label classification prediction model according to the associated dialogue text and the sample object label of the sample object to obtain a target label classification prediction model;
[0140] The label prediction module 805 is used to obtain the target dialogue text of the target object, perform label classification prediction on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text, and obtain the target object label.
[0141] The specific implementation of the user tag prediction device is basically the same as the specific implementation of the above-mentioned user tag prediction method, and will not be repeated here.
[0142] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above user tag prediction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0143] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0144] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0145] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the user tag prediction method of the embodiment of this application;
[0146] Input / output interface 903, used to implement information input and output;
[0147] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0148] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0149] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0150] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned user tag prediction method is implemented.
[0151] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0152] The user label prediction method, user label prediction device, electronic device and storage medium provided in the embodiments of the present application obtain sample conversation text of a sample object and a sample object label of the sample object, then perform a related conversation evaluation on the sample conversation text based on a preset conversation label relevance evaluation model to obtain conversation relevance evaluation data, and then perform text screening on the sample conversation text according to the conversation label evaluation data to obtain related conversation text, thereby screening out conversations related to label prediction from the conversation records of the sample object, and providing more accurate conversation text data for subsequent training of a preset label classification prediction model, which, on the one hand, reduces the amount of data and improves the training speed, and on the other hand, improves the data accuracy and the training precision, so that the preset label classification prediction model has a good perception ability of the potential association between label prediction and conversation data, and obtains a target label classification prediction model that can accurately predict the label of the object; further, the target label classification prediction model, the target conversation text of the target object and the preset conversation label relevance evaluation model are used to perform label classification prediction on the target object to obtain the target object label, thereby realizing rapid label classification of the target object.
[0153] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0154] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0155] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0157] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0158] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0160] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0163] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A user tag prediction method, characterized in that: The method comprises: Obtain a sample conversation text of a sample object, and obtain a sample object label of the sample object; Performing a relevance dialogue evaluation on the sample dialogue text based on a preset dialogue tag relevance evaluation model to obtain dialogue relevance evaluation data; wherein the dialogue relevance evaluation data is used to indicate the relevance between the sample dialogue text and the sample object tag; Performing text screening on the sample dialogue text according to the dialogue tag evaluation data to obtain associated dialogue text; Performing model training on a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model; The target dialogue text of the target object is obtained, and label classification prediction is performed on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text to obtain the target object label.
2. The method according to claim 1, characterized in that The preset dialogue tag relevance evaluation model includes an irrelevant dialogue tag evaluation model and a relevant dialogue tag evaluation model; the dialogue relevance evaluation is performed on the sample dialogue text based on the preset dialogue tag relevance evaluation model to obtain dialogue relevance evaluation data, including: Performing irrelevant dialogue evaluation on the sample dialogue text based on the irrelevant dialogue label evaluation model to obtain irrelevant dialogue evaluation data; Perform irrelevant text screening on the sample conversation text according to the irrelevant conversation evaluation data to obtain a sample initial text; Performing a dialogue evaluation on the sample initial text based on the dialogue tag evaluation model to obtain dialogue evaluation data; The irrelevant conversation evaluation data and the relevant conversation evaluation data are combined to obtain the conversation relevance evaluation data.
3. The method according to claim 2, characterized in that The irrelevant dialogue tag evaluation model includes an irrelevant dialogue embedding encoding layer, an irrelevant dialogue decoding layer and an irrelevant dialogue evaluation layer; the irrelevant dialogue evaluation is performed on the sample dialogue text based on the irrelevant dialogue tag evaluation model to obtain irrelevant dialogue evaluation data, including: Based on the irrelevant dialogue embedding coding layer, the sample dialogue text is embedded and coded to obtain irrelevant dialogue embedding coding features; Performing text decoding on the irrelevant dialogue embedding coding features based on the irrelevant dialogue decoding layer to obtain irrelevant dialogue decoding features; An irrelevant dialogue evaluation is performed on the irrelevant dialogue decoding feature based on the irrelevant dialogue evaluation layer to obtain the irrelevant dialogue evaluation data.
4. The method according to claim 2, characterized in that: The dialogue tag evaluation model includes a dialogue embedding layer, a dialogue encoding layer and a dialogue evaluation layer; the dialogue evaluation is performed on the sample initial text based on the dialogue tag evaluation model to obtain dialogue evaluation data, including: Performing text embedding on the sample initial text based on the relevant dialogue embedding layer to obtain relevant dialogue embedding features; Performing text encoding on the relevant conversation embedding features based on the relevant conversation encoding layer to obtain target classification mark features; Based on the relevant dialogue evaluation layer, the target classification mark feature is subjected to relevant dialogue evaluation to obtain the relevant dialogue evaluation data.
5. The method according to claim 1, characterized in that The step of training a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model includes: Perform label classification prediction on the sample object based on the preset label classification prediction model and the associated dialogue text to obtain a sample prediction label; Perform cross entropy loss calculation based on the sample object label and the sample prediction label to obtain a training loss value; The preset label classification prediction model is optimized based on the training loss value to obtain the target label classification prediction model.
6. The method according to claim 1, characterized in that The step of obtaining the sample conversation text of the sample object includes: Acquire a sample conversation speech of the sample object; Performing speech-to-text conversion according to the sample conversation speech to obtain an original conversation text; Keyword screening is performed according to the original dialogue text to obtain the sample dialogue text.
7. The method according to claim 6, characterized in that The step of performing keyword screening according to the original dialogue text to obtain the sample dialogue text includes: Performing word segmentation on the original dialogue text to obtain original dialogue words; Matching the original conversation words with a preset keyword word library to obtain keyword matching information; The original dialogue text is screened based on the keyword matching information to obtain the sample dialogue text.
8. A user tag prediction device, characterized in that: The device comprises: A data acquisition module, used to acquire a sample conversation text of a sample object and acquire a sample object label of the sample object; A dialogue evaluation module, configured to perform a dialogue association evaluation on the sample dialogue text based on a preset dialogue tag association evaluation model to obtain dialogue association evaluation data; wherein the dialogue association evaluation data is used to indicate the association between the sample dialogue text and the sample object tag; A text screening module, used for screening the sample dialogue text according to the dialogue tag evaluation data to obtain associated dialogue text; A model training module, used to perform model training on a preset label classification prediction model according to the associated conversation text and the sample object label of the sample object to obtain a target label classification prediction model; The label prediction module is used to obtain the target dialogue text of the target object, and perform label classification prediction on the target object based on the preset dialogue label relevance evaluation model, the target label classification prediction model and the target dialogue text to obtain the target object label.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the user tag prediction method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the user tag prediction method according to any one of claims 1 to 7 is implemented.