Method, device and equipment for constructing entity recognition and sentiment analysis model

By constructing entity recognition and sentiment analysis models, using multi-source network information and pre-trained language models, the problem of insufficient accuracy and generalization capabilities of entity recognition and sentiment analysis in the prior art is solved, and accurate analysis and prediction of entity emotions in network information is achieved.

CN119721041AActive Publication Date: 2025-03-28SHANGHAI MIDU INFORMATION TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510227813.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-03-28
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify relevant entities and their sentiment analysis in the Internet, especially when processing complex and unstructured network information, the recognition accuracy is low and the generalization ability is weak, and the deep emotional dimensions and intensity are not captured.

Method used

By obtaining multi-source network information for different topics, processing is carried out for different stages of each topic, determining the entity name, type and emotion involved, and combining this information into sample data, traversing each stage of each topic, forming a data set. Based on this data set and preset prompt template, a pre-trained language model is trained to obtain the entity recognition and sentiment analysis model.

Benefits of technology

It realizes accurate identification of entities in network information and multi-dimensional fine granularity sentiment analysis, which can distinguish the emotional states of different entities, meets the quantification, accuracy and granularity needs of entity sentiment analysis, and can be used for emotional prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721041A_ABST
    Figure CN119721041A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and equipment for constructing an entity recognition and sentiment analysis model. The method comprises the following steps: acquiring multi-source network information of different themes, processing each theme, and determining first network information corresponding to different stages of the themes; based on the first network information corresponding to different stages of each theme, determining related entity names and types and entity emotions, forming sample data by the first network information, the entity names and types and the entity emotions, traversing each stage of each theme, and taking a plurality of obtained sample data as a first data set; and based on the first data set and a first preset prompt template, training the pre-training language model, and verifying the trained pre-training language model to obtain an entity recognition and sentiment analysis model. Through the method, a model can be constructed to identify different entities involved in a certain topic network information, and multi-dimensional fine granularity analysis is performed on entity emotion at the current stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet data processing technology, and in particular to a technology for building entity recognition and sentiment analysis models. Background Art

[0002] In the era of Internet information explosion, the massive amount of online information contains rich user emotional data, which is of great reference value for governments, enterprises, media and other parties to understand public sentiment, policy effects, market trends, etc.

[0003] In the prior art, traditional sentiment analysis methods based on rules, dictionaries or shallow machine learning often face problems such as low recognition accuracy, weak generalization ability, and inability to capture deep emotional dimensions and intensity when processing complex and unstructured network information. In particular, network information on the same subject (such as an event / topic / phenomenon) usually involves multiple entities, while traditional methods often do not distinguish between entities and can only analyze network information as a whole. The analysis results obtained cannot distinguish the emotional states of different entities, and it is difficult to meet actual needs in terms of quantification, accuracy and granularity of entity sentiment analysis.

[0004] Therefore, how to identify relevant entities and analyze entity sentiment based on network information obtained from the Internet has become an urgent problem to be solved. Summary of the invention

[0005] The purpose of this application is to provide a method, device and equipment for building an entity recognition and sentiment analysis model, so as to at least partially solve the technical problem in the prior art that it is difficult to identify relevant entities and their sentiment analysis based on network information.

[0006] According to one aspect of the present application, a method for constructing an entity recognition and sentiment analysis model is provided, wherein the method comprises: Acquire multi-source network information of different topics, and for each topic, process the multi-source network information according to different stages of the topic to determine first network information corresponding to the different stages of the topic; Based on the first network information corresponding to different stages of each topic, determine the entity name and type involved, and the sentiment of the entity, and combine the first network information with the entity name and type, and the sentiment of the entity to form a sample data, traverse each stage of each topic, and use the obtained sample data as the first data set; Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the trained pre-trained language model is verified to obtain an entity recognition and sentiment analysis model.

[0007] Optionally, the method further comprises: Based on the first network information corresponding to the different stages of each topic, determine the corresponding key progress type; Inputting the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model to obtain entity recognition and sentiment analysis results of the first network information, and using the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; The second network information, the stage, and the key progress type are combined into a sample data, and each stage of each topic is traversed to obtain a plurality of sample data as a second data set; Based on the second data set and the second preset prompt template, the entity recognition and sentiment analysis model is trained, and the trained entity recognition and sentiment analysis model is verified to obtain an entity sentiment prediction model.

[0008] Optionally, the step of training a pre-trained language model based on the first data set and the first preset prompt template, and verifying the trained pre-trained language model to obtain an entity recognition and sentiment analysis model includes: Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the trained pre-trained language model is verified to obtain multiple entity recognition and sentiment analysis models; The step of inputting the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model to obtain entity recognition and sentiment analysis results of the first network information, and using the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic includes: Inputting the first network information corresponding to different stages of each topic into each entity recognition and sentiment analysis model respectively, to obtain a plurality of entity recognition and sentiment analysis results of the first network information; Determine a final entity recognition and sentiment analysis result of the first network information based on the plurality of entity recognition and sentiment analysis results of the first network information; The first network information and the final entity recognition and sentiment analysis results corresponding thereto are used as the second network information corresponding to the stage of the topic; The method of training the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verifying the trained entity recognition and sentiment analysis model to obtain the entity sentiment prediction model includes: Based on the second data set and the second preset prompt template, one entity recognition and sentiment analysis model among the multiple entity recognition and sentiment analysis models is trained, and the trained entity recognition and sentiment analysis model is verified to obtain an entity sentiment prediction model.

[0009] Optionally, the determining the final entity recognition and sentiment analysis result of the first network information includes: The entity recognition and sentiment analysis results of the plurality of the first network information are processed by using a voting mechanism to determine a final entity recognition and sentiment analysis result of the first network information.

[0010] Optionally, the method further comprises: The acquired network information to be predicted is input into the entity sentiment prediction model to output the entity, the stage, the key progress type, the sentiment analysis result of the entity and the sentiment prediction result of the entity in the next stage corresponding to the identified network information to be predicted.

