Viewpoint recognition method, device and equipment and computer readable storage medium

By establishing a hierarchical structure of the information recognition model and the viewpoint recognition model in viewpoint recognition, the problem of insufficient recognition task correlation in the existing technology is solved, and the accuracy and efficiency of viewpoint recognition in uttered text are improved.

CN118538210APending Publication Date: 2024-08-23BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310189208.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When the existing technology performs viewpoint recognition on uttered text through pipeline methods, it fails to consider the correlation between multiple recognition tasks, resulting in reduced viewpoint recognition accuracy, low reasoning efficiency, high computational cost, and poor adaptability.

Method used

By obtaining the current text data, using the coding model for coding, combining the information recognition model and the opinion recognition model, establishing a hierarchical structure, making full use of the feature information of the text data, considering the correlation between different recognition tasks, and improving the generalization ability and accuracy.

Benefits of technology

It improves the accuracy of viewpoint recognition in uttered text, reduces the computational cost of the model, improves the overall reasoning efficiency, and enhances the adaptability to new types of corpus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538210A
    Figure CN118538210A
Patent Text Reader

Abstract

The invention provides a viewpoint recognition method, device and equipment and a computer readable storage medium. The method comprises the following steps: acquiring current text data; the current text data is text data corresponding to current audio data related to a service in an application scene; encoding the current text data by using the first encoding model to obtain a first encoding vector; performing information identification on the first coding vector by using at least one information identification model to obtain at least one information identification vector; the information identification vector represents information related to the viewpoint of the current text data; and obtaining a viewpoint identification vector based on the first coding vector and the at least one information identification vector by using a viewpoint identification model, thereby determining viewpoint information corresponding to the current text data. According to the embodiment of the invention, the correlation among a plurality of recognition tasks can be realized, so that the viewpoint recognition accuracy of the text data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and relates to but is not limited to opinion identification methods, devices, equipment and computer-readable storage media. Background Art

[0002] As an important type of data, user voice text contains a large amount of user opinion information. Identifying and analyzing user voice text can obtain users' concerns about certain services.

[0003] In the prior art, the user's spoken text is often recognized and analyzed through a pipeline method to obtain the opinion information of the spoken text. However, when the opinion information of the spoken text is recognized through a pipeline method, the accuracy of opinion recognition of the spoken text is reduced due to the lack of consideration of the correlation between multiple recognition tasks. Summary of the invention

[0004] The opinion recognition method, apparatus, device and computer-readable storage medium provided in the embodiments of the present application can achieve the correlation between multiple recognition tasks, thereby improving the accuracy of opinion recognition for spoken text.

[0005] The technical solution of this application is implemented as follows:

[0006] The present application provides a method for identifying a viewpoint, the method comprising:

[0007] Acquire current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario;

[0008] Encoding the current text data using a first encoding model to obtain a first encoding vector;

[0009] Using at least one information recognition model, performing information recognition on the first encoding vector to obtain at least one information recognition vector; the information recognition vector represents information related to the viewpoint of the current text data;

[0010] By using a viewpoint recognition model, based on the first encoding vector and the at least one information recognition vector, a viewpoint recognition vector is obtained, thereby determining the viewpoint information corresponding to the current text data.

[0011] The present application provides a viewpoint recognition device, the device comprising:

[0012] An acquisition module, used to acquire current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario;

[0013] An encoding module, used for encoding the current text data using a first encoding model to obtain a first encoding vector;

[0014] an identification module, configured to perform information identification on the first encoding vector using at least one information identification model to obtain at least one information identification vector; the information identification vector represents information related to the viewpoint of the current text data;

[0015] The recognition module is further used to obtain a viewpoint recognition vector using a viewpoint recognition model based on the first encoding vector and the at least one information recognition vector, thereby determining the viewpoint information corresponding to the current text data.

[0016] An embodiment of the present application provides an electronic device, including:

[0017] A memory for storing executable instructions;

[0018] The processor is used to implement the above-mentioned viewpoint identification method when executing the executable instructions stored in the memory.

[0019] An embodiment of the present application provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the above-mentioned viewpoint identification method is implemented.

[0020] The embodiments of the present application provide a method, apparatus, device and readable storage medium for identifying a point of view, characterized in that the method comprises: first, obtaining current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario; then, using a first coding model, encoding the current text data to obtain a first coding vector; subsequently, using at least one information recognition model, performing information recognition on the first coding vector to obtain at least one information recognition vector; the information recognition vector represents information related to the point of view of the current text data; finally, using the point of view recognition model, based on the first coding vector and at least one information recognition vector, obtaining a point of view recognition vector, thereby determining the point of view information corresponding to the current text data.

[0021] On the one hand, since the electronic device passes the first coding vector through at least one information recognition model to obtain at least one information recognition vector, and passes the first coding vector and at least one information recognition vector through the opinion recognition network model at the same time to perform opinion recognition and thus obtain the opinion recognition vector, a hierarchical structure between the information recognition network model and the opinion recognition network model is realized, which can solve multiple recognition tasks at the same time and make full use of the characteristic information of the text data, so as to consider the correlation between different recognition tasks.

[0022] On the other hand, the information recognition vector represents information related to the opinion of the current text data. In this way, different types of information recognition of text data can be realized, thereby improving the generalization ability of the overall model without affecting the reasoning efficiency, thereby improving the accuracy of opinion recognition of text data.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0026] Figure 1 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 1 ;

[0027] Figure 2 A schematic diagram of the structure of an optional expert mixture network model proposed in an embodiment of the present application;

[0028] Figure 3 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 2 ;

[0029] Figure 4 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 3 ;

[0030] Figure 5 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 4 ;

[0031] Figure 6 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 5 ;

[0032] Figure 7A schematic diagram of the structure of an optional multi-layer recognition model provided in an embodiment of the present application;

[0033] Figure 8 A schematic diagram of an optional viewpoint identification method provided in an embodiment of the present application Figure 6 ;

[0034] Fig. 9 A schematic diagram of the structure of an optional viewpoint identification device provided in an embodiment of the present application;

[0035] Fig.10 A schematic diagram of the structure of an optional electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.

[0037] 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.

[0038] In the following description, reference is made to “some embodiments”, “this embodiment”, “embodiments of the present application” and examples, etc., which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0039] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0040] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are described first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0041] Fully Connected Layers (FC);

[0042] Pretrained Language Model (PLM);

[0043] Mixture-Of-Experts (MOE) network model;

[0044] Automatic Speech Recognition (ASR) technology.

[0045] As an important type of data, user voice text contains a large amount of user opinion information. Identifying and analyzing user voice text can obtain users' concerns about certain services.

[0046] At present, opinion information recognition through spoken text is applied in various fields, such as e-commerce. Automatic recognition and analysis of user opinion information through spoken text can help relevant personnel pay attention to user concerns. Based on user opinion information, certain operation strategies can help platforms or merchants improve product operations, services and products. Therefore, how to mine user opinion information in user spoken text through algorithms is a challenging problem.

[0047] In the prior art, the user's spoken text is often identified and analyzed through a pipeline method, and the opinion information of the spoken text is obtained by combining the search of the opinion library. However, when the opinion information of the spoken text is identified through the pipeline method, there are the following problems:

[0048] 1. Each model is relatively independent, which requires the maintenance of multiple models separately, resulting in low reasoning efficiency and high model calculation cost.

[0049] 2. The training iteration process between each model is independent, and there is a lack of consideration of the correlation between each model, which leads to insufficient utilization of data between each model, and thus affects the accuracy of opinion recognition in spoken text.

[0050] 3. Each model has low adaptability to new types of corpus (voiced text), which results in poor recognition ability of each model for the generated text, thereby reducing the accuracy of the model in identifying opinions in the voiced text.

[0051] An embodiment of the present application provides a method for identifying a point of view, the basic idea of ​​which is: first, the electronic device obtains current text data; then, the electronic device uses a first coding model to encode the current text data to obtain a first coding vector; subsequently, the electronic device uses at least one information identification model to perform information identification on the first coding vector to obtain at least one information identification vector; finally, the electronic device uses a viewpoint identification model to obtain a viewpoint identification vector based on the first coding vector and at least one information identification vector, thereby determining the viewpoint information corresponding to the current text data.

[0052] Since the electronic device passes the first coding vector through at least one information recognition model to obtain at least one information recognition vector, and passes the first coding vector and at least one information recognition vector through the viewpoint recognition network model at the same time to perform viewpoint recognition, thereby obtaining the viewpoint recognition vector, a hierarchical structure between the information recognition network model and the viewpoint recognition network model is realized, so that the correlation between different recognition tasks can be considered. Therefore, different types of information recognition of text data are realized, thereby improving the generalization ability of the overall model without affecting the reasoning efficiency, thereby improving the accuracy of viewpoint recognition of text data.

[0053] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0054] Figure 1 A flowchart of an optional viewpoint identification method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, including S110 to S130:

[0055] S110, obtaining current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario.

[0056] In an embodiment of the present application, the electronic device obtains current text data, wherein the current text data is text data corresponding to current audio data related to the business in the application scenario.

[0057] In the embodiment of the present application, the electronic device may be a terminal device. The terminal devices involved in the embodiment of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user terminal devices (terminal device) or mobile stations (Mobile Station, MS), etc.

[0058] In an embodiment of the present application, the current text data is text data corresponding to the current audio data related to the business in the application scenario, wherein the application scenario includes but is not limited to audio content detection, medical treatment, telecommunications, identity recognition and other aspects. The present application does not impose any limitation on the application scenario.

[0059] For example, the current text data is the text data corresponding to the user's voice text (audio data) in the e-commerce field. By identifying and analyzing the user's voice text, the user's focus on products, services or operations can be obtained. Based on the analysis results of the user's text, relevant personnel can help e-commerce operation platforms or merchants improve commodity operations, service quality, product quality, etc. through certain operation strategies.

[0060] It can be understood that the current text data is text data obtained by performing text recognition on the user's spoken text. For example, after converting the user's audio data, the text data "the display of this mobile phone screen is not clear" is obtained.

