Chemical network public opinion sentiment analysis method
By constructing the chemical knowledge graph and emotional triggering vocabulary of the chemical industry, and using multimodal deep learning model, the problems of professional term understanding and emotional signal capture in network public opinion analysis in the chemical industry are solved, and the accuracy of the public opinion sentiment of the chemical industry network is achieved. analyze.
Patent Information
- Application Number
- CN202411426674.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
AI Technical Summary
In the online public opinion analysis of the chemical industry, it is difficult to accurately understand professional terms and capture the industry-specific emotional signals, resulting in deviations in the analysis results.
By collecting text data related to the chemical industry, building a chemical knowledge graph and emotional triggering vocabulary, combining multimodal deep learning models, integrating chemical knowledge and text emotional characteristics, conducting public sentiment analysis of chemical networks.
It realizes accurate identification and analysis of online public sentiment in the chemical industry, improves the depth and accuracy of emotional analysis, and can keenly capture the emotional tendencies implicitly in the text.
Smart Images

Figure CN119446341A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to network public opinion analysis, and in particular to a method for analyzing sentiment of chemical industry network public opinion. Background Art
[0002] Natural language processing (NLP) and machine learning algorithms are the main tools for online public opinion analysis. They can mine valuable information from massive amounts of text data, identify and analyze sentiment, and capture public opinion dynamics, thereby providing support for corporate decision-making, policy formulation, crisis management, etc. However, when these general technologies are applied to the highly specialized chemical industry, the accuracy of the analysis is significantly reduced.
[0003] The chemical industry involves complex chemical reaction mechanisms, process flow descriptions, material property descriptions and other professional content. General NLP models often cannot accurately distinguish specific concepts. For example, "methanol" and "ethanol" are considered similar chemical substances in daily contexts, but in the chemical industry, their chemical properties and uses are fundamentally different. Another example is process flow descriptions such as "catalytic cracking" and "esterification reaction". Without sufficient industry knowledge support, it is difficult for the model to understand its exact meaning and the chemical logic behind it.
[0004] On the other hand, sentiment analysis relies on sentiment dictionaries, which contain a large number of words related to sentiment tendencies and their polarity scores. However, the chemical industry has its own unique sentiment trigger words, such as "leakage", "explosion", "pollution", etc. These words may not be fully covered in the general sentiment dictionary or their sentiment polarity may not accurately reflect the special meaning in the context of the chemical industry. Therefore, existing sentiment analysis methods often find it difficult to capture the key sentiment signals in the chemical network public opinion, resulting in biased analysis results. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to provide a method for analyzing the sentiment of chemical industry network public opinion with high accuracy.
[0006] Technical solution: The chemical industry network public opinion sentiment analysis method of the present invention comprises:
[0007] (1) Collect text data related to the chemical industry and perform data preprocessing, including data cleaning and formatting, annotate chemical texts using regular expressions or natural language processing tools, and use the pre-trained sentiment analysis model BERT to perform sentiment classification on chemical texts and build a data set;
[0008] (2) Use the trained named entity recognition model NER to identify chemical entities in chemical texts, including chemical substance names, process flow keywords, and chemical reaction descriptions, perform dependency syntax analysis through Stanford Parser, and construct a chemical knowledge graph;
[0009] (3) Combined with the VADER sentiment dictionary, filter and annotate the sentiment trigger words and their sentiment polarity unique to the chemical industry, construct a sentiment trigger word library, associate the sentiment trigger word library with entities in the chemical knowledge graph, and store the association information between the chemical knowledge graph and the sentiment trigger word library in the graph database;
[0010] (4) Design a chemical knowledge encoder GCN, design a sentiment-aware text encoder based on the Transformer architecture, design a fusion layer based on weighted summation, concatenation, gating mechanism or multi-head attention fusion strategy, integrate chemical knowledge and text sentiment features to form a multimodal deep learning model, and use chemistry-related datasets to train the multimodal deep learning model;
[0011] (5) Use the trained multimodal deep learning model to conduct sentiment analysis on chemical industry network public opinion.
[0012] Furthermore, in step (1), chemical industry related text data is obtained through an API interface and / or a web crawler tool.
[0013] Furthermore, in step (1), data cleaning and formatting includes:
[0014] Use Python's pandas library for data processing, including removing HTML tags, unifying text encoding, deduplication, and correcting spelling errors;
[0015] Use SQL libraries to clean data, including handling outliers, filling missing values, and unifying units and metrics;
[0016] Use the NLTK library to perform text preprocessing, including word segmentation, stop word removal, and stemming or lemmatization;
[0017] Use the lemmatizer of the spaCy library to perform word form restoration;
[0018] Use the Word2Vec model of the gensim library to embed text data and convert each word into a fixed-length vector representation;
[0019] Use Python's datetime library to unify date and time formats;
[0020] Design data format checking rules and use regular expressions or data validation libraries to check data format compliance.
[0021] Furthermore, data format checking rules are defined according to the characteristics and requirements of the data.
[0022] Furthermore, in step (1), regular expressions or natural language processing tools are used to classify specific information in the chemical text and annotate its corresponding entity types, including chemical substance names, process flow keywords, and chemical reaction descriptions.
[0023] Furthermore, in step (2), the structured information of chemical reaction paths and process flows is extracted from the results of dependency syntactic analysis, and the extracted chemical reaction paths and process flow information is structured and converted into a standard triple form, thereby establishing a relationship network between entities and constructing a chemical knowledge graph.
[0024] Furthermore, step (3) includes: establishing an association between the emotion triggering vocabulary and entities in the chemical knowledge graph, identifying the context and entity relationship of the emotion triggering words; using a graph database to store the association information between the chemical knowledge graph and the emotion triggering vocabulary, and establishing a semantic network between entities.
[0025] Furthermore, a semantic network between entities is established, including: 1) graph database construction: creating nodes to represent chemical substances and process flows, and creating relationships to represent chemical reactions or production processes between them; 2) associated information storage: in the graph database, new nodes are created to represent emotional trigger words, and they are connected to related chemical entities through relationships; 3) semantic network construction: through the above steps 1) and 2), a semantic network containing chemical entities, emotional trigger words and their relationships is constructed.
[0026] Furthermore, in step (4), parameters are shared in the fusion layer to reduce the complexity of the model and prevent overfitting.
[0027] Further, step (5) comprises:
[0028] (501) Integrate the trained model into the real-time monitoring system;
[0029] (502) Real-time collection of network text data for the chemical industry;
[0030] (503) The model is applied to perform sentiment analysis on the collected data, identify sentiment tendencies, and present the sentiment analysis results in a visual form of charts and dashboards.
[0031] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0032] Chemical knowledge graphs can provide association information between entities, while sentiment analysis focuses on the emotional color in the text. The present invention constructs a chemical knowledge graph and sentiment trigger word library based on the characteristics of the chemical industry, integrating information from two dimensions: chemical knowledge and text sentiment, and predicts through a multimodal deep learning model. The model can accurately understand chemical professional terms, achieve sensitive capture of industry-specific sentiment trigger words, and more keenly capture the implicit sentiment tendencies in the text, thereby improving the depth of sentiment analysis and achieving accurate identification and analysis of the sentiment of the chemical industry's online public opinion. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of a method for analyzing chemical industry network public opinion sentiment provided by an embodiment of the present invention;
[0034] Figure 2 It is a flowchart of data collection and preprocessing to construct a data set in an embodiment of the present invention;
[0035] Figure 3 It is a flowchart of the construction of a chemical knowledge graph in an embodiment of the present invention;
[0036] Figure 4 is a flowchart of constructing an emotion triggering vocabulary library in an embodiment of the present invention;
[0037] Figure 5 It is a flowchart of the design and training of a multimodal deep learning model in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described below in conjunction with the accompanying drawings.
[0039] like Figure 1 As shown, the embodiment of the present invention provides a method for analyzing the sentiment of chemical industry network public opinion, comprising the following steps:
[0040] (1) Collect text data related to the chemical industry and perform data preprocessing, including data cleaning and formatting, annotate chemical texts using regular expressions or natural language processing tools, and use the pre-trained sentiment analysis model BERT to perform sentiment classification on chemical texts, and build a data set, such as Figure 2 As shown;
[0041] (101) Collect text data related to the chemical industry
[0042] Determine the scope and channels of data collection, focusing on the chemical industry, covering academic journals (such as Journal of the American Chemical Society), industry reports (such as the annual report released by the China Chemical Information Center), professional forums (such as Chemical Engineering World), social media platforms (such as Weibo, Zhihu) and mainstream news websites (such as Xinhuanet, People's Daily Online).
[0043] Design data collection framework to obtain data through API interfaces and / or web crawler tools.
[0044] Specifically, by cooperating with relevant databases, obtain API interface permissions, such as ACS Publications API, EI Compendex, etc., and regularly download the latest literature and report data. For subscribed databases, such as Wiley OnlineLibrary, set up automated scripts to automatically download the latest chemical-related literature every month. Use the API of Weibo Open Platform to set keyword monitoring (such as "chemical accident", "environmental chemical industry") to capture relevant discussions in real time. For Zhihu, you can use its RSS Feed or third-party API to monitor the dynamics of specific topics or user groups, such as the latest questions and answers under the topic of "chemical safety". Cooperate with mainstream news websites to obtain RSS Feed links, or use third-party services such as News API to search for the latest news reports based on keywords, such as "chemical plant explosion" and "chemical pollution". Given the high timeliness of news and social media data, set it to real-time crawling, that is, update it every 10 to 30 minutes to ensure that the latest changes in public opinion are captured. During hot events, such as chemical safety accidents, it can be shortened to update every 5 minutes to quickly respond to public opinion dynamics. Considering the long publishing cycle of academic journals and industry reports, we set it to update once a week or a month, and obtain the latest research results and industry trends through email notifications or automatic download scripts. For particularly important industry reports, such as those involving major chemical policy adjustments, we can set instant notifications to ensure that they are obtained and analyzed as soon as possible.
[0045] For websites that need to be crawled, such as professional forums or some news websites that do not provide API services, use or develop web crawlers, use Python's Scrapy framework or BeautifulSoup library, follow the robots.txt rules of the target website, and ensure the legality of data crawling. When developing crawlers, consider the efficiency and stability of data crawling, use asynchronous requests and proxy IP pools to prevent being blocked due to frequent access. Use Python's requests library or more advanced httpx library, combined with Beautiful Soup or lxml parsing library, to write crawler scripts to crawl data on the target web page. To ensure the robustness of the crawler, add an exception handling mechanism, such as automatically retrying or switching proxy IPs when a network connection fails or the server returns an error status code.
[0046] To store the collected data, build a Hadoop-based distributed file system (HDFS) or use cloud storage services (such as Alibaba Cloud OSS, AWS S3) to ensure secure storage and efficient access to data. Use Parquet or ORC format to store data to support efficient query and analysis. Use Elastic search as a full-text search engine to store and retrieve text data such as social media comments and news reports to quickly respond to keyword search needs.
[0047] (102) Data Preprocessing
[0048] The collected data is cleaned and formatted to ensure data quality and consistency, which is convenient for subsequent data analysis and model training. High-quality data can more accurately analyze the sentiment of chemical industry network public opinion.
[0049] Use Python's pandas library for data processing, including removing HTML tags, unifying text encoding (such as converting to UTF-8 encoding), deduplication (identifying duplicate records through hashing algorithms), correcting spelling errors (using the spell checker of the nltk library), etc.
[0050] Use the SQL library (Python's pandas library can also be used, the SQL library is preferred) to clean the data, including processing outliers (such as replacing outliers with the median), filling missing values (such as using forward filling or backward filling strategies), unifying units and metrics (such as converting values in different units to a unified unit), etc.
[0051] Use the NLTK library to perform text preprocessing, including tokenization (segmenting text into words or phrases), removing stop words (such as "the" and "and" in English), and stemming (converting words to their root form) or lemmatization (converting words to their original form).
[0052] Use the lemmatizer of the spaCy library to restore the word form (the spaCy natural language processing library provides the word form restoration function, which is equivalent to the word form restoration function of the NLTK library) to improve the accuracy of text analysis. Convert the text into a numerical vector to facilitate subsequent machine learning model processing. Use the Word2Vec model of the gensim library to embed the text data and convert each word into a vector representation of a fixed length. In the process of text digitization, it is necessary to pay attention to the processing of unregistered words. You can use randomly initialized vectors or replace them by finding similar words to facilitate subsequent clustering and classification analysis and predict the category labels of the data.
[0053] Use Python's datetime library to unify date and time formats, such as converting to the ISO 8601 standard format (YYYY-MM-DDTHH:MM:SSZ). For timestamps, use the to_datetime() function of the pandas library to convert time strings of various formats into a unified datetime object to facilitate subsequent time series analysis.
[0054] Design data format checking rules, and use regular expressions or data validation libraries (such as pydantic) to check data format compliance. Specific data format checking rules are defined based on the characteristics and requirements of the data, such as checking whether the data conforms to specific data types (such as strings, integers, floating-point numbers, etc.), whether it is within the expected range, and whether it conforms to specific formats (such as date formats, phone number formats, etc.). Use pydantic to define a data model class that contains data fields and their type annotations. You can also add field validation rules, such as regular expressions, range restrictions, etc. Use the defined data model class to instantiate and validate the input data. Pydantic will automatically check the type and format of the data, and throw errors when non-compliant data is found to ensure data standardization and consistency.
[0055] Regularly check the completeness, accuracy, and consistency of the data, such as identifying outliers or missing values through statistical analysis. Use the describe() function of the pandas library to quickly understand the basic statistical characteristics of the data, such as mean, median, standard deviation, etc., in order to discover potential data quality issues.
[0056] (103) Constructing a Dataset
[0057] Use regular expressions or natural language processing tools to classify and annotate chemical texts (classify specific information in the text and annotate its corresponding entity types, including chemical substance names, process flow keywords, chemical reaction descriptions, etc.), such as chunking in the nltk library, to identify sentiment trigger words (such as "safety", "environmental protection", "pollution") and chemical professional terms (such as "polymerization reaction", "catalytic cracking"). Use the pos_tag() function of the nltk library to perform part-of-speech tagging, identify nouns, verbs, and adjectives in the text, and provide more semantic information for subsequent sentiment analysis.
[0058] Use the pre-trained sentiment analysis model BERT in the Flair library to classify the text, preliminarily judge its sentiment tendency (such as positive, negative, neutral), and output the sentiment label and confidence of each text.
[0059] (2) Use the trained named entity recognition model NER to identify chemical entities in chemical texts, including chemical substance names, process flow keywords, and chemical reaction descriptions, perform dependency syntax analysis through Stanford Parser, and construct a chemical knowledge graph, such as Figure 3 As shown;
[0060] (201) Apply the named entity recognition model NER in the Flair library to identify chemical entities in chemical engineering texts
[0061] According to the needs of the chemical industry, a batch of text data containing chemical substance names, process flow keywords and chemical reaction descriptions is collected and annotated for fine-tuning and performance optimization of the NER model. Use the API and tools provided by the Flair library to configure model training parameters such as learning rate, batch size, training rounds, etc. to fine-tune the model to improve the recognition accuracy of chemical professional terms. After training, use an independent test data set to evaluate the model performance to ensure that the model achieves the expected accuracy in entity recognition in the chemical industry.
[0062] (201-1) Configure and train the named entity recognition model NER to better adapt to the professional terminology in the chemical industry.
[0063] Collect text data in the chemical industry, including academic papers, industry reports, professional forum discussions, etc., to ensure data diversity and representativeness. Manually annotate the dataset, add labels to each chemical substance, process keyword, and chemical reaction description, and create training and validation datasets. Use the Corpus class of the Flair library to load the dataset and ensure that the data format meets the requirements of model training.
[0064] Use the Sequence Tagger class of the Flair library to configure the named entity recognition model NER, specify the pre-trained model path, tag type, training parameters, etc. Call the train method to start model training, monitor the loss function during training and performance indicators on the validation set, such as the F1 score, and adjust the training parameters in time to optimize model performance.
[0065] After training is complete, save the model weights.
[0066] (201-2) The trained and optimized named entity recognition model NER is used to identify chemical substance names, process flow keywords and chemical reaction descriptions.
[0067] Deploy the trained model to the data processing flow, and perform named entity recognition on the preprocessed chemical text data. Use the Model class of the Flair library to load the saved model weights, call the predict method to predict the text, and output the recognized named entities and their types.
[0068] Post-process the model prediction results, such as deduplication and correction of erroneous recognition, to ensure the accuracy and completeness of named entities. Store the identified entity information in a structured data table, including entity type, entity name, location of occurrence, etc., to provide data support for the subsequent construction of chemical knowledge graphs.
[0069] (202) Dependency Parsing
[0070] Select Stanford Parser as the tool for dependency parsing and configure Stanford Parser parameters, such as model path, part-of-speech tagger, dependency type, etc., to adapt to the grammatical characteristics of chemical text. Take the chemical text data processed by named entity recognition as input, including entity information such as chemical substance names, process flow keywords, and chemical reaction descriptions. Use Stanford Parser's API or command line tool to perform dependency parsing on the text and output the analysis results, such as dependency trees, syntactic component labels, etc.
[0071] Extract structured information of chemical reaction paths and process flows from the results of dependency syntactic analysis, such as subject-verb-object structure, modification relationship, parallel relationship, etc. Use regular expressions or natural language processing tools, such as NLTK, to assist in identifying and parsing dependency relationships and improve the accuracy and efficiency of information extraction.
[0072] The extracted chemical reaction paths and process flow information are structured and converted into standard triple forms, such as (reactants, reaction types, products), (raw materials, process steps, intermediate products).
[0073] Use data formats such as RDF (Resource Description Framework) or JSON-LD to store structured chemical reaction paths and process flow information, making it easier to build a chemical knowledge graph.
[0074] Build a chemical knowledge graph database, such as using Neo4j or GraphDB, import structured data, and establish a relationship network between entities, including chemical reaction networks, process flow networks, etc., to provide a rich semantic background for subsequent chemical network public opinion analysis.
[0075] Through the above steps, a comprehensive, accurate and high-quality chemical knowledge graph can be constructed, which provides a deeper cognitive level for chemical network public opinion analysis and is a key step in realizing accurate chemical network public opinion analysis in the present invention.
[0076] (3) Combined with the VADER sentiment dictionary, filter and annotate the sentiment trigger words and their sentiment polarity unique to the chemical industry, construct a sentiment trigger word library, associate the sentiment trigger word library with entities in the chemical knowledge graph, and store the association information between the chemical knowledge graph and the sentiment trigger word library in the graph database, such as Figure 4 As shown;
[0077] (301) Based on the VADER sentiment dictionary, sentiment trigger words related to the chemical industry are screened.
[0078] The VADER sentiment lexicon includes positive and negative sentiment words and their intensity scores, which serve as the basis for constructing a specific sentiment trigger lexicon for the chemical industry.
[0079] Analyze text data in the chemical industry, including social media discussions, news reports, professional forums, etc., and identify sentiment trigger words closely related to the chemical industry, such as "safety", "pollution", "innovation", etc. Combined with the sentiment words in the VADER dictionary, filter out subsets related to the chemical industry, including chemical professional terms, industry-specific sentiment words, etc. Use Python's nltk.sentiment.vader module, load the VADER dictionary, call the LexiconBased SentimentIntensity Analyzer class, perform sentiment analysis on chemical text data, and identify sentiment trigger words and their sentiment tendencies.
[0080] (302) Define the sentiment polarity of sentiment trigger words and label them.
[0081] According to the specific emotional trigger words in the chemical industry, the emotional polarity of each word is annotated, including positive, negative and neutral. Considering that the emotional trigger words in the chemical industry may have double meanings or multiple meanings, such as "safety" may express positive or negative emotions in different situations, it needs to be carefully analyzed and defined. A guide for emotional annotation can be designed, including the definition of emotional polarity, annotation rules, examples, etc., to ensure the consistency and standardization of annotation.
[0082] (303) Construct an emotion trigger vocabulary and establish associations with entities in the chemical knowledge graph.
[0083] Integrate the annotated emotional trigger word library, including emotional trigger words, emotional polarity, frequency of occurrence and other information, to create an emotional trigger word library specific to the chemical industry.
[0084] Use a database management system, such as SQLite, to store the emotional trigger word library to ensure data query efficiency and security. Allow new words to be added or emotional polarity to be revised regularly to adapt to the development and changes of the chemical industry.
[0085] Establish association with chemical knowledge graph: Establish association with the emotional trigger word library and entities in the chemical knowledge graph, such as chemical substances, process flow, chemical reaction, etc., to identify the context and entity relationship of the emotional trigger words. The above dependency syntactic analysis can determine the relationship between emotional trigger words and chemical entities in sentences containing emotional trigger words. For example, if the word "leakage" appears in the context of describing "methanol", it may indicate negative sentiment towards "methanol".
[0086] Use graph databases, such as Neo4j or JanusGraph, to store the association information between the chemical knowledge graph and the emotional trigger vocabulary, and establish a semantic network between entities. Specifically, it includes:
[0087] 1) Graph database construction: Create nodes to represent chemical substances, process flows, etc., and create relationships to represent chemical reactions or production processes between them. For example, create a node to represent "methanol" and another node to represent "catalytic cracking", and represent the reaction between them through a relationship. 2) Associative information storage: In the graph database, create new nodes to represent emotional trigger words and connect them to related chemical entities through relationships. For example, create a node to represent "leakage" and connect it to the "methanol" node through an edge with negative emotional polarity. 3) Semantic network construction: Through the above steps, a semantic network containing chemical entities, emotional trigger words and their mutual relationships is constructed. This semantic network can be used to analyze the public's emotional tendencies towards specific chemicals, such as by querying emotional trigger words associated with "methanol" to understand the public's views on its safety. Design query interfaces, such as Cypher or SPARQL, to allow querying emotional tendencies related to specific entities from the emotional trigger word library, providing a rich semantic background for the sentiment analysis of chemical network public opinion.
[0088] (4) Design a chemical knowledge encoder GCN, design a sentiment-aware text encoder based on the Transformer architecture, design a fusion layer based on weighted summation, concatenation, gating mechanism or multi-head attention fusion strategy, integrate chemical knowledge and text sentiment features to form a multimodal deep learning model, and use chemical-related datasets to train the multimodal deep learning model, such as Figure 5 As shown;
[0089] (401)Chemical Knowledge Encoder.
[0090] (401-1) Build GNN model:
[0091] Evaluate Graph Convolutional Networks (GCN), Graph Attention Networks (GAT), Graph Isomorphism Network (GIN), etc., and select the most suitable model structure by comparing the performance of different models in the chemical knowledge graph. Initialize the entities and relationships in the chemical knowledge graph as low-dimensional vectors. Design a mechanism to enable nodes to update their own representations based on neighboring node information, taking into account chemical structure characteristics (such as molecular bonding and atomic spacing). Iterate and update node representations to deepen the understanding of graph structure. After the update, the node representation will contain more global information.
[0092] (401-2) Training the GNN model.
[0093] Define loss functions, such as cross entropy loss, for supervised model learning. Data preparation, preprocessing chemical knowledge graph data, including features and labels. Model training, using backpropagation and optimizers (such as Adam) to update parameters. Evaluate on the validation set, adjust the model structure or parameters as needed, use multiple evaluation indicators such as accuracy, F1 score, etc. to evaluate model performance, and fine-tune and optimize the model based on the evaluation results.
[0094] (402) Design of sentiment-aware text encoder based on Transformer architecture.
[0095] Transformer architecture uses self-attention mechanism to process text. Word embedding converts text into dense vector representation. Use pre-trained word vector models (such as Word2Vec) to convert each word in the text into a 300-dimensional vector. For example, convert words such as "methanol" and "leakage" into numerical vector representations. Multi-head self-attention captures information from multiple representation subspaces. Further refine features through feedforward neural networks to improve the expressiveness of the model. Use layer normalization technology to speed up training and avoid gradient vanishing and exploding problems.
[0096] Integrate the sentiment lexicon into the model and add sentiment scores to each word. Consider these sentiment scores in the self-attention calculation to enhance the model's perception of emotional content. For the input text sequence, use the self-attention layer of the Transformer model to calculate the attention each word pays to other words. For example, when processing the sentence "There was a leak at the methanol plant", the model will pay special attention to the words "methanol" and "leak".
[0097] You can also analyze the model’s attention weights to identify the words that the model pays the most attention to when making sentiment analysis decisions. For example, if the model assigns a high weight to the word “leakage,” this may indicate that the model considers it key to determining the sentiment of the sentence.
[0098] (403) Design fusion layer.
[0099] Design a fusion layer that fuses chemical and text features, and choose fusion strategies such as weighted sum, concatenation, gating mechanism, or multi-head attention. Combine the output of the chemical knowledge encoder (such as GCN) with the output of the sentiment-aware text encoder. Use a weighted sum or concatenation strategy to merge the two features, for example, through a parameterized gating mechanism to control the degree of fusion of chemical and sentiment features.
[0100] Control the information flow, dynamically adjust the feature importance, and design the gating unit to ensure that important information is fully utilized.
[0101] Share parameters in fusion layers to reduce model complexity and prevent overfitting. For example, you can use the same gating mechanism to share parameters between different layers, or share pre-trained word embeddings between different tasks.
[0102] (404) Model pre-training.
[0103] Use chemistry-related datasets for pre-training, such as ChemProt, to pre-train models. Design tasks to guide model learning. Transfer learning, use pre-trained models as the initial weights for downstream tasks to improve specific task performance.
[0104] (405) Model fine-tuning and optimization.
[0105] Fine-tune the model using public opinion data from the chemical industry to ensure that the model is adapted to the language characteristics of the specific field. Cross-validate to evaluate model performance and ensure robustness and generalization. Adjust hyperparameters such as learning rate and batch size to find the optimal combination. Continuously evaluate and improve, monitor model performance, and adjust based on feedback.
[0106] (5) Use the trained multimodal deep learning model to conduct sentiment analysis on chemical industry network public opinion.
[0107] (501) Integrate the trained model into the real-time monitoring system.
[0108] (502) Collect network text data from the chemical industry in real time.
[0109] (503) The model is used to perform sentiment analysis on the collected data, identify sentiment tendencies, and display the sentiment analysis results in visual forms such as charts and dashboards.
Claims
1. A method for analyzing sentiment of chemical industry network public opinion, characterized in that: include: (1) Collect text data related to the chemical industry and perform data preprocessing, including data cleaning and formatting, annotate chemical texts using regular expressions or natural language processing tools, and use the pre-trained sentiment analysis model BERT to perform sentiment classification on chemical texts and build a data set; (2) Use the trained named entity recognition model NER to identify chemical entities in chemical texts, including chemical substance names, process flow keywords, and chemical reaction descriptions, perform dependency syntax analysis through Stanford Parser, and construct a chemical knowledge graph; (3) Combined with the VADER sentiment dictionary, filter and annotate the sentiment trigger words and their sentiment polarity unique to the chemical industry, construct a sentiment trigger word library, associate the sentiment trigger word library with entities in the chemical knowledge graph, and store the association information between the chemical knowledge graph and the sentiment trigger word library in the graph database; (4) Design a chemical knowledge encoder GCN, design a sentiment-aware text encoder based on the Transformer architecture, design a fusion layer based on weighted summation, concatenation, gating mechanism or multi-head attention fusion strategy, integrate chemical knowledge and text sentiment features to form a multimodal deep learning model, and use chemistry-related datasets to train the multimodal deep learning model; (5) Use the trained multimodal deep learning model to conduct sentiment analysis on chemical industry network public opinion.
2. The method for analyzing chemical industry network public opinion sentiment according to claim 1, characterized in that: In step (1), chemical industry related text data is obtained through an API interface and / or a web crawler tool.
3. The chemical industry network public opinion sentiment analysis method according to claim 2 is characterized in that: In step (1), data cleaning and formatting include: Use Python's pandas library for data processing, including removing HTML tags, unifying text encoding, deduplication, and correcting spelling errors; Use SQL libraries to clean data, including handling outliers, filling missing values, and unifying units and metrics; Use the NLTK library to perform text preprocessing, including word segmentation, stop word removal, and stemming or lemmatization; Use the lemmatizer of the spaCy library to perform word form restoration; Use the Word2Vec model of the gensim library to embed text data and convert each word into a fixed-length vector representation; Use Python's datetime library to unify date and time formats; Design data format checking rules and use regular expressions or data validation libraries to check data format compliance.
4. The chemical industry network public opinion sentiment analysis method according to claim 3 is characterized in that: Data format checking rules are defined based on the characteristics and requirements of the data.
5. The method for analyzing chemical industry network public opinion sentiment according to claim 1, characterized in that: In step (1), regular expressions or natural language processing tools are used to classify specific information in the chemical text and annotate its corresponding entity types, including chemical substance names, process flow keywords, and chemical reaction descriptions.
6. The chemical industry network public opinion sentiment analysis method according to claim 1 is characterized in that: In step (2), the structured information of chemical reaction paths and process flows is extracted from the results of dependency syntactic analysis, and the extracted chemical reaction paths and process flow information is structured and converted into a standard triple form, thereby establishing a relationship network between entities and constructing a chemical knowledge graph.
7. The method for analyzing chemical industry network public opinion sentiment according to claim 1, characterized in that: Step (3) includes: establishing an association between the emotion triggering vocabulary and entities in the chemical knowledge graph, identifying the context and entity relationship of the emotion triggering words; using a graph database to store the association information between the chemical knowledge graph and the emotion triggering vocabulary, and establishing a semantic network between the entities.
8. The method for analyzing chemical industry network public opinion sentiment according to claim 7, characterized in that: Establishing a semantic network between entities includes: 1) Graph database construction: creating nodes to represent chemical substances and process flows, and creating relationships to represent chemical reactions or production processes between them; 2) Related information storage: in the graph database, creating new nodes to represent emotional trigger words, and connecting them with related chemical entities through relationships; 3) Semantic network construction: through the above steps 1) and 2), constructing a semantic network containing chemical entities, emotional trigger words and their relationships.
9. The method for analyzing chemical industry network public opinion sentiment according to claim 1, characterized in that: In step (4), parameters are shared in the fusion layer to reduce the complexity of the model and prevent overfitting.
10. The method for analyzing chemical industry network public opinion sentiment according to claim 1, characterized in that: Step (5) comprises: (501) Integrate the trained model into the real-time monitoring system; (502) Real-time collection of network text data for the chemical industry; (503) The model is applied to perform sentiment analysis on the collected data, identify sentiment tendencies, and present the sentiment analysis results in a visual form of charts and dashboards.
Citation Information
Cited By
Method, device and equipment for constructing entity recognition and sentiment analysis model
CN119721041A
Method, apparatus and device for constructing entity recognition and sentiment analysis models
CN119721041B