[0011] Optionally, the method further comprises: The output of the entity sentiment prediction model is processed into data structure to save and / or visually display the output after data structure.

[0012] According to another aspect of the present application, a device for constructing an entity recognition and sentiment analysis model is provided, wherein the device comprises: The first module is used to obtain multi-source network information of different topics, and for each topic, according to different stages of the topic, process the multi-source network information to determine the first network information corresponding to the different stages of the topic; The second module is used to determine the entity name and type involved and the emotion of the entity based on the first network information corresponding to the different stages of each topic, and to form a sample data with the first network information, the entity name and type, and the emotion of the entity, and traverse each stage of each topic to obtain a plurality of sample data as the first data set; The third module is used to train a pre-trained language model based on the first data set and the first preset prompt template, and verify the trained pre-trained language model to obtain an entity recognition and sentiment analysis model.

[0013] Optionally, the device further comprises: The fourth module is used to determine the corresponding key progress type based on the first network information corresponding to the different stages of each topic; A fifth module is used to input the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model, obtain the entity recognition and sentiment analysis results of the first network information, and use the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; A sixth module is used to combine the second network information, the stage, and the key progress type into a sample data, traverse each stage of each topic, and use the obtained sample data as a second data set; The seventh module is used to train the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verify the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model.

[0014] Optionally, the device further comprises: The eighth module is used to input the acquired network information to be predicted into the entity sentiment prediction model to output the entity, stage, key progress type, sentiment analysis result of the entity and sentiment prediction result of the entity in the next stage corresponding to the identified network information to be predicted.

[0015] Optionally, the device further comprises: The ninth module is used to process the output of the entity emotion prediction model into data structure so as to save and / or visually display the output after data structure.

[0016] Compared with the prior art, the present application provides a method, device and equipment for constructing an entity recognition and sentiment analysis model. The method includes: obtaining multi-source network information of different topics, and for each topic, processing the multi-source network information according to the different stages of the topic, and determining the first network information corresponding to the different stages of the topic; based on the first network information corresponding to the different stages of each topic, determining the entity name and type involved, and the sentiment of the entity, and forming a sample data with the first network information, the entity name and type, and the sentiment of the entity, traversing each stage of each topic, and taking the obtained several sample data as the first data set; based on the first data set and the first preset prompt template, training a pre-trained language model, and verifying the trained pre-trained language model to obtain an entity recognition and sentiment analysis model. Furthermore, the method also includes: determining the corresponding key progress type based on the first network information corresponding to the different stages of each topic; inputting the first network information corresponding to the different stages of each topic into the entity recognition and sentiment analysis model to obtain the entity recognition and sentiment analysis results of the first network information, and using the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; forming a sample data with the second network information, the stage, and the key progress type, traversing each stage of each topic, and using the obtained several sample data as the second data set; based on the second data set and the second preset prompt template, training the entity recognition and sentiment analysis model, and verifying the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model. Through this method, a model can be constructed to identify different entities involved in the network information of a certain topic, and to perform multi-dimensional fine-grained analysis of the entity sentiment of the current stage. A model can also be constructed to predict the entity sentiment of the next stage in combination with the relevant key progress type. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A schematic diagram of a method flow for constructing an entity recognition and sentiment analysis model according to one aspect of the present application is shown; Figure 2 A schematic diagram of a device for constructing an entity recognition and sentiment analysis model according to another aspect of the present application is shown; The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0018] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0019] In a typical configuration of each embodiment of the present application, each device, each trusted party of the system and / or each module of the apparatus may include one or more processors (CPU), input / output interface, network interface and memory.

[0020] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0021] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0022] The present application provides a method, device and equipment for constructing an entity recognition and sentiment analysis model. A first data set and a preset first prompt template are constructed, and the existing pre-trained large language model is fine-tuned to obtain an entity recognition and sentiment analysis model, which is used for entity recognition and sentiment analysis tasks of network information, and identifies entity recognition corresponding to network information, as well as multi-dimensional fine-grained sentiment analysis. A second data set can also be constructed based on the first data set and the entity recognition and sentiment analysis model, and the entity recognition and sentiment analysis model can be fine-tuned based on the constructed second data set and the preset second prompt template to obtain an entity sentiment prediction model, which can be used to perform multi-dimensional fine-grained sentiment prediction on the next stage of the sentiment of the entity corresponding to the real-time network information. The output sentiment analysis results and sentiment prediction results can also be displayed visually.

[0023] In order to further illustrate the technical means adopted by the present application and the effects achieved, the technical solution of the present application is clearly and completely described below in combination with the accompanying drawings and preferred embodiments.

[0024] Figure 1A schematic flow chart of a method for constructing an entity recognition and sentiment analysis model according to one aspect of the present application is shown, wherein the method of one embodiment includes: S101: acquiring multi-source network information of different topics, and for each topic, processing the multi-source network information according to different stages of the topic, to determine first network information corresponding to the different stages of the topic; S102: based on the first network information corresponding to the different stages of each topic, determine the entity name and type involved, and the sentiment of the entity, and combine the first network information with the entity name and type, and the sentiment of the entity to form a sample data, traverse each stage of each topic, and use the obtained sample data as the first data set; S103 trains a pre-trained language model based on the first data set and the first preset prompt template, and verifies the trained pre-trained language model to obtain an entity recognition and sentiment analysis model.

[0025] In the present application, each method embodiment / optional embodiment can be implemented or executed by device 100, wherein device 100 is a computer device with corresponding software and hardware environment. The computer device includes but is not limited to a personal computer, a laptop computer, an industrial computer, a server, a network host, a single network server or a network server cluster. Here, the computer device is only an example, and other existing or future devices and / or resource platforms that may appear should also be included in the scope of protection of the present application if they are applicable to the present application, and are hereby included by reference.

[0026] In this embodiment, in step S101, the device 100 may obtain multi-source network information of different topics, and for each topic, process the multi-source network information according to different stages of the topic to determine first network information corresponding to the different stages of the topic.