[0061] In an embodiment of the present application, the electronic device performs speech recognition on current audio data related to the business through an audio conversion method to obtain current text data.

[0062] In the embodiment of the present application, the process of converting audio data into text data involves automatic speech recognition technology (Automatic Speech Recognition, ASR), whose goal is to convert the vocabulary content in the user's audio data into text data. Commonly used audio recognition technologies include methods based on linguistics and acoustics, random model methods, methods using artificial neural networks, probabilistic grammar analysis, etc. This application does not make any restrictions on the audio conversion method, and it can be selected according to the actual application scenario.

[0063] S120. Encode the current text data using a first encoding model to obtain a first encoding vector.

[0064] In an embodiment of the present application, after the electronic device obtains the current text data, it encodes the current text data using a first encoding model to obtain a first encoding vector.

[0065] In an embodiment of the present application, the first encoding model is used to encode the semantic information of the current text data to obtain a first encoding vector for subsequent tasks.

[0066] In an embodiment of the present application, the first encoding model first preprocesses the current text data. Usually, in the preprocessing stage, the first encoding model adds an identifier to the starting position of the current text data, and the identifier is used to represent the semantic information of the current text data.

[0067] In one embodiment, the identifier can be <cls> , <cls>Represents classification, which can be understood as a classification task used in downstream. <cls>It is essentially a semantic feature vector that represents the entire text. In other words, <cls>The output is used to aggregate the semantic information of the current text data for subsequent tasks (such as classification tasks).

[0068] It can be understood that the first encoding model encodes the current text data input, and the output vector includes the current text data with <cls>The vector of the identifier and the encoding vector corresponding to each character in the current text data. <cls>The vector of the identifier is usually used as the semantic representation vector of the full text (current text data) and is preferentially used for simple classification, such as sentiment classification.

[0069] For example, the identifier is <cls>In the preprocessing stage, the first encoding model preprocesses the current input text "This mobile phone screen display is not clear" to obtain the vector " <cls>The display on this mobile phone screen is not very clear”, which is used to represent the semantic information of the current text data.

[0070] In an embodiment of the present application, after preprocessing the current text data, the first encoding model encodes the semantic information of the preprocessed output vector to obtain a first encoding vector.

[0071] In one of the embodiments, the first encoding model includes a semantic recognition model and a hidden layer.

[0072] In an embodiment of the present application, the first encoding model includes a semantic recognition model, which may be a deep semantic matching model (Deep Structured Semantic Models, DSSM), a deep recursive convolutional network (Deeply-Recursive Convolutional Network,), a pretrained language model (Pretrained Language Model, PLM), etc. The present application does not impose any limitation on the semantic recognition model, and the specific selection may be based on the actual application scenario.

[0073] In one of the embodiments, the semantic recognition model uses a pre-trained language model PLM, which is a language model pre-trained in a self-supervised manner on a large-scale corpus.

[0074] It can be understood that the first encoding model uses the encoder of the pre-trained language model PLM as the semantic recognition model. PLM is obtained through self-supervised learning of a large amount of corpus. It can capture the three-dimensional useful information contained in the corpus. By fine-tuning or training downstream tasks based on the PLM model, better reasoning effects can be obtained.

[0075] In an embodiment of the present application, in order to address the problem that the semantic recognition performance of an open source semantic recognition model in a specific field is reduced, the electronic device encodes the semantic information of an output vector of a preprocessing stage through a semantic recognition model of a first encoding model to obtain a first encoding vector. The electronic device pre-trains an initial semantic recognition model to determine the semantic recognition model.

[0076] For example, since the generalization performance of open source PLM models often decreases in specific fields, in order to better identify the viewpoint information of the text data corresponding to the user's voice text, the embodiment of the present application will perform secondary pre-training based on the open source PLM model. Specifically, the embodiment of the present application designs a complete data flow to incrementally collect the text of user voices (including evaluation questions and answers) and persist them.

[0077] It can be understood that the data flow mentioned here includes: in order to ensure that the latest corpus can be updated into the semantic recognition model, by collecting multiple data sources, data from different channels are buried, and then the data is parsed into an offline data table for structured storage.

[0078] It should be noted that the offline data table here can be a Hive (data warehouse tool) table, an Excel table, or other forms of databases. The present application embodiment does not make any limitation on this, and the specific selection can be made according to the actual application scenario. In other words, by storing text data obtained from different channels in the offline data table, the persistence of text data can be achieved.

[0079] In one embodiment, when the semantic recognition model is a pre-trained language model PLM, the process of performing secondary pre-training on the initial PLM model may be as follows: first, the electronic device obtains text data within a preset time period. For example, since the amount of mobile phone data is about 30 million per day, historical data for the past two years (on the order of 10 billion) may be obtained to perform a complete PLM model training; then, the electronic device inputs the text data into the initial PLM model, performs semantic recognition on the first text sample data, and obtains the semantic results corresponding to the text data; finally, the electronic device corrects the model parameters in the initial PLM model based on the semantic results corresponding to the text data, thereby obtaining the PLM model after secondary pre-training.

[0080] It should be noted that the embodiment of the present application performs secondary pre-training on the open source PLM. The PLM is trained using an autoregressive method (using the previous context of a sentence to predict the following context). Therefore, there is no need to use labeled data for classification. Instead, it is only necessary to collect a large amount of text data, such as the Visual Object Classes (VOC) dataset.

[0081] In an embodiment of the present application, by pre-training the initial semantic recognition model in the first encoding model, the semantic recognition model is determined, which improves the recognition accuracy of the first encoding model for new types of corpus, thereby improving the accuracy of the overall model in identifying opinions in text data.

[0082] S130. Perform information recognition on the first coding vector using at least one information recognition model to obtain at least one information recognition vector; the information recognition vector represents information related to the viewpoint of the current text data.

[0083] In an embodiment of the present application, the electronic device uses a first coding model to encode current text data to obtain a first coding vector, and then uses at least one information recognition model to perform information recognition on the first coding vector to obtain at least one information recognition vector.

[0084] In an embodiment of the present application, the information identification model is used to perform information identification on the first coding vector to obtain an information identification vector related to the viewpoint information of the current text data.

[0085] In the embodiment of the present application, the information related to the viewpoint of the current text data may be the sentiment information, attribute information, etc. represented by the current text data. Among them, the sentiment information represents the sentiment or emotion expressed by the text data, for example, the sentiment information may be "positive", "negative" and "neutral"; the attribute information represents the attribute category of the commodity expressed by the text data, for example, the attribute information for a mobile phone may be "screen", "battery life", "photo effect", "appearance", etc.

[0086] For example, if the current text data is "the screen display of this mobile phone is not very clear", the emotional information represented by the current text data may be "negative", and the attribute information represented by the current text data may be "screen".

[0087] In an embodiment of the present application, the information recognition model performs information recognition on the first coding vector to obtain an information recognition vector related to the emotional information of the current text data. At this time, the information recognition model can judge the emotional information expressed by the current text data based on the first coding vector. At the same time, the information recognition vector is a probability vector that represents the probability value of each preset emotional information. For example, if the preset emotional information is "positive", "negative" and "neutral", the dimension of the information recognition vector is 3, indicating the probability of each preset emotional information. The preset emotional information corresponding to the largest probability value in the information recognition vector is used as the emotional information corresponding to the current text data.

[0088] In the embodiment of the present application, the information recognition model performs information recognition on the first coding vector to obtain an information recognition vector related to the attribute information of the current text data. At this time, the information recognition model can judge the attribute information of the commodity expressed by the current text data based on the first coding vector. At the same time, the information recognition vector is a probability vector, which represents the probability value of each preset attribute information. For example, if there are 100 preset attribute information, the dimension of the information recognition vector is 100, which represents the probability of each preset attribute information. The preset attribute information corresponding to the largest probability value in the information recognition vector is used as the attribute information corresponding to the current text data.

[0089] S140. Utilizing a viewpoint recognition model, based on the first coding vector and at least one information recognition vector, obtain a viewpoint recognition vector, thereby determining viewpoint information corresponding to the current text data.

[0090] In an embodiment of the present application, the electronic device uses at least one information recognition model to perform information recognition on the first coding vector. After obtaining at least one information recognition vector, the electronic device uses an opinion recognition model to obtain an opinion recognition vector based on the first coding vector and at least one information recognition vector, thereby determining the opinion information corresponding to the current text data.

[0091] In the embodiment of the present application, the opinion recognition model is used to simultaneously perform opinion recognition on the first encoding vector and at least one information recognition vector to obtain opinion information related to the current text data. It can be understood that the opinion recognition model can determine the opinion information expressed by the current text data based on the first encoding vector and at least one information recognition vector, thereby obtaining the opinion recognition vector.

[0092] In the embodiment of the present application, the opinion recognition vector is a probability vector, which represents the probability value of each preset opinion text. For example, if there are 1000 preset opinion texts, the dimension of the opinion recognition vector is 1000, which represents the probability of each preset opinion text. The preset opinion text corresponding to the largest probability value in the opinion recognition vector is used as the opinion information corresponding to the current text data.

[0093] It should be noted that the preset opinion text represents a short sentence with complete semantics and conciseness, such as "the screen resolution is high" or "the battery life of the mobile phone is poor".

[0094] In an embodiment of the present application, a method for identifying a point of view is provided. First, the electronic device obtains current text data; then, the electronic device encodes the current text data using a first coding model to obtain a first coding vector; subsequently, the electronic device uses at least one information identification model to perform information identification on the first coding vector to obtain at least one information identification vector; finally, the electronic device uses the point of view identification model to obtain a point of view identification vector based on the first coding vector and at least one information identification vector, thereby determining the point of view information corresponding to the current text data.

[0095] On the one hand, since the electronic device passes the first coding vector through at least one information recognition model to obtain at least one information recognition vector, and passes the first coding vector and at least one information recognition vector through the opinion recognition network model at the same time to perform opinion recognition and thus obtain the opinion recognition vector, a hierarchical structure between the information recognition network model and the opinion recognition network model is realized, which can solve multiple recognition tasks at the same time and make full use of the characteristic information of the text data, so as to consider the correlation between different recognition tasks.

