Emotional value analysis method and device based on large model and storage medium
Through the large model, the problem of high data deviation and misidentification rate in the existing technology is solved, and the accuracy of emotional judgment and generalization ability are improved.
Patent Information
- Application Number
- CN202510591271.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-05
AI Technical Summary
The existing emotional value analysis system based on natural language processing has problems such as data deviation, high misidentification rate and poor generalization ability.
A large model is used for emotional value analysis, including collecting text data, preprocessing, feature extraction encoding, knowledge base adaptation and vector mapping to the scoring recommendation space, using pre-trained word embedding models and LLM models for feature extraction, evaluating the similarity between knowledge and text vectors through the cosine similarity algorithm, and building a mapping model for scoring and recommendation.
It significantly improves the accuracy of program generation and the accuracy of emotional discrimination, and enhances the generalization ability of the model.
Smart Images

Figure CN120429409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a sentiment value analysis method, device, and storage medium based on a large model. Background Art
[0002] The existing sentiment value analysis system process based on natural language processing is to collect a large amount of text data from social networks, forums, behavioral websites, etc., pre-process the original text data in the feature engineering stage, delete meaningless words in the text, and obtain structured data that can be used by downstream deep models through word segmentation and division. Feature encoding extracts sentiment features from structured data and encodes them to obtain the corresponding dense vector representation. Scoring and sorting analyze and sort the extracted sentiment features to obtain a popularity ranking list to be presented to users. The recommendation process control serves as the central controller to control the overall process of the sentiment value system, and can also be refined to control the recall, coarse sorting, and fine sorting of the popularity sorting stage.
[0003] Recommendation systems based on natural language processing currently have the following shortcomings: 1. Data bias: If the training data is biased, the model will also learn these biases. 2. High misidentification rates: Due to the ambiguity and polysemy of language, natural language processing technology is prone to misidentification, resulting in inaccurate results. 3. Poor generalization: Natural language models often perform well on training data but poorly on unseen data. Summary of the Invention
[0004] This application provides a sentiment value analysis method, device and storage medium based on a large model to at least solve the above technical problems existing in the prior art.
[0005] According to a first aspect of the present application, a sentiment value analysis method based on a large model is provided, comprising the following steps: S1, collects original text data; S2, preprocessing, segmenting the original text data into words or tokens, marking the relevant parts of speech, and building a vocabulary; S3, feature extraction encoding, uses a pre-trained word embedding model to convert each word or word into a fixed-dimensional text vector and stores the encoded text vector in a database or file; S4, knowledge base adaptation, constructing a structured knowledge base, the knowledge base including a number of knowledge adapted to the text vector; extracting knowledge from the knowledge base and adapting it to the text vector, and evaluating the similarity between the knowledge and the text vector; S5, generate a vector mapping to the rating recommendation space, define the rating recommendation space, clarify the structure and characteristics of the rating recommendation space, which involves determining the rating range, rating dimensions, and the weight relationship between each dimension; build a mapping model from the semantic space to the rating recommendation space, and use labeled training data to train the mapping model; input the text vector to be recommended into the mapping model, and the mapping model will output the corresponding rating recommendation vector.
[0006] In certain embodiments of the first aspect of the present application, in step S2, a unique integer index is assigned to each word or word-unit to facilitate subsequent encoding.
[0007] In certain embodiments of the first aspect of the present application, in step S3, the text vector is further adjusted and stored in a database or file; Use the continuous bag-of-words model to predict the target word based on the context vocabulary; The continuous bag-of-words model includes an embeddings layer and a linear layer. The embeddings layer converts the input context words into a context word vector and continues to calculate the average of these context word vectors to represent the vector of the entire context. The linear layer receives this vector representing the entire context and converts it into an output vector. The dimension of the output vector is the same as the size of the vocabulary. Then, using the softmax function, the output vector is converted into a probability distribution, which represents the probability of each word being the target word. The word with the highest probability is the prediction result of the continuous bag-of-words model.
[0008] In certain embodiments of the first aspect of the present application, the embeddings layer is calculated as follows: The average value of the input context words and the weight W are calculated to obtain the intermediate vector h; formula:
[0009] Where: C is the total number of input context words, W is a weight matrix, x1,x2,...,xC are the symbolic representations of the input context words, w1,w2,...,wC are the context words, is the input vector of the context word wj, 1≤j≤C; The linear layer is calculated as follows: Set up an N×V weight matrix v'=v_ij: formula: ; The output layer is connected to softmax: to obtain the posterior probability formula of each context word:
[0010] in, is the posterior probability of the context word, yj is the probability distribution of the predicted word, u j The output for the target location is an unnormalized score.
[0011] In certain embodiments of the first aspect of the present application, in step S4, the similarity between the knowledge and the text vector is evaluated by a cosine similarity algorithm;
[0012] Among them, similarity is the similarity, A i Represents knowledge, B i Represents a text vector.
[0013] In certain embodiments of the first aspect of the present application, in step S3, the feature extraction encoding is performed using an LLM model, including the following steps: S31, collecting text data, wherein the text data includes user representation and item representation; S32, select the language model BERT algorithm; S33, passing the text data as input to the LLM model, position encoding or adding tags to the text data to provide additional context information; S34, the LLM model uses Word2Vec through the embedding layer to convert the input text data into a high-dimensional vector space, mapping each word or token to a vector; S35, the vector is processed by a multi-layer Transformer encoder to output the encoded text vector.
[0014] In certain embodiments of the first aspect of the present application, the user representation includes the user's behavior, comments, and likes.
[0015] In certain embodiments of the first aspect of the present application, the item representation includes a news title, a summary, and category information.
[0016] According to a second aspect of the present application, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in this application.
[0017] According to a third aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the present application.
[0018] Compared with the prior art, this application has the following beneficial effects: This application converts the generated text data into vectors through text encoding, and then adapts it to the knowledge base to map the newly generated vectors from the semantic space to the rating recommendation space, which can significantly improve the accuracy of solution generation and the precision of sentiment discrimination.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an illustrative and non-limiting manner, in which: In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.
[0021] Figure 1 Shown is the overall implementation flow chart of this application.
[0022] Figure 2 A schematic diagram of the continuous bag-of-words model of this application is shown.
[0023] Figure 3 The multivariate analysis framework of the sentiment value analysis knowledge base of this application is shown.
[0024] Figure 4 The flowchart of the LLM model feature coding implementation of this application is shown.
[0025] Figure 5 Shown is a schematic diagram of sentiment heat ranking of this application.
[0026] Figure 6 The figure shows the process flow of the LLM-based integrated sentiment analysis system of this application.
[0027] Figure 7 A schematic diagram of the structure of an electronic device according to the second embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] In order to make the purpose, features, and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0029] Example 1: Please refer to Figure 1 , this embodiment 1 provides a sentiment value analysis method based on a large model, comprising the following steps: S1, collects original text data, which can be a large amount of text data from social networks, forums, behavioral websites, etc.
[0030] S2, preprocessing, performs word segmentation on the raw text data, splits it into words or tokens, removes stop words to reduce the dimension and noise of the vector space, annotates the relevant parts of speech, lists all unique words or tokens in the text, builds a vocabulary (or dictionary), and assigns a unique integer index to each word or token for subsequent encoding.
[0031] S3, feature extraction encoding, adopts word embedding mode processing, and uses the pre-trained word embedding model Word2Vec to convert each word or word into a text vector of fixed dimension.
[0032] These vectors can capture the semantic and grammatical relationships between words. Because raw text data can be obtained in many ways, in some cases, the generated vectors need to be further optimized or adjusted to better suit specific tasks. Supervised learning techniques such as linear regression are used to fine-tune the vector representation and store the encoded text vectors in a database or file.
[0033] The specific algorithm used is as follows: The continuous bag of words (CBOW) model is used to predict the target word based on the context words.
[0034] Please refer to Figure 2 , the continuous bag-of-words model includes the embeddings layer marked in blue and the linear layer marked in orange.
[0035] The embeddings layer converts the input context words into a context word vector and then calculates the average value of these context word vectors to represent the vector of the entire context.
[0036] The linear layer takes this vector representing the entire context and converts it into an output vector with the same dimensions as the vocabulary. A softmax function is then used to convert this output vector into a probability distribution representing the probability of each word being the target word. The word with the highest probability is the prediction of the continuous bag-of-words model.
[0037] Specifically, the calculation of the embeddings layer is as follows: The average value of the input context words and the W weight calculation are used. The word embedding core calculation [1,V]x[V,N]=[1,N], [1,V] is the input dimension, [V,N] is the weight matrix, and [1,N] is the output dimension. It represents the continuous vector representation of the input word after passing through the embedding layer, and obtains the intermediate vector h; formula:
[0038] Where: C is the total number of input context words, W is a weight matrix, x1,x2,...,xC are the symbolic representations of the input context words, w1,w2,...,wC are the context words, is the input vector of the context word wj, 1≤j≤C; The linear layer is calculated as follows: Set up an N×V weight matrix v'=v_ij: formula: ; The output layer is connected to softmax: to obtain the posterior probability formula of each context word:
[0039] in, is the posterior probability of the context word, yj is the probability distribution of the predicted word, u j The output for the target location is an unnormalized score (logits), usually calculated by the model's hidden layer.
[0040] To maximize the probability:
[0041] The probability of exp (output at the target position) / exp (sum of outputs at all positions) is maximized. The target is abbreviated as E. The maximization problem will take the - sign and become a minimization problem (common loss optimization is minimum).
[0042] The feature extraction coding is performed using the LLM model, such as Figure 4 As shown, the following steps are included: S31: First, data preparation is performed to collect text data related to the task. The text data includes user representations and item representations. Preferably, the user representations include user behavior, comments, and likes. The item representations include news headlines, summaries, and category information.
[0043] S32, select the language model BERT algorithm; because it is embedded in the semantic discrimination model for training and inference. BERT is selected because the size of the language model will not be too large when the real-time requirements are relatively high and there are massive training samples.
[0044] S33, passing the preprocessed text data as input to the LLM model, performing position encoding on the text data or adding special tags to provide additional context information; S34, the LLM model uses Word2Vec through the embedding layer to convert the input text data into a high-dimensional vector space, mapping each word or token to a vector; At step S35, the vector is processed by a multi-layer Transformer encoder, which outputs an encoded text vector. The Transformer encoder uses a self-attention mechanism to model different positions in the sequence and capture contextual relationships. Each encoder layer outputs a processed vector representation. To obtain a fixed-length feature vector, the Transformer encoder output is average pooled.
[0045] Finally, we perform feature selection, dimensionality reduction, or normalization on the user behavior representation and item representation to improve the quality and effectiveness of the features. The features encoded by the LLM model are applied to the sentiment analysis system.
[0046] The LLM model performs feature encoding to expand the text features of the sentiment analysis model Focus on the following two aspects: 1. Enhance the representation of text features (user representation, item representation, popularity representation), 2. Improve the cross-scene capabilities based on ID features.
[0047] User representation: A language model is used to represent user features. User behavior, comments, likes, and other information are used to generate topics and regions of interest, which are then encoded using a BERT-like structure. The encoder inputs the user's original ID embedding and the embedding of the current recommendation domain. These two components, combined with the encoding of the user's comments, form a personalized representation of the user, which is then sent to downstream sentiment analysis tasks.
[0048] Heat Characterization: Please refer to Figure 5 Using a language model to represent sentiment text features, the sentiment text description is encoded using a BERT-like structure to obtain the encoding of the solution text information. After a pre-training phase, two contrastive learning tasks are constructed to incorporate user-solution sequence information into the sentiment text heat text representation.
[0049] The goal of cross-domain recommendation is achieved by pre-training sequence models based on text information.
[0050] Please refer to Figure 6This is a roadmap for a recommendation system that integrates all modules of the sentiment analysis system process (retrieval, ranking, user profiling, and user simulation) based on the LLM. This framework uses a large language model as a process for conversational recommendation. The core component is the Dialog Manager, which uses a large language model to call other modules. This might include a ranker, or an LLM to construct a user simulator or other user profiling. Other modules may or may not use the large language model. Its job is to construct this process and framework, using the large language model as the core scheduler to solve complex conversational recommendation tasks. S4, knowledge base adaptation: Based on the characteristics and requirements of the sentiment value analysis system, a structured knowledge base is constructed. The knowledge base includes a number of pieces of knowledge that are compatible with the text vectors. Knowledge is extracted from the knowledge base and adapted to the text vectors. This knowledge exists in different forms, such as entities, relationships, and attributes. After extraction, this knowledge is converted into vectors or matrices that are compatible with the text vectors. The extracted and represented knowledge is adapted to the text vectors. Similarity calculation, mapping, or transformation in vector space is performed to ensure that the text vectors accurately reflect the relevant information in the knowledge base. After completing the initial adaptation, the adaptation results need to be optimized and adjusted. The text vector generation method, knowledge extraction and representation method, and adaptation algorithm are iterated and improved to improve the accuracy and efficiency of the adaptation. Finally, the similarity between the knowledge and the text vector is evaluated to ensure that it can reflect the relevant information in the knowledge base.
[0051] The knowledge includes various types, such as opinion structuring including four elements (emotional object, emotion, holder, time), object structuring including (emotional object / evaluation object), emotion structuring including (emotional type, emotion polarity / degree, emotion words) and other related elements to support subsequent text vector and knowledge adaptation processes.
[0052] The sentiment value analysis knowledge base includes a multivariate analysis framework: (sentiment object, sentiment, holder, time), (entity type, entity, entity aspect), (sentiment type, sentiment polarity, sentiment word) Figure 3 shown.
[0053] All currently known sentiment analysis tasks are centered around Figure 3The task is to predict the sentiment polarity of a text, assuming that the sentiment of the text can be represented by polarity. It only focuses on the sentiment polarity elements in the tuple and ignores other elements. Conversational emotion recognition refers to predicting the emotions implied by the speaker. The following tuple description can be used to represent the structured emotions of a conversation: Opinion quadruple: (emotional object, emotion, interlocutor, conversation time). Object triple: (entity type, entity, entity aspect). Emotion triple: (emotion type, emotion polarity, emotion word) Vector similarity calculations are used to ensure that text vectors accurately reflect the degree of match between the text vector and the relevant information in the knowledge base. The cosine similarity algorithm is used to determine the similarity between knowledge and text vectors. Specifically, the cosine value of the angle between the two vectors is calculated to evaluate the similarity between the two.
[0054]
[0055] Among them, similarity is the similarity, A i Represents the knowledge information related to the knowledge base, B i Represents a text vector.
[0056] S5, generates a vector mapping to the rating recommendation space, defines the rating recommendation space, clarifies the structure and characteristics of the rating recommendation space, involves determining the rating range, rating dimensions, and the weight relationship between each dimension; uses a deep learning algorithm to build a mapping model from the semantic space to the rating recommendation space, and uses labeled training data to train the mapping model. These labels can be users' actual ratings or preference feedback on the content.
[0057] By continuously optimizing the model's parameters and structure, the model accurately maps semantic vectors to the corresponding rated recommendation space. After training, the mapping model is validated and evaluated. A validation dataset is used to test the model's accuracy and generalization capabilities. Based on the validation results, the model is adjusted and optimized as necessary to improve the accuracy and reliability of the mapping. Once the mapping model passes validation, it is applied to the rated recommendation task.
[0058] The text vector to be recommended is input into the mapping model, which then outputs the corresponding recommendation score vector. This vector can be further used to generate personalized recommendation lists or score predictions. In practice, the performance of the mapping model is continuously monitored, and the model is continuously iterated and optimized based on user feedback and new data. This ensures that the model can adapt to changing user needs and content environments, maintaining the accuracy and timeliness of recommendation results.
[0059] Example 2: According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0060] Figure 7 A schematic block diagram of an example electronic device that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0061] like Figure 7 As shown, the device includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). The RAM can also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. An input / output (I / O) interface is also connected to the bus.
[0062] Many components in a device are connected to the I / O interface, including: input units, such as a keyboard and mouse; output units, such as various types of displays and speakers; storage units, such as magnetic disks and optical disks; and communication units, such as network cards, modems, and wireless communication transceivers. The communication unit allows the device to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks.
[0063] The computing unit can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of computing units include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit performs the various methods and processes described above, such as the large-model-based sentiment value analysis method described in Example 1. For example, in some embodiments, the large-model-based sentiment value analysis method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto a device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the computing unit, one or more steps of the large-model-based sentiment value analysis method described above can be performed. Alternatively, in other embodiments, the computing unit can be configured to perform the large-model-based sentiment value analysis method through any other suitable means (e.g., via firmware).
[0064] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0065] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0066] In the context of this application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0067] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0068] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0069] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0070] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved. This is not limited herein.
[0071] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0072] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A sentiment value analysis method based on a large model, characterized in that: The following steps are involved: S1, collects original text data; S2, preprocessing, segmenting the original text data into words or tokens, marking the relevant parts of speech, and building a vocabulary; S3, feature extraction encoding, uses a pre-trained word embedding model to convert each word or word into a fixed-dimensional text vector, and stores the encoded text vector in a database or file; S4, knowledge base adaptation, constructing a structured knowledge base, the knowledge base including a number of knowledge adapted to the text vector; extracting knowledge from the knowledge base and adapting it to the text vector, and evaluating the similarity between the knowledge and the text vector; S5, generate a vector mapping to the rating recommendation space, define the rating recommendation space, clarify the structure and characteristics of the rating recommendation space, which involves determining the rating range, rating dimensions, and the weight relationship between each dimension; build a mapping model from the semantic space to the rating recommendation space, and use labeled training data to train the mapping model; input the text vector to be recommended into the mapping model, and the mapping model will output the corresponding rating recommendation vector.
2. The sentiment value analysis method based on a large model according to claim 1 is characterized in that: In step S2, a unique integer index is assigned to each word or word-unit to facilitate subsequent encoding.
3. The sentiment value analysis method based on a large model according to claim 1 is characterized in that: In step S3, the text vector is further adjusted and stored in a database or file; Use the continuous bag-of-words model to predict the target word based on the context vocabulary; The continuous bag-of-words model includes an embeddings layer and a linear layer. The embeddings layer converts the input context words into a context word vector and continues to calculate the average of these context word vectors to represent the vector of the entire context. The linear layer receives this vector representing the entire context and converts it into an output vector. The dimension of the output vector is the same as the size of the vocabulary. Then, using the softmax function, the output vector is converted into a probability distribution, which represents the probability of each word being the target word. The word with the highest probability is the prediction result of the continuous bag-of-words model.
4. The sentiment value analysis method based on a large model according to claim 3 is characterized in that: The embeddings layer is calculated as follows: The average value of the input context words and the weight W are calculated to obtain the intermediate vector h; official: Where: C is the total number of input context words, W is a weight matrix, x1,x2,...,xC are the symbolic representations of the input context words, w1,w2,...,wC are the context words, is the input vector of the context word wj, 1≤j≤C; The linear layer is calculated as follows: Set up an N×V weight matrix v'=v_ij: official: ; The output layer is connected to softmax: to obtain the posterior probability formula of each context word: in, is the posterior probability of the context word, yj is the probability distribution of the predicted word, u j The output for the target location is an unnormalized score.
5. The sentiment value analysis method based on a large model according to claim 1 is characterized in that: In step S4, the similarity between the knowledge and text vectors is evaluated by the cosine similarity algorithm; Among them, similarity is the similarity, A i Represents knowledge, B i Represents a text vector.
6. The sentiment value analysis method based on a large model according to claim 1 is characterized in that: In step S3, the feature extraction encoding is performed using the LLM model, including the following steps: S31, collecting text data, wherein the text data includes user representation and item representation; S32, select the language model BERT algorithm; S33, passing the text data as input to the LLM model, position encoding or adding tags to the text data to provide additional context information; S34, the LLM model uses Word2Vec through the embedding layer to convert the input text data into a high-dimensional vector space, mapping each word or token to a vector; S35, the vector is processed by a multi-layer Transformer encoder to output the encoded text vector.
7. The sentiment value analysis method based on a large model according to claim 6 is characterized in that: The user representation includes the user's behavior, comments and likes.
8. The sentiment value analysis method based on a large model according to claim 6 is characterized in that: The article representation includes news title, summary, and category information.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.