[0027] In particular, multi-source network information of different topics can be collected from the Internet for historical topics. In particular, different topics can include representative events, topics or social phenomena in different fields / industries to cover entity types such as enterprises, social institutions, brands, people, industries, public policies, laws and regulations, and social phenomena. Multi-source network information of related topics can be collected from the Internet based on methods such as combining keywords, such as multi-source network information related to topics such as corporate mergers and acquisitions, brand new product releases, public policy releases, and social hot events. In particular, the sources of network information can include search websites, news websites, social media platforms, forums, blogs, etc. In particular, the network information collected from different sources on the Internet includes text information, and may also include multimedia information such as pictures and videos. If it is multimedia information, it must be converted into text information before it can be used for subsequent screening. For each topic, according to the different stages of the topic, the first network information corresponding to the different stages of the topic is screened out from the collected multi-source network information, wherein the first network information is text information that has been quantized. On the Internet, the life cycle of a topic can usually be divided into multiple different stages, which may include a latent period, a rising period, an outbreak period, and a decline period. Some topics may also include a rebound period. Among them, each stage corresponds to a first network information, and each first network information may include basic information of a stage related to the theme and main comment information, wherein the basic information may include: theme name, content of major media reports in this stage, etc., wherein the content of major media reports includes key progress names and key progress content related to the theme, and the key progress type, etc. can be determined based on the basic information.

[0028] Continuing with this embodiment, in step S102, the device 100 can determine the entity name and type involved, and the emotion of the entity based on the first network information corresponding to the different stages of each topic, and combine the first network information with the entity name and type, and the emotion of the entity to form a sample data, traverse each stage of each topic, and use the obtained several sample data as the first data set.

[0029] Among them, through the device 100, according to the first network information corresponding to the different stages of each topic, several entity names and types involved in the first network information, as well as the multi-dimensional fine-grained emotions of each entity can be determined, which may include the entity's emotional polarity, emotional dimension and emotional intensity. Among them, emotional polarity can be divided into three categories: positive, neutral and negative; emotional dimension can be divided into seven categories: joy, surprise, fear, sadness, disgust, anger and neutral; emotional intensity can be divided into a five-level scale (strong, relatively strong, medium, relatively weak, weak). And the determined several entity names and types, as well as the multi-dimensional emotions of each entity, together with the first network information, form a sample data. Traverse each network information corresponding to each stage of each topic determined in step S101, and use the obtained several sample data as the first data set.

[0030] Continuing with this embodiment, in step S103, the device 100 may train a pre-trained language model based on the first data set and the first preset prompt template, and verify the trained pre-trained language model to obtain an entity recognition and sentiment analysis model.

[0031] Among them, given that the language model that has been pre-trained on a large scale without supervision has the ability of context understanding, entity recognition and sentiment analysis, the pre-trained language model can be fine-tuned in combination with specific tasks in actual application scenarios. In this application, based on the pre-trained language model, prompt templates can be designed according to the fine-tuning strategy for the entity recognition and sentiment analysis tasks of this application, and supervised training can be performed on the selected pre-trained language model to further improve the performance of the model on specific tasks.

[0032] Among them, an existing pre-trained language model can be selected as the model to be fine-tuned, for example, an existing pre-trained language model such as Wenxin Yiyan, Tongyi Qianwen, T5, Shusheng Puyu, etc. can be selected. According to the task requirements of entity recognition and sentiment analysis of this application, a first preset prompt template can be designed to guide the selected pre-trained language model to complete the entity recognition and sentiment analysis tasks by inserting prompt words and / or constructing specific sentences. An exemplary first preset prompt template is as follows: Prompt: “Task background: As a public opinion analyst, you need to conduct an in-depth analysis of online public opinion related to the event. Based on the basic information and related comments of the topic provided, you need to identify the main entities involved in the topic, determine the entity type, and describe the sentiment polarity, dimension, and intensity of each entity contained therein.

[0033] Task description: Emotion polarity is divided into three categories: positive, negative, and neutral. Emotional dimensions are divided into seven categories: joy, surprise, fear, sadness, disgust, anger, and neutral. Emotional intensity is analyzed using a five-level scale.

[0034] Input information: topic name and its network information (basic information and comments), identify the main entities of network information at the current stage and analyze the corresponding emotions.

[0035] Output results: According to "Entity 1 name (entity type) - emotion polarity, emotion dimension, emotion intensity; Entity 2 name (entity type) - emotion polarity, emotion dimension, emotion intensity; Entity 3 name (entity type) - emotion polarity, emotion dimension, emotion intensity..." The first data set may be divided into a first training data set and a first verification data set, and the first training data set and a first preset prompt template are used to perform fine-tuning training on the selected model to be fine-tuned.

[0036] Before fine-tuning training, first, the cross entropy loss function can be selected to measure the training effect. The calculation of the cross entropy loss function can be used as follows (1):

[0037] Where P is the model input, X is the model output, It represents the probability distribution of output X when input P is given and X is the true value, which can be obtained according to formula (2): (2) Where i represents the i-th output in X, for The previous output.

[0038] Secondly, in the fine-tuning training of the pre-trained language model, hyperparameters such as training batch size, number of training iterations, maximum sequence length, and learning rate have a direct impact on the effect and efficiency of model training. You can set reasonable hyperparameters such as batch size, number of iterations, maximum sequence length, learning rate, early stopping conditions, and choose a suitable optimizer, such as the AdamW optimizer based on weight decay. An exemplary partial hyperparameter configuration is shown in Table 1.

[0039] Table 1