[0096] On the other hand, the information recognition vector represents information related to the opinion of the current text data. In this way, different types of information recognition of text data can be realized, thereby improving the generalization ability of the overall model without affecting the reasoning efficiency, thereby improving the accuracy of opinion recognition of text data.

[0097] On the other hand, by realizing the hierarchical structure between the information recognition network model and the opinion recognition network model, each recognition model is not independent, and multiple recognition models can be maintained at the same time, thereby reducing the computational cost of the model and improving the overall reasoning efficiency of the model.

[0098] In some embodiments of the present application, the information recognition model includes at least one of the following: an emotion recognition model and an attribute recognition model; the information recognition vector includes at least one of the following: an emotion recognition vector and an attribute recognition vector; S130 includes S210 to S220:

[0099] S210. Using the emotion recognition model, the emotion information of the first coding vector is identified to obtain an emotion recognition vector.

[0100] In an embodiment of the present application, the electronic device uses a first coding model to encode current text data to obtain a first coding vector, and then uses an emotion recognition model to identify emotion information of the first coding vector to obtain an emotion recognition vector.

[0101] In an embodiment of the present application, the emotion recognition model is used to identify the emotion information of the first coding vector to obtain an emotion recognition vector.

[0102] As an optional implementation, the emotion recognition model includes a fully connected layer (Fully Connected Layers, FC) and a classification layer (Softmax). The emotion recognition model may also include a feedforward neural network (Feedforward Neural Network, FNN).

[0103] It can be understood that considering that the task of emotion information recognition is relatively simple, the embodiment of the present application outputs the first coding model with <cls>The first encoding vector of the identifier passes through the fully connected layer and the classification layer in the emotion recognition model in turn, and outputs the emotion probability distribution Ps (emotion recognition vector).

[0104] In the embodiment of the present application, the emotion recognition vector represents the emotion or mood expressed by the text data. For example, the emotion information can be "positive", "negative" and "neutral". For example, if the current text data is "the screen display of this mobile phone is not clear", the emotion information represented by the current text data can be "negative".

[0105] In the embodiment of the present application, the emotion recognition vector is a probability vector, which represents the probability value of each preset emotion information. For example, if the preset emotion information is "positive", "negative" and "neutral", the dimension of the emotion recognition vector is 3, which represents the probability of each preset emotion information. The preset emotion information corresponding to the largest probability value in the emotion recognition vector is used as the emotion information corresponding to the current text data.

[0106] Exemplarily, the emotion recognition vector Ps(0.1, 0.1, 0.8) is a one-dimensional vector, which respectively represents the probability that the emotion information of the current text data belongs to "positive", "neutral" and "negative", and the emotion information of the final text data belongs to the category with the largest probability value.

[0107] S220: Use the attribute recognition model to recognize the attribute information of the first coding vector to obtain an attribute recognition vector.

[0108] In an embodiment of the present application, the electronic device encodes the current text data using a first coding model to obtain a first coding vector, and then uses an attribute recognition model to recognize attribute information of the first coding vector to obtain an attribute recognition vector.

[0109] In the embodiment of the present application, the attribute recognition vector represents the attribute category of the commodity expressed by the text data. For example, the attribute information for a mobile phone may be "screen", "battery life", "photo quality", "appearance", etc. For example, if the current text data is "the screen display of this mobile phone is not clear", the attribute information represented by the current text data may be "screen".

[0110] In the embodiment of the present application, the attribute recognition vector is a probability vector, which represents the probability value of each preset attribute information. For example, if there are 100 preset attribute information, the dimension of the attribute recognition vector is 100, which represents the probability of each preset attribute information. The preset attribute information corresponding to the largest probability value in the attribute recognition vector is used as the attribute information corresponding to the current text data.

[0111] In the embodiment of the present application, the attribute recognition model is used to recognize the attribute information of the first coding vector to obtain an attribute recognition vector.

[0112] As an optional implementation, the attribute recognition model adopts a Mixture-Of-Experts (MOE) network model. The Mixture-Of-Experts (MOE) network model is a general model framework. Through the structural design of gate networks and expert networks, it can ensure that the system capacity of the model is improved while the reasoning efficiency is not significantly reduced.

[0113] refer to Figure 2 , Figure 2 FIG. 4 shows a schematic diagram of the structure of an optional expert hybrid network model proposed in an embodiment of the present application, such as Figure 2 As shown, the expert mixture network model MOE includes a gate network (Gate) model ( Figure 2 The gate network is shown in Figure 2) and the expert network model ( Figure 2 , expert network 1, expert network 2, expert network 3, ..., expert network n-1, expert network n are shown in the figure). The expert mixture network model MOE includes multiple expert networks (expert network models) and a corresponding gate network (gate network model), and each expert network is used to learn different types of semantic information.

[0114] refer to Figure 2 , the input vector x first passes through the gate network of the expert mixture network model MOE, and the output of the gate network ( Figure 2 In G(x)2 and G(x) n-1 ) is a weight value (probability value), and the output result of the gate network represents the weight value of the corresponding expert network. For example, G(x)2 represents the weight value of the second expert network, G(x) n-1 Indicates the weight value of the n-1th expert network. The gate network is used to screen which expert network results are used for output. The gate network enables MOE to reduce the amount of model calculation during the inference process, that is, MOE selects the corresponding expert network according to the weight value of the gate network.

[0115] refer to Figure 2 In the embodiment of the present application, the output of the gate network is 0 or 1, and the corresponding expert network ( Figure 2 In the expert network 2 and the expert network n-1), semantic recognition of the first encoding vector is performed, and the output vectors of the expert network 2 and the expert network n-1 are weighted summed with the weight values ​​of the corresponding gate networks to obtain the final output vector.

[0116] In some embodiments of the present application, Figure 3 As shown, S220 includes S221 to S224:

[0117] S221. Pass the first encoding vector through the first gate network of the first expert mixture network model to obtain a first number of first weights; the first number is consistent with the number of the first expert network model in the first expert mixture network model.

[0118] In an embodiment of the present application, the electronic device passes the first coding vector through a first gate network of a first expert mixture network model to obtain a first number of first weights.

[0119] In the embodiment of the present application, the first gate network is used to calculate the weight values ​​of the first number of first expert network models in the first expert mixture network model. That is, the number of first weights output by the first gate network is consistent with the number of first expert network models.

[0120] In the embodiment of the present application, the input of the first gate network is the encoding structure of the current text data of the first encoding model, that is, the first encoding vector. The first weight output by the first gate network is a probability value. Considering the convenience of model calculation, the first weight is rounded up or down so that the value of the first weight is 0 or 1. The first gate network can be represented by formula (1):

[0121]

[0122] Among them, h j Represents the character encoding vector of the jth character (with Token identifier) ​​in the current text data, β ij is a weight value, indicating that the i-th first gate network model is in the j-th character encoding vector h j The summed weight value, G i Represents the output weight of the i-th gate network model. Softmax(·) represents the normalized exponential function. The purpose of softmax(·) is to ensure that the first weight output by the first gate network model is between 0 and 1. Indicates that the value in the brackets is rounded down to an integer. For example, if the value in the brackets is 0.8, 0.8 is rounded down to 0. If the value in the brackets is 1.2, 1.2 is rounded down to 1. It should be noted that in order to To ensure that the values ​​in the brackets that are greater than 0.5 can be equal to 1, 0.5 needs to be added after softmax(·). ij It is part of the first expert mixture network model and needs to be trained to be determined.

[0123] S222: Determine at least one first target expert network model from the first number of first expert network models according to the first number of first weights.

[0124] In an embodiment of the present application, after the electronic device passes the first coding vector through the first gate network of the first expert mixture network model to obtain a first number of first weights, at least one first target expert network model is determined in the first number of first expert network models based on the first number of first weights.

[0125] In an embodiment of the present application, the first gate network model is used to screen the first expert network models in the first expert hybrid network model, and determine a certain number of first target expert network models therefrom, thereby reducing the amount of calculation in the model reasoning process and thereby improving the efficiency of model reasoning.

[0126] Exemplarily, the electronic device determines that the expert network corresponding to the output result of the first gate network model being 1 performs semantic recognition on the first coding vector.

[0127] S223. Use at least one first target expert network model to identify attribute information of the first encoding vector to obtain at least one first intermediate vector corresponding to the at least one first target expert network model.

[0128] In an embodiment of the present application, after the electronic device determines at least one first target expert network model from the first number of first expert network models based on the first weight of the first number, it uses the at least one first target expert network model to identify the attribute information of the first encoded vector to obtain at least one first intermediate vector corresponding to the at least one first target expert network model.

[0129] In an embodiment of the present application, the first target expert network model is used to identify attribute information of the first encoding vector, thereby obtaining at least one first intermediate vector.

[0130] In the embodiment of the present application, the input of the first target expert network model is the encoding result of the first encoding model on the current text data, that is, the first encoding vector. The input of the first target expert network model is the first intermediate vector obtained after identifying the attribute information of the first encoding vector. The first expert network can be represented by formula (2):

[0131] E i =∑ j α ij h j (2)

[0132] Among them, h j Represents the character encoding vector of the jth character (with Token identifier) ​​in the current text data; α ij is a weight value, indicating that the i-th expert network model is in the j-th character encoding vector h j The summed weight value, E i represents the output vector of the i-th expert network model. It should be noted that α ij is part of the first expert mixture network model and needs to be trained to determine,

[0133] S224. Perform a weighted summation on at least one first intermediate vector and a corresponding first weight to obtain an attribute identification vector.

[0134] In an embodiment of the present application, the electronic device uses at least one first target expert network model to identify the attribute information of the first coding vector, obtains at least one first intermediate vector corresponding to the at least one first target expert network model, and then performs weighted summation on the at least one first intermediate vector and the corresponding first weight to obtain an attribute recognition vector.

[0135] In the embodiment of the present application, the first intermediate vectors output by each first target expert network model are weighted and summed with the corresponding first weights to obtain the final attribute recognition vector Pa representing different attribute information of the text data. The attribute recognition vector can be expressed by formula (2):

