Icon

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

Workflow Services - Sentiment Predictor - Exercise

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

Here we read tweets thatwere previously collected withthe Twitter API, and a fewcolumns get renamed so thatwe can better reuse sharedcomponents and workflowsegments derived from thebuilding workflow. Step 1. Call workflow segment for datapreprocessing. 1. Using the Call Workflow Service node, setthe workflow relative path to captured segmentas '../Workflow_Segments/01.Captured_Segment_1__Data_Preparation'.Adjust node ports and click 'OK'.2. Connect the output of the Column Renamenode to the Call Workflow Service node topreprocess the tweets with renamed columns.3. Execute the node and connect its output tothe following instance of the Call WorkflowService node, already present in the exercise. Here we execute anothercaptured segment of thebuilding workflow -- this time,to tag words based on theirsentiment. Non-tagged wordsget filtered out in the end. Step 3. Join original data with sentiment predictions.1. Using the Call Workflow Service node, set the workflow relative pathto 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 firstdata table input port of the Call Workflow Service node. 3. Connect the output of the CSV Reader node, right at the beginning ofthis workflow, to the second data table input port of the Call WorkflowService node.4. Execute the node to join the original data with the created predictions,when they exist. The quality of these predictions can then be evaluatedby deploying this workflow as a web application or as a web service. Here, the sentiment score is calculated by(number of postive words - number ofnegative words) divided by (number ofpostive words + number of negativewords). If the score is negative it isclassified as negative, if the score ispositive it is classified as positive, and if itis equal to 0 it is classified as neutral. Step 2. Apply shared component to count the numberof positive and negative words per document. 1. Drag shared component Numbers of Positive andNegative Words per Document from folder'Components' to here.2. Connect the output of the previous instance of the CallWorkflow Service to the shared component. The idea isto feed the component with the tagged tweets.3. Execute the shared component and connect its outputto shared component Calculate Scores, already presentin the exercise. Session 1 - Preparing to Deploy a WorkflowExercise 04.Integrated_Deployment_-_Sentiment_Predictor_-_Lexicon_BasedIn this exercise you'll use workflow services functionalities to re-use segments of another workflow, along with components, to deploy alexicon-based sentiment analysis predictor. Read tweets extractedwith the Twitter APIExecute word taggingworkflow overextracted tweets Column Rename CSV Reader Calculate Scores Call WorkflowService Here we read tweets thatwere previously collected withthe Twitter API, and a fewcolumns get renamed so thatwe can better reuse sharedcomponents and workflowsegments derived from thebuilding workflow. Step 1. Call workflow segment for datapreprocessing. 1. Using the Call Workflow Service node, setthe workflow relative path to captured segmentas '../Workflow_Segments/01.Captured_Segment_1__Data_Preparation'.Adjust node ports and click 'OK'.2. Connect the output of the Column Renamenode to the Call Workflow Service node topreprocess the tweets with renamed columns.3. Execute the node and connect its output tothe following instance of the Call WorkflowService node, already present in the exercise. Here we execute anothercaptured segment of thebuilding workflow -- this time,to tag words based on theirsentiment. Non-tagged wordsget filtered out in the end. Step 3. Join original data with sentiment predictions.1. Using the Call Workflow Service node, set the workflow relative pathto 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 firstdata table input port of the Call Workflow Service node. 3. Connect the output of the CSV Reader node, right at the beginning ofthis workflow, to the second data table input port of the Call WorkflowService node.4. Execute the node to join the original data with the created predictions,when they exist. The quality of these predictions can then be evaluatedby deploying this workflow as a web application or as a web service. Here, the sentiment score is calculated by(number of postive words - number ofnegative words) divided by (number ofpostive words + number of negativewords). If the score is negative it isclassified as negative, if the score ispositive it is classified as positive, and if itis equal to 0 it is classified as neutral. Step 2. Apply shared component to count the numberof positive and negative words per document. 1. Drag shared component Numbers of Positive andNegative Words per Document from folder'Components' to here.2. Connect the output of the previous instance of the CallWorkflow Service to the shared component. The idea isto feed the component with the tagged tweets.3. Execute the shared component and connect its outputto shared component Calculate Scores, already presentin the exercise. Session 1 - Preparing to Deploy a WorkflowExercise 04.Integrated_Deployment_-_Sentiment_Predictor_-_Lexicon_BasedIn this exercise you'll use workflow services functionalities to re-use segments of another workflow, along with components, to deploy alexicon-based sentiment analysis predictor. Read tweets extractedwith the Twitter APIExecute word taggingworkflow overextracted tweets Column Rename CSV Reader Calculate Scores Call WorkflowService

Nodes

Extensions

Links