[0040] Among them, after each fine-tuning training of the selected model to be fine-tuned, the trained model to be fine-tuned can be verified using the first verification data set, and at least one of the indicators such as accuracy, precision, recall rate, F1 score, etc. can be used for evaluation in combination with the needs of the actual application scenario. If the index value of the trained model to be fine-tuned for the first verification data set meets the preset threshold, the trained model to be fine-tuned meets the requirements and can be used as the entity recognition and sentiment analysis model of the present application. If the index value of the trained model to be fine-tuned for the first verification data set does not meet the preset threshold, the verification results can be combined to adjust the relevant hyperparameters, fine-tuning strategies (i.e., modify the first preset indication template), and / or improve the training process (for example, add DPO (Direct Preference Optimization, direct preference optimization) learning, interactive learning, etc.), and continuously iterate training and verification until the verification results of the trained model to be fine-tuned meet the requirements, thereby obtaining the entity recognition and sentiment analysis model of the present application.

[0041] Optionally, the method for building an entity recognition and sentiment analysis model further includes: S104 determines a corresponding key progress type based on the first network information corresponding to the different stages of each topic; S105: inputting the first network information corresponding to the different stages of each topic into the entity recognition and sentiment analysis model to obtain the entity recognition and sentiment analysis results of the first network information, and using the first network information and the corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; S106: the second network information, the stage, and the key progress type are combined into a sample data, and each stage of each topic is traversed to obtain a plurality of sample data as a second data set; S107 trains the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verifies the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model.

[0042] In step S104, the device 100 may also determine the key progress type corresponding to the first network information according to the first network information corresponding to the different stages of each topic. The key progress type may be preset and may include exposure, news release, official statement, in-depth investigation, responsibility determination, legal proceedings and judgment, handling and accountability, victim compensation, policy changes, comprehensive rectification, etc.

[0043] It is also possible to reselect a different historical topic from the aforementioned step S101, collect multi-source network information of each topic from the Internet, and then for each topic, according to different stages of the topic, filter out first network information corresponding to different stages of the topic from the collected multi-source network information. Then determine the key progress type corresponding to the first network information.

[0044] Continuing with this optional embodiment, in step S105, the device 100 may input the first network information corresponding to the different stages of each topic into the entity recognition and sentiment analysis model obtained in step S103, obtain the entity recognition and sentiment analysis results of the first network information, and use the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic.

[0045] Among them, the device 100 can input the first network information corresponding to the different stages of each topic into the entity recognition and sentiment analysis model obtained in the above step S103, and output the entity recognition and sentiment analysis results related to the first network information with reference to the format in the first preset prompt template, that is, the main entities and their types, as well as the sentiment polarity, sentiment dimension and sentiment intensity of each entity.

[0046] The entity recognition and sentiment analysis model may output entity recognition and sentiment analysis results according to a preset structure and store them in a structured data form, such as CSV, JSON or a database, for subsequent use. The structured data form may be that each row of data represents the analysis result of an entity corresponding to the stage of a topic, and may include data corresponding to fields such as entity name, entity type, sentiment polarity, sentiment dimension, and sentiment intensity.

[0047] The first network information and its corresponding entity recognition and sentiment analysis results are also used as the second network information corresponding to the stage of the topic, wherein the second network information may include basic information related to the topic and main comment information, several entity names and types corresponding to the stage of the topic, the sentiment of each entity (polarity, dimension and intensity), etc.

[0048] Continuing with this optional embodiment, in step S106, the device 100 may combine the second network information, the stage, and the key progress type into a sample data, traverse each stage of each topic, and obtain several sample data as the second data set.

[0049] Among them, through the device 100, the second network information corresponding to the stage of each topic, the stage, and the key progress type can also be combined into a sample data. Each stage of each topic is traversed, and steps S104 to S106 are referred to to obtain a plurality of sample data, and the obtained plurality of sample data are used as the second data set.

[0050] Continuing in this optional embodiment, in step S107, the device 100 can train the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verify the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model.

[0051] Among them, the entity recognition and sentiment analysis model obtained in step S103 can be used as the basic model. For the sentiment prediction task of this application, the basic model can be supervised trained according to the second preset prompt template designed by the fine-tuning strategy to improve the performance of the model in the sentiment prediction task.

[0052] Among them, according to the task requirements of the emotion prediction of this application, a second preset prompt template can be designed to guide the model to focus on the feature recognition and trigger factor analysis of emotion changes when generating or completing text, so that the trained basic model can complete entity recognition and emotion analysis and prediction tasks. An exemplary second preset prompt template is as follows: Prompt: “Task background: As a public opinion analyst, you need to conduct in-depth analysis and prediction of topic-related online public opinion. You need to judge the current stage of public opinion based on the basic information and comments of a given topic, and predict the main entities and their types, sentiment polarity, sentiment dimension, and sentiment intensity of the network information involved after a key development in the next stage.

[0053] Task description: Based on the given topic name and its network information (basic information and comments), analyze the current stage and current progress, identify the main entities involved in the topic and their types. Consider the impact of public opinion development and possible progress on sentiment, and analyze the factors that may cause sentiment changes. Predict the possible progress of the given topic in the next stage, and further predict the sentiment polarity, dimension and intensity of related entities.

[0054] Input information: topic name and its network information (basic information and comments). Predict the main entities of network information after a key development in the next stage and analyze the corresponding sentiment.

[0055] Output result: Prediction result format: "In the next stage, if **progress occurs, entity 1 emotional polarity, dimension and intensity, entity 2 emotional polarity, dimension and intensity, entity 3 emotional polarity, dimension and intensity." " The second data set may be divided into a second training data set and a second verification data set, and the second training data set and the second preset prompt template are used to perform fine-tuning training on the basic model.

[0056] Among them, the same cross entropy loss function as mentioned above can be selected to measure the training effect. In the fine-tuning training of the basic model, the relevant hyperparameters, optimizers, etc. can be set and selected in combination with the needs of the actual application scenario, and can also refer to the relevant settings and selections in the above step S103.