[0136] Pa = softmax(FFN(∑ i G i ·E i )) (3)

[0137] Among them, Pa represents the attribute recognition vector, G i represents the output weight (first weight) of the i-th gate network model, E i represents the output vector of the i-th expert network model (the first intermediate vector), FFN(·) represents the fully connected layer, and softmax(·) represents the normalized exponential function (Softmax layer).

[0138] In some embodiments of the present application, Figure 4 As shown, S140 includes S141 to S144:

[0139] S141. Fuse the first coding vector and at least one information identification vector to obtain a second intermediate vector.

[0140] In an embodiment of the present application, the electronic device fuses the first encoding vector and at least one information identification vector to obtain a second intermediate vector.

[0141] In an embodiment of the present application, the method of fusing the first coding vector and at least one information identification vector includes but is not limited to: a vector concatenation method and a point-wise addition method. The embodiment of the present application does not impose any limitation on the vector fusion method, and the specific method can be selected according to the actual application scenario.

[0142] S142. Perform information recognition on the second intermediate vector through the second expert mixture network model of the opinion recognition model to obtain a third intermediate vector.

[0143] In an embodiment of the present application, the electronic device fuses the first coding vector and at least one information identification vector to obtain a second intermediate vector, and then performs information identification on the second intermediate vector through a second expert mixture network model of the opinion recognition model to obtain a third intermediate vector.

[0144] In the embodiment of the present application, the opinion recognition model includes a second expert mixture network model MOE. The structure of the second expert mixture network model is consistent with that of the first expert mixture network model. The structure of the second expert mixture network model can be referred to as follows: Figure 2 Schematic diagram of the structure of the expert mixture network model shown.

[0145] In some embodiments of the present application, S142 includes S310 to S340:

[0146] S310, passing the second intermediate vector through the second gate network of the second expert mixture network model to obtain a third number of second weights; the third number is consistent with the number of the second expert network model in the second expert mixture network model.

[0147] In the embodiment of the present application, the electronic device passes the second intermediate vector through the second gate network of the second expert mixture network model to obtain a third number of second weights.

[0148] In the embodiment of the present application, the second gate network is used to calculate the weight values ​​of the third number of second expert network models in the second expert mixture network model. That is, the number of first weights output by the second gate network is consistent with the number of second expert network models.

[0149] In the embodiment of the present application, the input of the second gate network is a second intermediate vector obtained by fusing the first encoding vector and at least one information identification vector. The second weight output by the second gate network is a probability value. Considering the convenience of model calculation, the second weight is rounded up or down so that the value of the second weight is 0 or 1. The second gate network can be represented by referring to formula (1).

[0150] S320: Determine at least one second target expert network model from the third number of second expert network models according to the third number of second weights.

[0151] In an embodiment of the present application, after the electronic device passes the second intermediate vector through the second gate network of the second expert mixture network model to obtain a third number of second weights, it determines at least one second target expert network model in the third number of second expert network models based on the third number of second weights.

[0152] In the embodiment of the present application, the second gate network model is used to screen each second expert network model in the second expert mixture network model to determine a certain number of second target expert network models.

[0153] Exemplarily, the electronic device determines that the second expert network model corresponding to the output result of the second gate network model being 1 performs semantic recognition on the second intermediate vector.

[0154] In the embodiment of the present application, a Dropout mechanism based on the expert mixture network model MOE is proposed. This is because in the opinion recognition model, there are many preset opinion categories, which may be hundreds or thousands, so a large number of expert network models are required. However, with the increase of expert network models, the model may have overfitting problems. Therefore, through the Dropout mechanism based on the expert mixture network model MOE, the problem of overfitting of the model can be avoided, thereby improving the recognition performance of the model, thereby improving the accuracy of opinion recognition for text data.

[0155] In some embodiments of the present application, S320 includes S321 to S322:

[0156] S321. Determine a fourth number of second expert network models in working state from the third number of second expert network models; the fourth number is less than or equal to the third number.

[0157] In the embodiment of the present application, the electronic device determines a fourth number of second expert network models in working state from the third number of second expert network models.

[0158] In the embodiment of the present application, among the third number of second expert network models in the second expert hybrid network model, some of the second expert network models are in a working state, and some of the second expert network models are in a failed state.

[0159] It should be noted that the fourth number is less than or equal to the third number, that is, among the third number of second expert network models, all or part of the second expert network models are in working state.

[0160] It can be understood that when the second expert network model is in a working state, it means that the second expert network model can identify the opinion information of the second intermediate vector; when the second expert network model is in an invalid state, it means that the second expert network model cannot identify the opinion information of the second intermediate vector.

[0161] S322: Determine at least one second target expert network model in a working state according to the second weights corresponding to the fourth number of second expert network models.

[0162] In an embodiment of the present application, after the electronic device determines a fourth number of second expert network models in a working state among the third number of second expert network models, it determines at least one second target expert network model in a working state according to the second weights corresponding to the fourth number of second expert network models.

[0163] In an embodiment of the present application, the second target expert network model is used to identify the viewpoint information of the second intermediate coding vector, and thus obtain at least one fourth intermediate vector.

[0164] In some embodiments of the present application, after S310, S310 further includes S401 to S402:

[0165] S401. According to the first preset parameter, set a fourth number of second expert network models in the second expert hybrid network model to a working state.

[0166] In the embodiment of the present application, the electronic device sets the fourth number of second expert network models in the second expert hybrid network model to a working state according to the first preset parameter.

[0167] In the embodiment of the present application, the first preset parameter is a pre-set value, which is a random number between 0 and 1. For example, the first preset parameter is 0.7.

[0168] S402: according to the second preset parameter, set the fifth number of second expert network models in the second expert hybrid network model to an invalid state; the sum of the fourth number and the fifth number is less than or equal to the third number.

[0169] In the embodiment of the present application, the electronic device sets the fifth number of second expert network models in the second expert hybrid network model to an invalid state according to the second preset parameter.

[0170] In the embodiment of the present application, the second preset parameter is a pre-set value, which is a random number between 0 and 1. For example, the second preset parameter is 0.3.

[0171] It can be understood that the sum of the fourth number and the fifth number is less than or equal to the third number. In other words, the sum of the fourth number and the fifth number cannot exceed the third number.

[0172] In the embodiment of the present application, when the second expert mixture network model is calculating, a part of the second expert network model is invalidated (Dropout), that is, the output of the invalidated second expert network model does not contribute to the next layer of calculation. This process can be expressed by formula (4):

[0173] ∑ i 'G i ·rE i (4)

[0174] Among them, G i represents the output weight (second weight) of the i-th second gate network model, E i represents the output vector (fourth intermediate vector) of the i-th second expert network model, the operator ' indicates that the second expert network model in the failure state (Dropout) is not summed, r represents a hyperparameter, and represents the probability of failure (Dropout) of the second expert network model, for example, r = 0.3.

[0175] In an embodiment of the present application, the Dropout mechanism based on the expert mixture network model MOE can avoid the problem of overfitting of the model, thereby improving the recognition performance of the model and thus improving the accuracy of opinion recognition for text data.

[0176] S330. Identify the viewpoint information of the second intermediate vector through at least one second target expert network model to obtain at least one fourth intermediate vector corresponding to the at least one second target expert network model.

[0177] In an embodiment of the present application, after the electronic device determines at least one second target expert network model among the third number of second expert network models based on the third number of second weights, it identifies the viewpoint information of the second intermediate vector through the at least one second target expert network model to obtain at least one fourth intermediate vector corresponding to the at least one second target expert network model.

[0178] In an embodiment of the present application, the input of the second target expert network model is a second intermediate vector obtained by fusing the first encoding vector and at least one information identification vector, and the output of the second target expert network model is a fourth intermediate vector obtained after identifying the opinion information of the second intermediate vector. The second expert network can be represented by referring to formula (2).

[0179] S340. Perform a weighted summation on at least one fourth intermediate vector and the corresponding second weight to obtain a third intermediate vector.

[0180] In an embodiment of the present application, the electronic device identifies the viewpoint information of the second intermediate vector through at least one second target expert network model, obtains at least one fourth intermediate vector corresponding to the at least one second target expert network model, and then weighted sums the at least one fourth intermediate vector with the corresponding second weight to obtain a third intermediate vector.

[0181] In an embodiment of the present application, the fourth intermediate vectors output by each second target expert network model are weighted and summed with the corresponding second weights to obtain a final opinion recognition vector Vt representing different opinion information of the text data. The opinion recognition vector can be represented by referring to formula (3).

[0182] S143. Encode a second number of preset opinion texts through a second encoding model of the opinion recognition model to obtain a second number of second encoding vectors.

[0183] In an embodiment of the present application, the electronic device performs information recognition on the second intermediate vector through the second expert mixture network model of the opinion recognition model, and after obtaining the third intermediate vector, encodes the second number of preset opinion texts through the second encoding model of the opinion recognition model to obtain a second number of second encoding vectors.

[0184] In an embodiment of the present application, the second encoding model is used to encode the semantic information of the preset opinion text to obtain a corresponding second encoding vector for subsequent tasks.

[0185] In the embodiment of the present application, the preset opinion text is an opinion text set in advance.

[0186] In an embodiment of the present application, the second encoding model encodes each preset opinion text to obtain a second encoding vector corresponding to each preset opinion text.

[0187] In an embodiment of the present application, the second encoding model first preprocesses the preset opinion text. Usually, in the preprocessing stage, the first encoding model adds an identifier to the starting position of the preset opinion text, and the identifier is used to represent the semantic information of the preset opinion text.

[0188] In one embodiment, the identifier may be <cls> , <cls>It stands for classification, which can be understood as a classification task used in downstream.

[0189] In an embodiment of the present application, after preprocessing the preset opinion text, the second encoding model encodes the semantic information of the preprocessed output vector to obtain a second encoding vector.

[0190] In one of the embodiments, the second encoding model includes a semantic recognition model and a fully connected layer.

