Icon

04.Callee_​Deploying_​Sentiment_​Predictor_​-_​Lexicon_​Based

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.

Callable Version of "Deploying Sentiment Analysis Predictive Model - Lexicon Based Approach"This callable version of our deployment workflow is useful for application testing, among other things. 1. Receive text as inputfor sentiment prediction.Here we receive documents(e.g., tweets) to predict theirsentiment. The onlyrequirement is that thedocuments table shouldhave a column named 'text'. 2. Data Manipulation/Preparation.Here we execute a captured workflowsegment of the building workflow thatperforms some data preprocessing. The most important node in thissegment is "Strings to Document",which formats several string columnsinto a single document that can be text-mined in KNIME. 3. Use Text Mining to Tag Words with Positiveand Negative Meaning based on a Dictionary.Here we execute another captured segment of thebuilding workflow -- this time, to tag words basedon their sentiment. 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) dividedby (number of postive words + number of negativewords). If the score is negative it is classified asnegative, if the score is positive it is classified aspositive, and if it is equal to 0 it is classified asneutral. 4. Count the Number of Positive andNegative Words per Document. Here were-use a shared component also present inthe building workflow. It encapsulates thecounting of sentiment words per document,separated by class. Execute data preparationworkflow overextracted tweetsExecute word taggingworkflow overextracted tweetsExecute result joiningworkflow overextracted tweets andsentiment predictionsNumbers of Positive andNegative Words per Tweet WorkflowService Input WorkflowService Output Call WorkflowService Call WorkflowService Call WorkflowService Calculate Scores Callable Version of "Deploying Sentiment Analysis Predictive Model - Lexicon Based Approach"This callable version of our deployment workflow is useful for application testing, among other things. 1. Receive text as inputfor sentiment prediction.Here we receive documents(e.g., tweets) to predict theirsentiment. The onlyrequirement is that thedocuments table shouldhave a column named 'text'. 2. Data Manipulation/Preparation.Here we execute a captured workflowsegment of the building workflow thatperforms some data preprocessing. The most important node in thissegment is "Strings to Document",which formats several string columnsinto a single document that can be text-mined in KNIME. 3. Use Text Mining to Tag Words with Positiveand Negative Meaning based on a Dictionary.Here we execute another captured segment of thebuilding workflow -- this time, to tag words basedon their sentiment. 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) dividedby (number of postive words + number of negativewords). If the score is negative it is classified asnegative, if the score is positive it is classified aspositive, and if it is equal to 0 it is classified asneutral. 4. Count the Number of Positive andNegative Words per Document. Here were-use a shared component also present inthe building workflow. It encapsulates thecounting of sentiment words per document,separated by class. Execute data preparationworkflow overextracted tweetsExecute word taggingworkflow overextracted tweetsExecute result joiningworkflow overextracted tweets andsentiment predictionsNumbers of Positive andNegative Words per Tweet WorkflowService Input WorkflowService Output Call WorkflowService Call WorkflowService Call WorkflowService Calculate Scores

Nodes

Extensions

Links