[0057] Among them, after each fine-tuning training of the basic model, the second verification data set can be used to verify the trained basic model, and at least one of the indicators such as accuracy, precision, recall rate, F1 score, etc. can be used for evaluation in combination with the needs of the actual application scenario. If the indicator value of the trained basic model for the second verification data set meets the preset threshold, the trained basic model meets the requirements and can be used as the entity emotion prediction model of the present application. If the indicator value of the trained basic model for the second verification data set does not meet the preset threshold, the verification results can be combined to adjust the relevant hyperparameters, fine-tune the strategy (i.e., modify the second preset indication template), and / or improve the training process (for example, add DPO learning, interactive learning, etc.), and continuously iterate training and verification until the verification result of the trained basic model meets the requirements, thereby obtaining the entity emotion prediction model of the present application.

[0058] The entity sentiment prediction model can be deployed according to the needs of actual application scenarios, such as being deployed to public opinion monitoring systems and social media analysis platforms. It can collect real-time network information related to hot topics from the Internet, output the entity name and type corresponding to the current stage of the topic, and the sentiment analysis results of each entity, including the sentiment polarity, sentiment dimension and sentiment intensity of each entity, and can predict the sentiment of each entity in the corresponding stage after entering a certain key progress. Among them, the actual network information of the corresponding stage of the topic can also be collected regularly to determine the corresponding actual entity and its type, as well as the sentiment, and compare it with the model output results to regularly evaluate the prediction effect of the model. In addition, new sample data can be sorted out based on the actual network information to supplement the data set, and the model can be maintained and updated to further improve the performance of the model.

[0059] In order to improve the accuracy of the sentiment analysis results of entities, multiple entity recognition and sentiment analysis models can be trained, and the same first network information can be input into each entity recognition and sentiment analysis model to output multiple sentiment analysis results. Then, the final sentiment analysis result corresponding to the network information is determined based on the multiple sentiment analysis results, thereby obtaining the corresponding final entity recognition and sentiment analysis result. The first network information and its corresponding final entity recognition and sentiment analysis result are used as the second network information corresponding to the stage of the topic to construct the second data set.

[0060] Optionally, the step S103 includes: Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the trained pre-trained language model is verified to obtain multiple entity recognition and sentiment analysis models; Wherein, the step S105 includes: Inputting the first network information corresponding to different stages of each topic into each entity recognition and sentiment analysis model respectively, to obtain a plurality of entity recognition and sentiment analysis results of the first network information; Determine a final entity recognition and sentiment analysis result of the first network information based on the plurality of entity recognition and sentiment analysis results of the first network information; The first network information and the final entity recognition and sentiment analysis results corresponding thereto are used as the second network information corresponding to the stage of the topic; Wherein, the step S107 includes: Based on the second data set and the second preset prompt template, one entity recognition and sentiment analysis model among the multiple entity recognition and sentiment analysis models is trained, and the trained entity recognition and sentiment analysis model is verified to obtain an entity sentiment prediction model.

[0061] Among them, in step S103, the device 100 can also divide the first data set into several training data sets and corresponding several verification data sets according to the entity type, and train the selected pre-trained language model in combination with the first preset prompt template, and verify the trained pre-trained language model to obtain multiple entity recognition and sentiment analysis models. Among them, the same pre-trained language model can be selected, and different training data sets and their corresponding verification data sets can be used for training and verification. Pre-trained language models based on different algorithms or architectures can also be selected, such as the BERT model and RoBERTa model based on Transformer. Training data sets and corresponding verification data sets of different entity types are used to train and verify different pre-trained language models. The entity recognition and sentiment analysis models obtained in this way will focus on or be better at analyzing the emotions corresponding to a certain type of entity. In order to obtain multiple entity recognition and sentiment analysis models that are differentiated but complementary, such as entity recognition and sentiment analysis models that focus on different entity types such as enterprises and institutions, or entity recognition and sentiment analysis models that are good at capturing syntactic features, semantic features or context dependencies.

[0062] For each pre-trained language model, the same cross entropy loss function as described above can be selected to measure the training effect. In the fine-tuning training of each pre-trained language model, the relevant hyperparameters, optimizers, etc. can be set and selected in combination with the needs of the actual application scenario, and can also refer to the relevant settings and selections in the aforementioned step S103.

[0063] Among them, several entity recognition and sentiment analysis models with complementary characteristics can be selected. In step S105, the device 100 can first input the first network information corresponding to different stages of each topic into each entity recognition and sentiment analysis model respectively, and each entity recognition and sentiment analysis model outputs in a format referenced in the first preset prompt template, thereby obtaining the entity recognition and sentiment analysis results of the first network information. Each entity recognition and sentiment analysis result includes the main entities and their types related to the first network information, as well as the sentiment polarity, sentiment dimension and sentiment intensity of each entity, which can be stored in a data structured manner, for example, in the form of CSV, JSON or database, wherein the data structured form can be that each row of data represents the analysis result of an entity corresponding to the stage of a topic, and can include data corresponding to fields such as entity name, entity type, sentiment polarity, sentiment dimension, and sentiment intensity. Then, the sentiment analysis results (sentiment polarity, sentiment dimension and sentiment intensity) of the same entity in different entity recognition and sentiment analysis results corresponding to the first network information of the same topic at a certain stage can be summarized and processed to determine the final sentiment analysis result of the entity. By traversing each entity corresponding to the first network information at this stage of the topic, the final entity recognition and sentiment analysis results corresponding to the first network information at this stage of the topic can be determined. Finally, the first network information and its corresponding final entity recognition and sentiment analysis results are used as the second network information corresponding to the stage of the topic to construct the second data set, where the second network information includes basic information, main comment information, related entity names and types, and sentiment analysis results corresponding to each entity (sentiment polarity, sentiment dimension, and sentiment intensity).