[0191] In an embodiment of the present application, the second encoding model includes a semantic recognition model, which may be a deep semantic matching model (Deep Structured Semantic Models, DSSM), a deep recursive convolutional network (Deeply-Recursive Convolutional Network,), a pretrained language model (Pretrained Language Model, PLM), and the like.

[0192] In one of the embodiments, the semantic recognition model in the second encoding model adopts a pre-trained language model PLM.

[0193] S144. Determine a viewpoint recognition vector by calculating semantic similarity between the third intermediate vector and each second encoding vector.

[0194] In an embodiment of the present application, the electronic device encodes a second number of preset opinion texts through a second encoding model of the opinion recognition model to obtain a second number of second encoding vectors, and then determines the opinion recognition vector by calculating the semantic similarity between the third intermediate vector and each second encoding vector.

[0195] In an embodiment of the present application, the second coding model calculates the semantic similarity between the third intermediate vector and each second coding vector to obtain the probability distribution that the third intermediate vector belongs to different preset opinion texts. It can be understood that after the semantic similarity between the third intermediate vector and a second coding vector is calculated, a value representing the similarity is obtained. It should be noted that the larger the similarity value, the higher the similarity between the preset opinion text corresponding to the third intermediate vector and the second coding vector; the smaller the similarity value, the lower the similarity between the preset opinion text corresponding to the third intermediate vector and the second coding vector.

[0196] In the embodiment of the present application, the second encoding model uses the pre-trained language model PLM to encode each preset opinion text {tag i} to obtain the second encoding vector corresponding to each preset opinion text, and calculate the semantic similarity between the third intermediate vector and each second encoding vector, so as to determine the opinion recognition vector. The semantic similarity calculation can be expressed by formula (5):

[0197] Pt(i)= cos_similarity(Vt,tag_vec(i)) (5)

[0198] Among them, Pt(i) represents the opinion recognition vector. It can be understood that Pt(i) is the result of semantic similarity calculation between the i-th second encoding vector and the third intermediate vector, Vt represents the third intermediate vector output by the second expert hybrid network model, tag_vec(i) represents the second encoding vector corresponding to the i-th preset opinion text, and cos_similarity(·) represents the cosine similarity calculation function.

[0199] In some embodiments of the present application, Figure 5 As shown, the viewpoint identification method further includes S510 to S540:

[0200] S510: Acquire sample data, where the sample data includes text sample data, at least one information sample label related to the viewpoint of the sample data, and a viewpoint sample label.

[0201] In an embodiment of the present application, an electronic device obtains sample data, where the sample data includes text sample data, at least one information sample label related to a viewpoint of the sample data, and a viewpoint sample label.

[0202] In an embodiment of the present application, in the process of training the first coding model, at least one information recognition model and the opinion recognition model, it is necessary to obtain sample data for training the models.

[0203] In an embodiment of the present application, the sample data includes text sample data, at least one information sample label related to the opinion of the sample data, and an opinion sample label. After the text sample data is obtained, the information sample label and the opinion sample label are annotated on the text sample data.

[0204] Exemplarily, the text sample data is the text data corresponding to the user's spoken text (audio data), for example, the text sample data is "the screen display of this mobile phone is too unclear". The information sample label is the information label related to the opinion information of the sample data, such as the emotion information label and the attribute information label, for example, the information sample label is "negative" and "screen". The opinion sample label is the opinion information of the sample data, for example, the opinion sample label is "low screen resolution".

[0205] S520: Pass the text sample data through an initial first encoding model, at least one initial information recognition model, and an initial viewpoint recognition model to obtain at least one information recognition sample vector related to the viewpoint of the text sample data, and a viewpoint recognition sample vector.

[0206] In an embodiment of the present application, after the electronic device acquires the sample data, it passes the text sample data through an initial first encoding model, at least one initial information recognition model and an initial opinion recognition model to obtain at least one information recognition sample vector related to the opinion of the text sample data, and an opinion recognition sample vector.

[0207] In some embodiments of the present application, S520 includes S521 to S523:

[0208] S521. Encode the text sample data using the initial first encoding model to obtain an encoded sample vector.

[0209] In an embodiment of the present application, the electronic device encodes the text sample data through an initial first encoding model to obtain an encoded sample vector.

[0210] In the embodiment of the present application, the initial first coding model is the first coding model before training.

[0211] S522. Use at least one initial information recognition model to perform information recognition on the coded sample vector to obtain at least one information recognition sample vector.

[0212] In an embodiment of the present application, the electronic device passes the text sample data through at least one initial information recognition model, and uses the initial information recognition model to perform information recognition on the encoded sample vector to obtain at least one information recognition sample vector.

[0213] In an embodiment of the present application, the initial information recognition model is the first encoding model before training.

[0214] S523. Using the initial viewpoint recognition model, based on the encoding sample vector and at least one information recognition sample vector, obtain a viewpoint recognition sample vector.

[0215] In an embodiment of the present application, the electronic device passes the encoding sample vector and at least one information identification sample vector through an initial viewpoint identification model to obtain a viewpoint identification sample vector.

[0216] In the embodiment of the present application, the initial viewpoint recognition model is the first encoding model before training.

[0217] It should be noted that the structural introduction of the initial first coding model, the initial information identification model and the initial opinion identification model refers to the structural introduction of the first coding model, the information identification model and the opinion identification model described above, and will not be repeated in the embodiments of the present application.

[0218] S530: Input at least one information sample label, an opinion sample label, at least one information identification sample vector and an opinion identification sample vector into a preset loss model to obtain a loss result.

[0219] In an embodiment of the present application, in an embodiment of the present application, the electronic device passes text sample data through an initial first encoding model, at least one initial information recognition model and an initial opinion recognition model to obtain at least one information recognition sample vector related to the opinion of the text sample data, and an opinion recognition sample vector, and then inputs at least one information sample label, the opinion sample label, at least one information recognition sample vector and the opinion recognition sample vector into a preset loss model to obtain a loss result.

[0220] In an embodiment of the present application, the preset loss model includes at least a loss function corresponding to the information recognition model and a loss function corresponding to the opinion recognition model.

[0221] In some embodiments of the present application, the information sample labels include emotion sample labels and attribute sample labels; the information recognition sample vectors include emotion recognition sample vectors and attribute recognition sample vectors; and the preset loss model includes a first loss function, a second loss function, and a third loss function. Figure 6 As shown, S530 includes S531 to S534:

[0222] S531. Input the emotion recognition sample vector and the emotion sample label into the first loss function to obtain a first loss result corresponding to the emotion recognition sample vector.

[0223] In the embodiment of the present application, it can be characterized as the error between the emotion recognition sample vector and the emotion sample label.

[0224] In an embodiment of the present application, the first loss function may be the cross entropy of the emotion recognition sample vector and the emotion sample label.

[0225] In an embodiment of the present application, the hyperparameters in the first loss function can be adjusted through the model training process.

[0226] S532: Input the attribute recognition sample vector and the attribute sample label into the second loss function to obtain a second loss result corresponding to the attribute recognition sample vector.

[0227] In the embodiment of the present application, the second loss function can be characterized as the error between the attribute recognition sample vector and the attribute sample label.

[0228] In an embodiment of the present application, the second loss function may be the cross entropy of the attribute recognition sample vector and the attribute sample label.

[0229] In an embodiment of the present application, the hyperparameters in the second loss function can be adjusted through the model training process.

[0230] S533. Input the opinion recognition sample vector and the opinion sample label into the third loss function to obtain a third loss result corresponding to the opinion recognition sample vector.

[0231] In the embodiment of the present application, the third loss function can be characterized as the error between the opinion recognition sample vector and the opinion sample label.

[0232] In an embodiment of the present application, the third loss function may be the cross entropy of the opinion recognition sample vector and the opinion sample label.

[0233] In this embodiment of the present application, the hyperparameters in the third loss function can be adjusted through the model training process.

[0234] S534. Obtain a loss result according to the first loss result, the second loss result and the third loss result.

[0235] In the embodiment of the present application, the electronic device performs weighted summation on the first loss result Ls of the first loss function, the second loss result La of the second loss function, and the third loss result Lt of the third loss function to obtain a final loss result. The loss result can be determined by formula (6):

[0236] Loss = Ls + La + Lt (6)

[0237] Among them, Loss represents the loss result, Ls represents the first loss result of the first loss function, La represents the second loss result of the second loss function, and Lt represents the third loss result of the third loss function.

[0238] In the embodiment of the present application, the overall model determines the final first encoding model, information recognition model and opinion recognition model by optimizing the preset loss model Loss.

[0239] In some embodiments of the present application, after S533, S535 to S537 are further included:

[0240] S535. For the initial second expert mixture network model in the initial opinion recognition model, each fifth intermediate vector output by each initial second expert network model in the initial second expert mixture network model is input into the fourth loss function.

[0241] In the embodiment of the present application, the fifth intermediate vector is a vector output by each initial second expert network model in the initial second expert mixture network model.

[0242] In the embodiment of the present application, the fourth loss function represents the similarity of each fifth intermediate vector output by each second expert network model in each second mixture of experts network model.

[0243] In this embodiment of the present application, the hyperparameters in the fourth loss function can be adjusted through the model training process.

[0244] In some embodiments of the present application, the fourth loss function is a cosine similarity function.

[0245] S536. Determine the mutually exclusive entropy between each fifth intermediate vector through the fourth loss function, so as to obtain a fourth loss result.

[0246] In the embodiment of the present application, the fourth loss function can be expressed by formula (7):

[0247] Le = ∑ ij cos_similarity(E i ,E j ) (7)

[0248] Among them, Le represents the fourth loss result of the fourth loss function, E i represents the output vector of the i-th second expert network model, E j represents the output vector of the j-th second expert network model, and cos_similarity(·) represents the cosine similarity function.

[0249] In the embodiment of the present application, by determining the mutually exclusive entropy between each fifth intermediate vector, each second expert network model can learn different feature information, thereby improving the performance of the model and improving the accuracy of opinion recognition for text data.

[0250] S537. Obtain a loss result according to the first loss result, the second loss result, the third loss result and the fourth loss result.

