Icon

Deploying_​Sentiment_​Predictor_​-_​Lexicon_​Based_​-_​KNIME_​Edge

Deploying Sentiment Analysis Predictive Model - Lexicon Based Approach

This worflow applies the lexicon based approach on new tweets to predict their sentiment. The last component visualizes (1) the bar chart with the number of negative/positive/neutral tweets, (2) the word cloud of all collected tweets, and (3) the table with all collected tweets.

If you use this workflow, please cite: 
F. Villaroel Ordenes & R. Silipo, “Machine learning for marketing on the KNIME Hub: The development of a live repository for marketing applications”, Journal of Business Research 137(1):393-410, DOI: 10.1016/j.jbusres.2021.08.036.

Version of "Deploying Sentiment Analysis Predictive Model - Lexicon Based Approach" for KNIME Edge 1. Receive text as input forsentiment prediction. Here wereceive documents (e.g., tweets) topredict their sentiment. The onlyrequirement is that the documentstable should have a column named'text'. 2. Data Manipulation/Preparation. Here we execute a captured workflow segment of thebuilding workflow that performs some data preprocessing. The most important node in thissegment is "Strings to Document", which formats several string columns into a singledocument that can be text-mined in KNIME. 3. Use Text Mining to Tag Words withPositive and Negative Meaning basedon a Dictionary. Here we execute anothercaptured segment of the building workflow-- this time, to tag words based on theirsentiment. Non-tagged words get filteredout in the end. 6. Get Original Data and Joined Sentiment Predictions. Here we execute asegment of the building workflow that joins the original data with joined predictions,when they exist. Recall that if a tweet/document does not have any sentiment word,it will have a neutral sentiment prediction associated with it. The quality of thesepredictions can then be evaluated by using this dataset in a web application or in aweb service. Here, we send the output back for testing purposes. 5. Calculate a Sentiment Score based on theNumber of Positive and Negative Words andClassify Documents based on the Score. Thesentiment score is calculated by (number ofpostive words - number of negative words)divided by (number of postive words + number ofnegative words). If the score is negative it isclassified as negative, if the score is positive it isclassified as positive, and if it is equal to 0 it isclassified as neutral. 4. Count the Number of Positive andNegative Words per Document. Herewe re-use a shared component alsopresent in the building workflow. Itencapsulates the counting of sentimentwords per document, separated byclass. Convert strings toto documentsCreate id columnSample data ContainerInput (Table) ContainerOutput (Table) Strings To Document DuplicateRow Filter Column Filter Tag Words asPositive or Negative Join Sentiment Predictionsand Original Data RowID Numbers of Positive andNegative Words per Tweet Calculate Scores CSV Reader Version of "Deploying Sentiment Analysis Predictive Model - Lexicon Based Approach" for KNIME Edge 1. Receive text as input forsentiment prediction. Here wereceive documents (e.g., tweets) topredict their sentiment. The onlyrequirement is that the documentstable should have a column named'text'. 2. Data Manipulation/Preparation. Here we execute a captured workflow segment of thebuilding workflow that performs some data preprocessing. The most important node in thissegment is "Strings to Document", which formats several string columns into a singledocument that can be text-mined in KNIME. 3. Use Text Mining to Tag Words withPositive and Negative Meaning basedon a Dictionary. Here we execute anothercaptured segment of the building workflow-- this time, to tag words based on theirsentiment. Non-tagged words get filteredout in the end. 6. Get Original Data and Joined Sentiment Predictions. Here we execute asegment of the building workflow that joins the original data with joined predictions,when they exist. Recall that if a tweet/document does not have any sentiment word,it will have a neutral sentiment prediction associated with it. The quality of thesepredictions can then be evaluated by using this dataset in a web application or in aweb service. Here, we send the output back for testing purposes. 5. Calculate a Sentiment Score based on theNumber of Positive and Negative Words andClassify Documents based on the Score. Thesentiment score is calculated by (number ofpostive words - number of negative words)divided by (number of postive words + number ofnegative words). If the score is negative it isclassified as negative, if the score is positive it isclassified as positive, and if it is equal to 0 it isclassified as neutral. 4. Count the Number of Positive andNegative Words per Document. Herewe re-use a shared component alsopresent in the building workflow. Itencapsulates the counting of sentimentwords per document, separated byclass. Convert strings toto documentsCreate id columnSample data ContainerInput (Table) ContainerOutput (Table) Strings To Document DuplicateRow Filter Column Filter Tag Words asPositive or Negative Join Sentiment Predictionsand Original Data RowID Numbers of Positive andNegative Words per Tweet Calculate Scores CSV Reader

Nodes

Extensions

Links