[0064] Among them, one that best meets the needs of the actual application scenario can be selected from multiple entity recognition and sentiment analysis models as the basic model for subsequent fine-tuning training. In step S107, the device 100 can train the basic model according to the second data set and the second preset prompt template, and verify the trained basic model to obtain an entity sentiment prediction model. Among them, the second data set can be divided into a second training data set and a second verification data set, and the second training data set and the second preset prompt template are used to fine-tune the basic model. Among them, the same cross entropy loss function as mentioned above can be selected to measure the training effect. In the fine-tuning training of the basic model, the relevant hyperparameters, optimizers, etc. can be set and selected in combination with the needs of the actual application scenario, and the relevant settings and selections in the above step S103 can also be referred to. Among them, after each fine-tuning training of the basic model, the trained basic model can be verified using the second verification data set, and can be evaluated using at least one of the indicators such as accuracy, precision, recall, F1 score, etc. in combination with the needs of the actual application scenario. If the indicator value of the trained basic model for the second verification data set meets the preset threshold, the trained basic model meets the requirements and can be used as the entity sentiment prediction model of the present application. If the index value of the trained basic model for the second validation data set does not meet the preset threshold, the verification results can be combined to adjust the relevant hyperparameters, fine-tune the strategy (i.e., modify the second preset indication template), and / or improve the training process (e.g., add DPO learning, interactive learning, etc.), and continuously iterate the training and verification until the verification results of the trained basic model meet the requirements, and obtain the entity sentiment prediction model. The entity sentiment prediction model can be deployed according to the needs of the actual application scenario, such as deployed to the public opinion monitoring system and social media analysis platform.

[0065] Optionally, based on the entity recognition and sentiment analysis results of the plurality of the first network information, determining the final entity recognition and sentiment analysis result of the first network information includes: The entity recognition and sentiment analysis results of the plurality of the first network information are processed by using a voting mechanism to determine a final entity recognition and sentiment analysis result of the first network information.

[0066] Among them, a voting mechanism can be used to summarize and process the sentiment analysis results (sentiment polarity, sentiment dimension and sentiment intensity) of the same entity in different entity recognition and sentiment analysis results corresponding to the first network information of the same topic at a certain stage. If the sentiment polarity of a certain entity output by the model exceeding a preset number or proportion (for example, more than half) is the same, assuming it is positive, it can be considered that the sentiment polarity of the entity at the stage where the topic is located is positive, and the final sentiment polarity of the entity at the stage where the topic is located can be determined to be positive. The final sentiment dimension and final sentiment intensity of the entity at the stage where the topic is located can be determined in the same processing method, thereby determining the final sentiment analysis result of the entity at the stage where the topic is located. By traversing each entity corresponding to the first network information at this stage of the topic, the final entity recognition and sentiment analysis results corresponding to the first network information at this stage of the topic can be determined, including each related entity identified and its type, and the sentiment analysis results (sentiment polarity, sentiment dimension and sentiment intensity) of each entity.

[0067] Optionally, the method for building an entity recognition and sentiment analysis model further includes: S108 inputs the acquired network information to be predicted into the entity sentiment prediction model to output the identified entity corresponding to the network information to be predicted, the stage it is in, the key progress type, the sentiment analysis result of the entity and the sentiment prediction result of the entity in the next stage.

[0068] Among them, the device 100 can collect real-time multi-source network information of relevant topics from the Internet, determine the network information to be predicted of the topic, input the deployed entity emotion prediction model, and output the entity names and types, stages, and emotion analysis results (emotion polarity, emotion dimension, and emotion intensity) of several entities corresponding to the network information to be predicted, and the key progress information can also be input into the deployed entity emotion prediction model, and the entity emotion prediction model can be used to output the entity emotions (emotion polarity, emotion dimension, and emotion intensity) of the topic predicted by the entity emotion prediction model after the key progress occurs.

[0069] Optionally, the method for building an entity recognition and sentiment analysis model further includes: S109 performs data structuring on the output of the entity emotion prediction model to save and / or visually display the data-structured output.

[0070] In order to facilitate the subsequent use of the output of the entity emotion prediction model, the output of the entity emotion prediction model can be processed into a data structure for storage, to improve data storage efficiency, and / or visualized to improve data readability. It can also facilitate users of the output to take targeted measures based on the output.

[0071] Among them, network information of related topics can also be collected regularly to determine the corresponding actual entities and their types, as well as emotions, and compared with the model output results corresponding to the network information to regularly evaluate the prediction effect of the model. It can also be sorted and marked as new sample data to add to the data set, maintain and update the model, and further improve the model's entity recognition and sentiment analysis and prediction performance.

[0072] Figure 2 A schematic diagram of a device for constructing an entity recognition and sentiment analysis model according to another aspect of the present application is shown, wherein the device in one embodiment includes: The first module 210 is used to obtain multi-source network information of different topics, and for each topic, according to different stages of the topic, process the multi-source network information to determine the first network information corresponding to the different stages of the topic; The second module 220 is used to determine the entity name and type involved, and the emotion of the entity based on the first network information corresponding to the different stages of each topic, and to form a sample data with the first network information, the entity name and type, and the emotion of the entity, and traverse each stage of each topic, and use the obtained sample data as the first data set; The third module 230 is used to train a pre-trained language model based on the first data set and the first preset prompt template, and verify the trained pre-trained language model to obtain an entity recognition and sentiment analysis model.

[0073] In this embodiment, the apparatus is deployed or integrated in a device 100 that executes the aforementioned method embodiment and / or optional embodiment.

[0074] In this embodiment, through the first module 210 of the device, multi-source network information of different topics can be collected from the Internet for historical topics, and for each topic, the collected multi-source network information is processed according to the different stages of the topic, and the first network information corresponding to the different stages of the topic is filtered out.

[0075] Continuing in this embodiment, through the second module 220 of the device, according to the first network information corresponding to the different stages of each topic, several entity names and types involved in the first network information, as well as the multi-dimensional fine-grained emotions of each entity can be determined, which may include the emotional polarity, emotional dimension and emotional intensity of the entity. And the determined several entity names and types, as well as the multi-dimensional emotions of each entity, together with the first network information, form a sample data. Traverse each network information corresponding to each stage of each topic determined by the first module 210, and use the obtained several sample data as the first data set.