[0251] In the embodiment of the present application, the electronic device performs weighted summation on the first loss result Ls of the first loss function, the second loss result La of the second loss function, the third loss result Lt of the third loss function, and the fourth loss result Le of the fourth loss function to obtain a final loss result. The loss result can be determined by formula (8):

[0252] Loss=Ls+La+Lt+γLe (8)

[0253] Among them, Loss represents the loss result, Ls represents the first loss result of the first loss function, La represents the second loss result of the second loss function, Lt represents the third loss result of the third loss function, Le represents the fourth loss result of the fourth loss function, and γ is a hyperparameter. It should be noted that γ is part of the second expert mixture network model and needs to be determined through training.

[0254] S540. Based on the loss result, the model parameters in the initial first coding model, at least one initial information recognition model and the initial viewpoint recognition model are modified to obtain an intermediate first coding model, at least one intermediate information recognition model and an intermediate viewpoint recognition model.

[0255] In an embodiment of the present application, the electronic device inputs at least one information sample label, an opinion sample label, at least one information identification sample vector and an opinion identification sample vector into a preset loss model, and after obtaining the loss result, based on the loss result, corrects the model parameters in the initial first coding model, at least one initial information identification model and the initial opinion identification model to obtain an intermediate first coding model, at least one intermediate information identification model and an intermediate opinion identification model.

[0256] S550. Continue to pass the text sample data through the intermediate first encoding model, at least one intermediate information recognition model and the intermediate opinion recognition model to obtain an intermediate loss result, and based on the intermediate loss result, modify the model parameters in the intermediate first encoding model, at least one intermediate information recognition model and the intermediate opinion recognition model until the first encoding model, at least one information recognition model and the opinion recognition model are obtained.

[0257] In an embodiment of the present application, by optimizing the preset loss model (loss function) Loss, the initial first encoding model, the initial information encoding model and the initial opinion recognition model are optimized to obtain the final multi-task end-to-end multi-layer opinion recognition model (including a first encoding model, at least one information recognition model and an opinion recognition model).

[0258] The technical solution in the embodiment of the present application is clearly and completely described below in conjunction with a specific embodiment.

[0259] In the embodiment of the present application, a viewpoint recognition method is proposed, which is applied to a multi-layer recognition model. Figure 7 , Figure 7 A schematic diagram of the structure of a multi-layer recognition model proposed in an embodiment of the present application is shown. Figure 7 As shown, the multi-layer recognition model includes an input layer (text input layer), a first encoding model (text encoding layer), an emotion recognition model (emotion recognition layer), an attribute recognition model (attribute recognition layer) and an opinion recognition model (opinion recognition layer).

[0260] See also Figure 7 The first encoding model (encoding layer) includes a semantic recognition model and a hidden layer, the emotion recognition model (emotion recognition layer) includes a fully connected layer and a classification layer, the attribute recognition model (attribute recognition layer) includes a first expert mixture network model (expert mixture network layer), and the opinion recognition model (opinion recognition layer) includes a second encoding model (encoding layer) and a second expert mixture network model (expert mixture network layer), wherein the semantic recognition model is a pre-trained language model PLM.

