Icon

04.Workflow_​Services_​-_​Sentiment_​Predictor_​-_​Lexicon_​Based - Exercise

Workflow Services - Sentiment_Predictor

In this exercise you'll use workflow services funcionalities to re-use segments of another workflow, along with components, to deploy a lexicon-based sentiment analysis predictor.

Here we read tweets that werepreviously collected with the TwitterAPI, and a few columns get renamedso that we can better reuse sharedcomponents and workflow segmentsderived from the building workflow. Step 1. Call workflow segment for data preprocessing. 1. Using the Call Workflow Service node, set the relative pathto captured segment as '../Workflow_Segments/01.Captured_Segment_1__Data_Preparation'. Adjust nodeports and click 'OK'.2. Connect the output of the Column Rename node to the CallWorkflow Service node to preprocess the tweets with renamedcolumns.3. Execute the node and connect its output to the followinginstance of the Call Workflow Service node, already present inthe exercise. Here we execute another capturedsegment of the building workflow -- thistime, to tag words based on theirsentiment. Non-tagged words getfiltered out in the end. Step 3. Join original data with sentiment predictions.1. Using the Call Workflow Service node, set the relative path to captured segment '../Workflow_Segments/01.Captured_Segment_3__Join_Results'. Adjust node ports and click 'OK'.2. Connect the output of the Calculate Scores component to the first data table input port of theCall Workflow Service node. 3. Connect the output of the CSV Reader node, right at the beginning of this workflow, to thesecond data table input port of the Call Workflow Service node.4. Execute the node to join the original data with the created predictions, when they exist. Thequality of these predictions can then be evaluated by deploying this workflow as a webapplication or as a web service. Here, the sentiment score is calculated by (number ofpostive words - number of negative words) divided by(number of postive words + number of negative words).If the score is negative it is classified as negative, if thescore is positive it is classified as positive, and if it isequal to 0 it is classified as neutral. Step 2. Apply shared component to count the number of positive andnegative words per document. 1. Drag shared component Numbers of Positive and Negative Words perDocument from folder 'Components' to here.2. Connect the output of the previous instance of the Call WorkflowService to the shared component. The idea is to feed the component withthe tagged tweets.3. Execute the shared component and connect its output to sharedcomponent Calculate Scores, already present in the exercise. Session 1 - Preparing to Deploy a WorkflowExercise 04.Integrated_Deployment_-_Sentiment_Predictor_-_Lexicon_BasedIn this exercise you'll use workflow services funcionalities to re-use segments of another workflow, along with components, to deploy a lexicon-based sentiment analysis predictor. Execute word taggingworkflow overextracted tweetsRead tweets extractedwith the Twitter API Column Rename Call WorkflowService CSV Reader Calculate Scores Here we read tweets that werepreviously collected with the TwitterAPI, and a few columns get renamedso that we can better reuse sharedcomponents and workflow segmentsderived from the building workflow. Step 1. Call workflow segment for data preprocessing. 1. Using the Call Workflow Service node, set the relative pathto captured segment as '../Workflow_Segments/01.Captured_Segment_1__Data_Preparation'. Adjust nodeports and click 'OK'.2. Connect the output of the Column Rename node to the CallWorkflow Service node to preprocess the tweets with renamedcolumns.3. Execute the node and connect its output to the followinginstance of the Call Workflow Service node, already present inthe exercise. Here we execute another capturedsegment of the building workflow -- thistime, to tag words based on theirsentiment. Non-tagged words getfiltered out in the end. Step 3. Join original data with sentiment predictions.1. Using the Call Workflow Service node, set the relative path to captured segment '../Workflow_Segments/01.Captured_Segment_3__Join_Results'. Adjust node ports and click 'OK'.2. Connect the output of the Calculate Scores component to the first data table input port of theCall Workflow Service node. 3. Connect the output of the CSV Reader node, right at the beginning of this workflow, to thesecond data table input port of the Call Workflow Service node.4. Execute the node to join the original data with the created predictions, when they exist. Thequality of these predictions can then be evaluated by deploying this workflow as a webapplication or as a web service. Here, the sentiment score is calculated by (number ofpostive words - number of negative words) divided by(number of postive words + number of negative words).If the score is negative it is classified as negative, if thescore is positive it is classified as positive, and if it isequal to 0 it is classified as neutral. Step 2. Apply shared component to count the number of positive andnegative words per document. 1. Drag shared component Numbers of Positive and Negative Words perDocument from folder 'Components' to here.2. Connect the output of the previous instance of the Call WorkflowService to the shared component. The idea is to feed the component withthe tagged tweets.3. Execute the shared component and connect its output to sharedcomponent Calculate Scores, already present in the exercise. Session 1 - Preparing to Deploy a WorkflowExercise 04.Integrated_Deployment_-_Sentiment_Predictor_-_Lexicon_BasedIn this exercise you'll use workflow services funcionalities to re-use segments of another workflow, along with components, to deploy a lexicon-based sentiment analysis predictor. Execute word taggingworkflow overextracted tweetsRead tweets extractedwith the Twitter API Column Rename Call WorkflowService CSV Reader Calculate Scores

Nodes

Extensions

Links