[0076] Continuing in this embodiment, through the third module 230 of the device, based on the first data set and the first preset prompt template, the pre-trained language model is trained, and the pre-trained language model after training is verified to obtain an entity recognition and sentiment analysis model. Among them, the existing pre-trained language model can be selected as the model to be fine-tuned, and the cross entropy loss function is selected to measure the training effect. Among them, the first data set can be divided into a first training data set and a first verification data set, and the first training data set and the first preset prompt template are used to fine-tune the selected model to be fine-tuned. After each fine-tuning training of the selected model to be fine-tuned, the first verification data set can be used to verify the trained model to be fine-tuned. If the index value of the trained model to be fine-tuned for the first verification data set meets the preset threshold, then the trained model to be fine-tuned meets the requirements and can be used as the entity recognition and sentiment analysis model of the present application.

[0077] Optionally, the device for building an entity recognition and sentiment analysis model further includes: The fourth module 240 is used to determine the corresponding key progress type based on the first network information corresponding to the different stages of each topic; The fifth module 250 is used to input the first network information corresponding to the different stages of each topic into the entity recognition and sentiment analysis model, obtain the entity recognition and sentiment analysis results of the first network information, and use the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; The sixth module 260 is used to combine the second network information, the stage, and the key progress type into a sample data, traverse each stage of each topic, and use the obtained sample data as a second data set; The seventh module 270 is used to train the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verify the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model.

[0078] In this optional embodiment, the fourth module 240 of the device can also determine the key progress type corresponding to the first network information according to the first network information corresponding to the different stages of each theme. It is also possible to reselect different historical themes from the first module 210, collect multi-source network information of each theme from the Internet, and then for each theme, according to the different stages of the theme, filter out the first network information corresponding to the different stages of the theme from the collected multi-source network information, and then determine the key progress type corresponding to the first network information.

[0079] Continuing in this optional embodiment, through the fifth module 250 of the device, the first network information corresponding to the different stages of each topic can be input into the entity recognition and sentiment analysis model obtained by the above-mentioned third module 230, and the entity recognition and sentiment analysis results related to the first network information are output with reference to the format in the first preset prompt template, that is, the main entities and their types, as well as the sentiment polarity, sentiment dimension and sentiment intensity of each entity, and the first network information and its corresponding entity recognition and sentiment analysis results are also used as the second network information corresponding to the stage of the topic.

[0080] Continuing in this optional embodiment, the sixth module 260 of the device can be used to form a sample data with the second network information corresponding to the stage of each theme, the stage and key progress type corresponding to the theme. Each stage of each theme is traversed, and a plurality of sample data are obtained through the fourth module 240, the fifth module 250 and the sixth module 260, and the obtained plurality of sample data are used as the second data set.

[0081] Continuing in this optional embodiment, the entity recognition and sentiment analysis model obtained by the third module 230 can be used as the basic model, and the seventh module 270 of the device can be used to train the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verify the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model. Among them, the second data set can be divided into a second training data set and a second verification data set, and the second training data set and the second preset prompt template are used to fine-tune the basic model. Among them, the same cross entropy loss function as mentioned above can be selected to measure the training effect. In the fine-tuning training of the basic model, the relevant hyperparameters, optimizers, etc. can be set and selected in combination with the needs of the actual application scenario, and the relevant settings and selections in the third module 230 can also be referred to. Among them, after each fine-tuning training of the basic model, the second verification data set can be used to verify the trained basic model, and at least one of the indicators such as accuracy, precision, recall rate, F1 score, etc. can be used to evaluate in combination with the needs of the actual application scenario. If the index value of the trained basic model for the second verification data set meets the preset threshold, the trained basic model meets the requirements and can be used as the entity sentiment prediction model of the present application.

[0082] Optionally, the device for building an entity recognition and sentiment analysis model further includes: The eighth module 280 is used to input the acquired network information to be predicted into the entity sentiment prediction model to output the entity, stage, key progress type, sentiment analysis result of the entity and sentiment prediction result of the entity in the next stage corresponding to the identified network information to be predicted.

[0083] In this optional embodiment, through the eighth module 280 of the device, real-time multi-source network information of related topics can also be collected from the Internet, the network information to be predicted of the topic can be determined, and the deployed entity emotion prediction model can be input to output the entity names and types, stages, and emotion analysis results (emotion polarity, emotion dimension, and emotion intensity) of several entities corresponding to the network information to be predicted, and the key progress information can also be input into the deployed entity emotion prediction model to output the entity emotions (emotion polarity, emotion dimension, and emotion intensity) of the topic predicted by the entity emotion prediction model after the key progress occurs.

[0084] Optionally, the device for building an entity recognition and sentiment analysis model further includes: The ninth module 290 is used to process the output of the entity emotion prediction model into data structure so as to save and / or visually display the output after data structure.

[0085] In this optional embodiment, in order to facilitate the subsequent use of the output of the entity emotion prediction model, the output of the entity emotion prediction model can be processed into data structure through the ninth module 290 of the device for storage, to improve data storage efficiency, and / or visualize the output to improve data readability. It can also facilitate the user of the output to take targeted measures based on the output.

[0086] In each embodiment and / or optional embodiment of the above-mentioned device, the unmentioned parts in the method steps performed by each module are the same as those in the aforementioned related method embodiments and / or optional embodiments, and will not be repeated here.

[0087] According to another aspect of the present application, a computer-readable medium is provided, wherein the computer-readable medium stores computer-readable instructions, and the computer-readable instructions can be executed by a processor to implement the aforementioned method embodiments.

[0088] It should be noted that each method embodiment and / or optional embodiment in the present application may not strictly limit the order in which each step is performed, as long as each method embodiment and / or optional embodiment can solve the defects existing in the prior art, achieve the purpose of the invention of the present application, and obtain beneficial effects. Each method embodiment and / or optional embodiment in the present application can be implemented in software and / or a combination of software and hardware. The software program involved in the present application can be executed by a processor to implement the steps or functions of the above-mentioned embodiments. Similarly, the software program (including relevant data structures) of the present application can be stored in a computer-readable recording medium.