[0261] See also Figure 7 , the current text data ( Figure 7 China-Israel <cls>This mobile phone screen display is too unclear" is shown) after passing through the multi-layer recognition model input layer, the semantic recognition model in the first encoding model and the hidden layer in sequence, the first encoding vector is obtained. Subsequently, the first encoding vector is passed through the fully connected layer and the classification layer in the emotion recognition model to obtain the emotion recognition vector ( Figure 7 Then, the first encoding vector is passed through the first expert mixture network model in the attribute recognition model to obtain the attribute recognition vector ( Figure 7 Subsequently, the first encoding vector, the emotion recognition vector, and the attribute recognition vector are passed through the second expert mixture network model in the opinion recognition model to obtain the third intermediate vector ( Figure 7 ) and at the same time, the second number of preset viewpoint texts ( Figure 7 After being encoded by the semantic recognition model and the fully connected layer in the second encoding model in sequence, a second number of second encoding vectors ( Figure 7 Finally, the semantic similarity between the third intermediate vector and each second encoding vector is calculated ( Figure 7 ) to determine the viewpoint recognition vector ( Figure 7 (shown as "Pt: (0.2, 0.02, ...)"), and then determine the viewpoint information corresponding to the current text data.

[0262] As a specific embodiment, Figure 7 The multi-layer recognition model shown in Figure 8 As shown, the viewpoint identification method provided in the embodiment of the present application includes S610 to S690:

[0263] S610, the electronic device trains the initial first coding model, the initial emotion recognition model, the initial attribute recognition model and the initial opinion recognition model in the initial multi-layer recognition model to obtain a first coding model, an emotion recognition model, an attribute recognition model and an opinion recognition model.

[0264] In an embodiment of the present application, an end-to-end model (multi-layer recognition model) is proposed for the three tasks of emotion, attribute, and opinion recognition of user voice text (current text data). Before training the multi-layer recognition model, the input data (sample data) needs to be labeled with emotions (emotion sample labels), attributes (attribute sample labels), and opinions (opinion sample labels).

[0265] For example, text sample data: the screen display of this mobile phone is too unclear; sentiment sample label: negative; attribute sample label: screen; opinion sample label: low screen resolution.

[0266] The sentiment classification task (sentiment recognition model) is responsible for identifying the sentiment of the text (current text data). Text sentiment is usually divided into three categories: positive, neutral, and negative. The attribute recognition task (attribute recognition model) is responsible for identifying the specific attribute categories of the product described by the text (current text data). For example, the attributes of a mobile phone include screen, battery life, camera effect, appearance, etc. The opinion recognition model is responsible for judging the opinion information expressed in the text (current text data). The opinion information is a short sentence with complete semantics and is concise, such as "high screen resolution" or "poor battery life of the mobile phone."

[0267] In the embodiment of the present application, S610 includes S611 to S614:

[0268] S611: The electronic device obtains sample data, where the sample data includes text sample data, at least one information sample label related to a viewpoint of the sample data, and a viewpoint sample label.

[0269] S612: The electronic device passes the text sample data through an initial first coding model, at least one initial information recognition model, and an initial viewpoint recognition model to obtain at least one information recognition sample vector related to the viewpoint of the text sample data, and a viewpoint recognition sample vector.

[0270] S613. The electronic device inputs at least one information sample label, an opinion sample label, at least one information identification sample vector and an opinion identification sample vector into a preset loss model to obtain a loss result.

[0271] S614. The electronic device modifies the model parameters in the initial multi-layer recognition model based on the loss result to obtain a first coding model, at least one information recognition model and a viewpoint recognition model.

[0272] S620. The electronic device obtains current text data; the current text data is text data corresponding to current audio data related to the service in the application scenario.

[0273] S630: The electronic device encodes the current text data using the first encoding model in the multi-layer recognition model to obtain a first encoding vector.

[0274] In the embodiment of the present application, the electronic device needs to pass the text input layer (text encoding layer) of the multi-layer recognition model before passing the first encoding model (text encoding layer). Figure 7 The text input layer is used to input the current text data. For the pre-trained language model, the pre-processing stage adds <cls>An identifier used to represent the semantic information of the text.

[0275] In the embodiment of the present application, the text encoding layer ( Figure 7 The first encoding model (text encoding layer) uses the encoder of the pre-trained language model (PLM) as the text encoding layer. PLM is obtained through self-supervised learning of a large amount of corpus. It can capture useful information contained in the corpus. By fine-tuning or training downstream tasks based on the PLM model, better reasoning effects can be obtained.

[0276] Since the generalization performance of open source PLM models often decreases in specific fields, in order to better identify the opinions expressed by users, secondary pre-training is required based on the open source PLM model. By designing a complete data flow to incrementally collect and persist the text of user voices (including evaluation questions and answers), for example, historical data with a data volume of about 10 billion can be selected to conduct a complete pre-trained language model (PLM) training. In addition, user voice corpus (current text data) within a preset time (three months) can be selected to train the PLM, so that the model can adapt to the latest user expressions and fully reflect the semantic information of the text.

[0277] S640. The electronic device uses the emotion recognition model in the multi-layer recognition model to recognize the emotion information of the first coding vector to obtain an emotion recognition vector.

[0278] In the embodiment of the present application, considering that the emotion recognition task is relatively simple, the emotion recognition model uses the PLM with <cls>The output vector of the identifier is added with a simple fully connected layer to output the sentiment probability distribution Ps (0.1, 0.1, 0.8). Ps is a dimensional vector that represents the probability of the text (current text data) belonging to positive, neutral, and negative sentiments. The final text sentiment is the category with the highest probability.

[0279] S650: The electronic device uses the attribute recognition model in the multi-layer recognition model to recognize the attribute information of the first coding vector to obtain an attribute recognition vector.

[0280] In the embodiments of the present application, the types of attributes of commodities are usually in the order of dozens, so the effect of simply adding a fully connected layer is often average. Therefore, the attribute recognition model (attribute recognition layer) introduces a mixture of experts (MOE) to identify the attributes. The structure of the mixture of experts (MOE) includes two parts: a gate network (Gate) and an expert network (Expert). An MOE contains multiple expert networks (expert network models) and their corresponding gates. Each expert network is used to learn different types of semantic information; the gate network outputs only 0 and 1, which are used to screen which expert networks will eventually output, which can reduce calculations during the reasoning process, that is, the attribute recognition model only needs to calculate experts with a weight of 1. For the MOE of the attribute recognition model, only a small number of expert networks are needed. For example, the number of expert networks can be 4.

[0281] S660: The electronic device fuses the first coding vector, the emotion recognition vector and the attribute recognition model to obtain a second intermediate vector.

[0282] S670: The electronic device uses the second expert mixture network model of the opinion recognition model to perform information recognition on the second intermediate vector to obtain a third intermediate vector.

[0283] In the embodiment of the present application, the opinion recognition layer (opinion recognition model) is used to identify the final user opinion. The opinion recognition model includes the MOE layer (second expert mixture network model) and the matching layer (second encoding model). For the MOE layer, since there are hundreds or thousands of opinion categories (preset opinion texts), the number of expert networks required is relatively large. For example, the number of expert networks can be n=32. Due to the increase in the number of expert networks, overfitting is prone to occur. Therefore, the opinion recognition model uses two methods to optimize:

[0284] The first one is to propose a Dropout mechanism for the expert network. During each calculation, the opinion recognition model will invalidate a part of the expert network, that is, the output of the invalid expert network will not contribute to the next layer of calculation. For details, see the relevant description of formula (4).

[0285] The second type, the opinion recognition model, introduces a mutually exclusive entropy so that different expert networks can learn different information. For details, see the relevant description of formula (7).

[0286] S680. The electronic device encodes a second number of preset opinion texts by using a second encoding model of the opinion recognition model to obtain a second number of second encoding vectors.

[0287] S690: The electronic device determines a viewpoint recognition vector by calculating semantic similarity between the third intermediate vector and each second encoding vector, thereby determining viewpoint information corresponding to the current text data.

[0288] In the embodiment of the present application, for the matching layer (second encoding model), the opinion recognition model uses PLM to first encode all opinions {tagi} (preset opinion text), and then uses the output of the opinion expert network and the encoding vector (second encoding vector) of the opinion (preset opinion text) to calculate the semantic similarity, and obtains the probability distribution Pt (0.2, 0.002, ...) of the text belonging to different tags. For details, see the relevant description of formula (5).

[0289] In an embodiment of the present application, a viewpoint recognition method is proposed. First, the electronic device obtains current text data; then, the electronic device encodes the current text data using a first coding model to obtain a first coding vector; subsequently, the electronic device uses at least one information recognition model to perform information recognition on the first coding vector to obtain at least one information recognition vector; finally, the electronic device uses a viewpoint recognition model to obtain a viewpoint recognition vector based on the first coding vector and at least one information recognition vector, thereby determining the viewpoint information corresponding to the current text data.

[0290] In an embodiment of the present application, an end-to-end multi-task mutually exclusive expert network model (multi-layer recognition model) is designed, which can simultaneously solve multiple tasks including emotion, attribute and opinion recognition.

[0291] In the embodiment of the present application, an expert mixture network is used to realize the recognition of different types of information, thereby improving the generalization ability of the model without affecting the reasoning efficiency.

[0292] In the embodiment of the present application, an expert network Dropout and mutual exclusion mechanism are proposed to optimize the overfitting problem.

[0293] In an embodiment of the present application, in order to solve the problem of low recognition accuracy of new types of corpora, the corpora of the last three months will be persisted, and the language model will be iterated regularly, and then the end-to-end opinion recognition model (multi-layer recognition model) will be updated again, thereby improving the accuracy of opinion recognition in text data.

[0294] In an embodiment of the present application, since the electronic device passes the first coding vector through at least one information recognition model to obtain at least one information recognition vector, and passes the first coding vector and at least one information recognition vector through an opinion recognition network model at the same time to perform opinion recognition and thereby obtain an opinion recognition vector, a hierarchical structure between the information recognition network model and the opinion recognition network model is implemented, and multiple recognition tasks can be solved simultaneously, and the feature information of the text data can be fully utilized, thereby considering the correlation between different recognition tasks.

[0295] In an embodiment of the present application, the information recognition vector represents information related to the opinion of the current text data. In this way, different types of information recognition of text data can be achieved, thereby improving the generalization ability of the overall model without affecting the reasoning efficiency, thereby improving the accuracy of opinion recognition of text data.

[0296] In an embodiment of the present application, by implementing a hierarchical structure between the information recognition network model and the opinion recognition network model, each recognition model is not independent, and multiple recognition models can be maintained at the same time, thereby reducing the computational cost of the model and improving the overall reasoning efficiency of the model.

[0297] Based on the above embodiments, the present application provides an optional structural diagram of a viewpoint identification device, such as Fig. 9 As shown, the viewpoint recognition device 800 includes an acquisition model 801, an encoding module 802, a recognition module 803 and a training module 804; wherein,

[0298] The acquisition module 801 is used to acquire current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario;

[0299] The encoding module 802 is used to encode the current text data using a first encoding model to obtain a first encoding vector;

[0300] The identification module 803 is used to perform information identification on the first coding vector using at least one information identification model to obtain at least one information identification vector; the information identification vector represents information related to the viewpoint of the current text data;

[0301] The recognition module 804 is further configured to obtain a viewpoint recognition vector using a viewpoint recognition model based on the first encoding vector and the at least one information recognition vector, thereby determining the viewpoint information corresponding to the current text data.

[0302] In some embodiments of the present application, the information recognition model includes at least one of the following: an emotion recognition model and an attribute recognition model; the information recognition vector includes at least one of the following: an emotion recognition vector and an attribute recognition vector; the recognition module 803 is also used to use the emotion recognition model to identify the emotion information of the first coding vector to obtain the emotion recognition vector; use the attribute recognition model to identify the attribute information of the first coding vector to obtain the attribute recognition vector.

[0303] In some embodiments of the present application, the attribute recognition model is a first expert mixture network model; the recognition module 803 is also used to pass the first coding vector through the first gate network of the first expert mixture network model to obtain a first number of first weights; the first number is consistent with the number of first expert network models in the first expert mixture network model; according to the first weights of the first number, at least one first target expert network model is determined in the first number of first expert network models; using the at least one first target expert network model, the attribute information of the first coding vector is identified to obtain at least one first intermediate vector corresponding to the at least one first target expert network model; the at least one first intermediate vector is weightedly summed with the corresponding first weight to obtain the attribute recognition vector.

[0304] In some embodiments of the present application, the recognition module 803 is also used to fuse the first encoding vector and the at least one information identification vector to obtain a second intermediate vector; perform information recognition on the second intermediate vector through the second expert mixture network model of the opinion recognition model to obtain a third intermediate vector; encode a second number of preset opinion texts through the second encoding model of the opinion recognition model to obtain the second number of second encoding vectors; and determine the opinion recognition vector by calculating the semantic similarity between the third intermediate vector and each of the second encoding vectors.

[0305] In some embodiments of the present application, the identification module 803 is also used to pass the second intermediate vector through the second gate network of the second expert mixture network model to obtain a third number of second weights; the third number is consistent with the number of second expert network models in the second expert mixture network model; according to the third number of second weights, at least one second target expert network model is determined in the third number of second expert network models; through the at least one second target expert network model, the attribute information of the second intermediate vector is identified to obtain at least one fourth intermediate vector corresponding to the at least one second target expert network model; the at least one fourth intermediate vector is weightedly summed with the corresponding second weight to obtain the third intermediate vector.

[0306] In some embodiments of the present application, the identification module 803 is further used to determine a fourth number of second expert network models in a working state among the third number of second expert network models; the fourth number is less than or equal to the third number; and determine the at least one second target expert network model in a working state according to the second weights corresponding to the fourth number of second expert network models.

[0307] In some embodiments of the present application, the identification module 803 is also used to set the fourth number of second expert network models in the second expert mixture network model to a working state according to the first preset parameter; set the fifth number of second expert network models in the second expert mixture network model to an invalid state according to the second preset parameter; and the sum of the fourth number and the fifth number is less than or equal to the third number.

[0308] In some embodiments of the present application, the training module 804 is used to obtain sample data, the sample data including text sample data, at least one information sample label related to the viewpoint of the sample data, and a viewpoint sample label; pass the text sample data through an initial first encoding model, at least one initial information recognition model, and an initial viewpoint recognition model to obtain at least one information recognition sample vector related to the viewpoint of the text sample data, and a viewpoint recognition sample vector; input the at least one information sample label, the viewpoint sample label, the at least one information recognition sample vector, and the viewpoint recognition sample vector into a preset loss model to obtain a loss result; based on the loss result, modify the model parameters in the initial first encoding model, the at least one initial information recognition model, and the initial viewpoint recognition model to obtain an intermediate first encoding model, at least one intermediate information recognition model, and an intermediate viewpoint recognition model; continue to pass the text sample data through the intermediate first encoding model, the at least one intermediate information recognition model, and the intermediate viewpoint recognition model to obtain an intermediate loss result, and based on the intermediate loss result, modify the model parameters in the intermediate first encoding model, the at least one intermediate information recognition model, and the intermediate viewpoint recognition model until the first encoding model, the at least one information recognition model, and the viewpoint recognition model are obtained.

[0309] In some embodiments of the present application, the training module 804 is also used to encode the text sample data using the initial first encoding model to obtain an encoding sample vector; to perform information recognition on the encoding sample vector using the at least one initial information recognition model to obtain at least one information recognition sample vector; and to obtain an opinion recognition sample vector based on the encoding sample vector and the at least one information recognition sample vector using the initial opinion recognition model.

[0310] In some embodiments of the present application, the information sample label includes an emotion sample label and an attribute sample label; the information identification sample vector includes an emotion identification sample vector and an attribute identification sample vector; the preset loss model includes a first loss function, a second loss function and a third loss function; the training module 804 is also used to input the emotion identification sample vector and the emotion sample label into the first loss function to obtain a first loss result corresponding to the emotion identification sample vector; input the attribute identification sample vector and the attribute sample label into the second loss function to obtain a second loss result corresponding to the attribute identification sample vector; input the opinion identification sample vector and the opinion sample label into the third loss function to obtain a third loss result corresponding to the opinion identification sample vector; and obtain the loss result based on the first loss result, the second loss result and the third loss result.

[0311] In some embodiments of the present application, the preset loss model also includes a fourth loss function; the training module 804 is also used to input each fifth intermediate vector output by each initial second expert network model in the initial second expert mixture network model into the fourth loss function for the initial second expert mixture network model in the initial opinion recognition model; determine the mutually exclusive entropy between each of the fifth intermediate vectors through the fourth loss function to obtain a fourth loss result; and obtain the loss result based on the first loss result, the second loss result, the third loss result and the fourth loss result.

[0312] In some embodiments of the present application, the fourth loss function is a cosine similarity function.

[0313] In some embodiments of the present application, the first encoding model and the viewpoint recognition model include a semantic recognition model.

[0314] In some embodiments of the present application, the semantic recognition model is a pre-trained language model.

[0315] It should be noted that the division of modules or units in the viewpoint identification device in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or 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 a software functional unit. It may also be implemented in the form of a combination of software and hardware.

[0316] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0317] Fig.10 A schematic diagram of the structure of an optional electronic device provided in an embodiment of the present application, such as Fig.10 As shown, an embodiment of the present application provides an electronic device 900, including:

[0318] Memory 901, used to store executable instructions;

[0319] The processor 902 is used to implement the above-mentioned viewpoint identification method when executing the executable instructions stored in the memory 901.

[0320] It can be understood that the memory 901 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 901 of the systems and methods described in the present application is intended to include, but is not limited to, these and any other suitable types of memory.

[0321] The processor 902 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 902. The above processor 902 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 901, and the processor 902 reads the information in the memory 902 respectively, and completes the steps of the above method in combination with its hardware.

[0322] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units or combinations thereof for performing functions described in the present application. For software implementation, the technology described in the present application can be implemented by a module (such as a process, function, etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor.

[0323] An embodiment of the present application provides a computer storage medium, which stores executable instructions. When the executable instructions are executed, they are used to cause a first processor to execute the viewpoint identification method described in one or more of the above embodiments.

[0324] An embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the opinion identification method provided in the above method embodiment.

[0325] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0326] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0327] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description of the various embodiments tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. For the sake of brevity, this article will not go into details.

