cancel
Showing results for 
Search instead for 
Did you mean: 

Tip for capturing sentiments using Composable ML

dalilaB
Data Scientist
Data Scientist

Tip for capturing sentiments using Composable ML

Let’s assume you have reviews or tweets in your model. You believe you can get an uplift for your model if only you can capture the sentiment in the text. However, you can actually do this simply by modifying the blueprint.

For instance, this is a simple blueprint. For simplicity, I’m showing a blueprint with only text, but the model would have features too. Now you need to copy and edit your blueprint.

Linda_0-1650068730398.png

If you were to hover over either the Matrix of work-grams counts… node or Elastic-Net Classifier… node in my blueprint (below), you would see the type of input required for that task, and the type of output returned. For example, the Matrix of work-grams counts… task requires the input to be of type Text, and it returns a data frame with all numeric features (as shown in the image).  

Linda_1-1650068730383.png

For this tip, we are capturing sentiments in the text feature. I do this by hovering over the Text variables node and clicking +.  

Linda_2-1650068730296.png

In the displayed menu, I expand Preprocessing > Text Preprocessing and see a large number of options for text manipulations. (Some of these are already in Advanced Tunings for some blueprints, but others can be accessed only here.) For this tip, you select to add TextBlob Sentiment Featurizer.

Linda_3-1650068730431.png

 

Linda_4-1650068730279.png

You’ll see a new node in your blueprint, outlined in red.  When you hover over the node, you can see that it requires text so we’ll connect that to the Text variables node; however, it returns a data frame with numerical features. The TextBlob Sentiment Featurizer is a preprocessing module, so we need to connect it to our model task, Elastic-Net Classifier… 

Linda_5-1650068730396.png

Your new blueprint is set. Now you just need to train the blueprint to build a new model with this new blueprint. (Before training, you can change the feature list or the training sample size.)

Here is the model on the Leaderboard, shown in the top four best models. For the best model, which we trained on 80%, we added SPACY from the Test Preprocessing.  

Linda_6-1650068730409.png

Let me know if you have questions about this tip!

@dalilaB 

Labels (2)
0 Replies