[0089] In addition, part or all of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction.

[0090] According to another aspect of the present application, a device for building an entity recognition and sentiment analysis model is also provided, the device comprising: a memory for storing computer program instructions and one or more processors for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions of the aforementioned embodiments.

[0091] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software and / or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

Claims

1. A method for constructing an entity recognition and sentiment analysis model, characterized in that: The method comprises: Acquire multi-source network information of different topics, and for each topic, process the multi-source network information according to different stages of the topic to determine first network information corresponding to the different stages of the topic; Based on the first network information corresponding to different stages of each topic, determine the entity name and type involved, and the sentiment of the entity, and combine the first network information with the entity name and type, and the sentiment of the entity to form a sample data, traverse each stage of each topic, and use the obtained sample data as the first data set; Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the trained pre-trained language model is verified to obtain an entity recognition and sentiment analysis model.

2. The method according to claim 1, characterized in that The method further comprises: Based on the first network information corresponding to the different stages of each topic, determine the corresponding key progress type; Inputting the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model to obtain entity recognition and sentiment analysis results of the first network information, and using the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; The second network information, the stage, and the key progress type are combined into a sample data, and each stage of each topic is traversed to obtain a plurality of sample data as a second data set; Based on the second data set and the second preset prompt template, the entity recognition and sentiment analysis model is trained, and the trained entity recognition and sentiment analysis model is verified to obtain an entity sentiment prediction model.

3. The method according to claim 2, characterized in that The method of training a pre-trained language model based on the first data set and the first preset prompt template, and verifying the trained pre-trained language model to obtain an entity recognition and sentiment analysis model includes: Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the trained pre-trained language model is verified to obtain multiple entity recognition and sentiment analysis models; The step of inputting the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model to obtain entity recognition and sentiment analysis results of the first network information, and using the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic includes: Inputting the first network information corresponding to different stages of each topic into each entity recognition and sentiment analysis model respectively, to obtain a plurality of entity recognition and sentiment analysis results of the first network information; Determine a final entity recognition and sentiment analysis result of the first network information based on the plurality of entity recognition and sentiment analysis results of the first network information; The first network information and the final entity recognition and sentiment analysis results corresponding thereto are used as the second network information corresponding to the stage of the topic; The method of training the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verifying the trained entity recognition and sentiment analysis model to obtain the entity sentiment prediction model includes: Based on the second data set and the second preset prompt template, one entity recognition and sentiment analysis model among the multiple entity recognition and sentiment analysis models is trained, and the trained entity recognition and sentiment analysis model is verified to obtain an entity sentiment prediction model.

4. The method according to claim 3, characterized in that Determining the final entity recognition and sentiment analysis result of the first network information includes: The entity recognition and sentiment analysis results of the plurality of the first network information are processed by using a voting mechanism to determine a final entity recognition and sentiment analysis result of the first network information.

5. The method according to claim 3, characterized in that: The method further comprises: The acquired network information to be predicted is input into the entity sentiment prediction model to output the entity, the stage, the key progress type, the sentiment analysis result of the entity and the sentiment prediction result of the entity in the next stage corresponding to the identified network information to be predicted.

6. The method according to claim 5, characterized in that The method further comprises: The output of the entity sentiment prediction model is processed into data structure to save and / or visually display the output after data structure.

7. A device for constructing an entity recognition and sentiment analysis model, characterized in that: The device comprises: The first module is used to obtain multi-source network information of different topics, and for each topic, according to different stages of the topic, process the multi-source network information to determine the first network information corresponding to the different stages of the topic; The second module is used to determine the entity name and type involved and the emotion of the entity based on the first network information corresponding to the different stages of each topic, and to form a sample data with the first network information, the entity name and type, and the emotion of the entity, and traverse each stage of each topic to obtain a plurality of sample data as the first data set; The third module is used to train a pre-trained language model based on the first data set and the first preset prompt template, and verify the trained pre-trained language model to obtain an entity recognition and sentiment analysis model.

8. The device according to claim 7, characterized in that The device also includes: The fourth module is used to determine the corresponding key progress type based on the first network information corresponding to the different stages of each topic; A fifth module is used to input the first network information corresponding to different stages of each topic into the entity recognition and sentiment analysis model, obtain the entity recognition and sentiment analysis results of the first network information, and use the first network information and its corresponding entity recognition and sentiment analysis results as the second network information corresponding to the stage of the topic; A sixth module is used to combine the second network information, the stage, and the key progress type into a sample data, traverse each stage of each topic, and use the obtained sample data as a second data set; The seventh module is used to train the entity recognition and sentiment analysis model based on the second data set and the second preset prompt template, and verify the trained entity recognition and sentiment analysis model to obtain an entity sentiment prediction model.

9. The device according to claim 8, characterized in that The device also includes: The eighth module is used to input the acquired network information to be predicted into the entity sentiment prediction model to output the entity, stage, key progress type, sentiment analysis result of the entity and sentiment prediction result of the entity in the next stage corresponding to the identified network information to be predicted.

10. The device according to claim 9, characterized in that The device also includes: The ninth module is used to process the output of the entity emotion prediction model into data structure so as to save and / or visually display the output after data structure.

11. A computer readable medium, characterized in that Computer readable instructions are stored thereon, and the computer readable instructions are executed by a processor to implement the method according to any one of claims 1 to 6.

12. A device for building an entity recognition and sentiment analysis model, characterized in that: The device comprises: one or more processors; and A memory storing computer readable instructions which, when executed, cause the processor to perform the operations of the method as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Emotion analysis and generation method for news comments

    CN114444481A

  • Task processing method and server

    CN117171325A

  • Method, device and equipment for constructing public opinion event regression prediction model

    CN117828429A

  • Emotion analysis model construction method and device, computer equipment and storage medium

    CN118171102A

  • Chemical network public opinion sentiment analysis method

    CN119446341A