[0328] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can mean: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0329] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0330] 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. The embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.

[0331] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; 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 present embodiment.

[0332] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0333] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0334] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0335] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0336] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0337] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls> < / cls>

Claims

1. A method for identifying viewpoints, It is characterized in that The method comprises: Acquire current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario; Encoding the current text data using a first encoding model to obtain a first encoding vector; Using at least one information recognition model, performing information recognition on the first encoding vector to obtain at least one information recognition vector; the information recognition vector represents information related to the viewpoint of the current text data; By using a viewpoint recognition model, based on the first encoding vector and the at least one information recognition vector, a viewpoint recognition vector is obtained, thereby determining the viewpoint information corresponding to the current text data.

2. The method according to claim 1, It is characterized in that The information recognition model includes at least one of the following: an emotion recognition model and an attribute recognition model; The information recognition vector includes at least one of the following: an emotion recognition vector and an attribute recognition vector; The using at least one information recognition model to perform information recognition on the first encoding vector to obtain at least one information recognition vector includes at least one of the following: Using the emotion recognition model, the emotion information of the first coding vector is recognized to obtain the emotion recognition vector; The attribute recognition model is used to recognize the attribute information of the first encoding vector to obtain the attribute recognition vector.

3. The method according to claim 2, It is characterized in that The attribute recognition model is a first expert mixture network model; The step of using the attribute recognition model to recognize the attribute information of the first encoding vector to obtain the attribute recognition vector includes: Passing the first encoding vector through a first gate network of the first expert mixture network model to obtain a first number of first weights; the first number is consistent with the number of first expert network models in the first expert mixture network model; determining at least one first target expert network model among the first number of the first expert network models according to the first number of the first weights; Using the at least one first target expert network model, identifying the attribute information of the first encoding vector, and obtaining at least one first intermediate vector corresponding to the at least one first target expert network model; The at least one first intermediate vector is weightedly summed with the corresponding first weight to obtain the attribute identification vector.

4. The method according to any one of claims 1 to 3, It is characterized in that The using the viewpoint recognition model to obtain the viewpoint recognition vector based on the first encoding vector and the at least one information recognition vector includes: Merging the first encoding vector and the at least one information identification vector to obtain a second intermediate vector; Performing information recognition on the second intermediate vector through the second expert mixture network model of the opinion recognition model to obtain a third intermediate vector; Encoding a second number of preset opinion texts by using a second encoding model of the opinion recognition model to obtain the second number of second encoding vectors; The viewpoint identification vector is determined by calculating the semantic similarity between the third intermediate vector and each of the second encoding vectors.

5. The method according to claim 4, It is characterized in that The step of performing information recognition on the second intermediate vector by using the second expert mixture network model of the opinion recognition model to obtain a third intermediate vector includes: Passing the second intermediate vector through the second gate network of the second expert mixture network model to obtain a third number of second weights; the third number is consistent with the number of the second expert network model in the second expert mixture network model; determining at least one second target expert network model from the third number of the second expert network models according to the third number of the second weights; Identifying the attribute information of the second intermediate vector by using the at least one second target expert network model to obtain at least one fourth intermediate vector corresponding to the at least one second target expert network model; The at least one fourth intermediate vector is weightedly summed with the corresponding second weight to obtain the third intermediate vector.

6. The method according to claim 5, It is characterized in that Determining at least one second target expert network from the third number of the second expert networks according to the third number of the second weights includes: Determine a fourth number of second expert network models in working state among the third number of the second expert network models; the fourth number is less than or equal to the third number; The at least one second target expert network model in working state is determined according to the second weights corresponding to the fourth number of the second expert network models.

7. The method according to claim 5 or 6, It is characterized in that After the second intermediate vector is passed through the second gate network model of the second expert mixture network model to obtain a third number of second weights, the method further includes: According to the first preset parameter, setting a fourth number of second expert network models in the second expert mixture network model to a working state; According to a second preset parameter, a fifth number of second expert network models in the second expert mixture network model are set to an invalid state; and the sum of the fourth number and the fifth number is less than or equal to the third number.

8. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: Acquire sample data, the sample data comprising text sample data, at least one information sample label related to the opinion of the sample data, and an opinion sample label; Passing the text sample data through an initial first coding model, at least one initial information recognition model and an initial viewpoint recognition model to obtain at least one information recognition sample vector and a viewpoint recognition sample vector related to the viewpoint of the text sample data; Inputting the at least one information sample label, the opinion sample label, the at least one information identification sample vector, and the opinion identification sample vector into a preset loss model to obtain a loss result; Based on the loss result, modifying model parameters in the initial first coding model, the at least one initial information recognition model, and the initial viewpoint recognition model to obtain an intermediate first coding model, at least one intermediate information recognition model, and an intermediate viewpoint recognition model; Continue to pass the text sample data through the intermediate first encoding model, the at least one intermediate information recognition model and the intermediate opinion recognition model to obtain an intermediate loss result, and based on the intermediate loss result, modify the model parameters in the intermediate first encoding model, the at least one intermediate information recognition model and the intermediate opinion recognition model until the first encoding model, the at least one information recognition model and the opinion recognition model are obtained.

9. The method according to claim 8, It is characterized in that The step of passing the text sample data through an initial first coding model, at least one initial information recognition model and an initial viewpoint recognition model to obtain at least one information recognition sample vector related to the viewpoint of the text sample data and a viewpoint recognition sample vector comprises: Encoding the text sample data using the initial first encoding model to obtain an encoding sample vector; Using the at least one initial information recognition model, performing information recognition on the coded sample vector to obtain the at least one information recognition sample vector; The initial viewpoint recognition model is used to obtain the viewpoint recognition sample vector based on the encoding sample vector and the at least one information recognition sample vector.

10. The method according to claim 8, It is characterized in that The information sample labels include sentiment sample labels and attribute sample labels; The information recognition sample vector includes an emotion recognition sample vector and an attribute recognition sample vector; The preset loss model includes a first loss function, a second loss function and a third loss function; The step of inputting the at least one information sample label, the opinion sample label, the at least one information identification sample vector, and the opinion identification sample vector into a preset loss function to obtain a loss result includes: Inputting the emotion recognition sample vector and the emotion sample label into the first loss function to obtain a first loss result corresponding to the emotion recognition sample vector; Inputting the attribute recognition sample vector and the attribute sample label into the second loss function to obtain a second loss result corresponding to the attribute recognition sample vector; Inputting the opinion recognition sample vector and the opinion sample label into the third loss function to obtain a third loss result corresponding to the opinion recognition sample vector; The loss result is obtained according to the first loss result, the second loss result and the third loss result.

11. The method according to claim 10, It is characterized in that The preset loss model also includes a fourth loss function; After inputting the opinion recognition sample vector and the opinion sample label into the third loss function to obtain a third loss result corresponding to the opinion recognition sample vector, the method further includes: For the initial second expert mixture network model in the initial opinion recognition model, inputting each fifth intermediate vector output by each initial second expert network model in the initial second expert mixture network model into the fourth loss function; Determine the mutual exclusion entropy between each of the fifth intermediate vectors by using the fourth loss function, thereby obtaining a fourth loss result; The loss result is obtained according to the first loss result, the second loss result, the third loss result and the fourth loss result.

12. The method according to claim 11, It is characterized in that The fourth loss function is a cosine similarity function.

13. The method according to any one of claims 1 to 3, It is characterized in that The first encoding model and the viewpoint recognition model include a semantic recognition model.

14. The method according to claim 13, It is characterized in that The semantic recognition model is a pre-trained language model.

15. A point of view recognition device, It is characterized in that The device comprises: An acquisition module, used to acquire current text data; the current text data is text data corresponding to current audio data related to the business in the application scenario; An encoding module, used for encoding the current text data using a first encoding model to obtain a first encoding vector; an identification module, configured to perform information identification on the first encoding vector using at least one information identification model to obtain at least one information identification vector; the information identification vector represents information related to the viewpoint of the current text data; The recognition module is further used to obtain a viewpoint recognition vector using a viewpoint recognition model based on the first encoding vector and the at least one information recognition vector, thereby determining the viewpoint information corresponding to the current text data.

16. An electronic device, It is characterized in that include: A memory for storing executable instructions; A processor is used to implement the viewpoint identification method described in any one of claims 1 to 14 when executing the executable instructions stored in the memory.

17. A computer-readable storage medium, It is characterized in that Executable instructions are stored, and when the executable instructions are executed by one or more processors, the viewpoint identification method as described in any one of claims 1 to 14 is implemented.