Icon

Example 4 - Building Sentiment Predictor - BERT

Building Sentiment Predictor - BERT

This workflow uses a Kaggle Dataset, including 14K customer tweets towards six US airlines (https://www.kaggle.com/crowdflower/twitter-airline-sentiment). Contributors annotated the valence of the tweets as positive, negative, and neutral. Once users are satisfied with the model evaluation, they should export the trained BERT model for deployment to classify non-annotated data.

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.

Annotations and comments
  • Building a Sentiment Analysis Predictive Model - BERT This workflow uses a Kaggle Dataset, including 14K customer tweets towards six US airlines (https://www.kaggle.com/crowdflower/twitter-airline-sentiment). Contributors annotated the valence of the tweets as positive, negative, and neutral. Once users are satisfied with the model evaluation, they should export the trained BERT model for deployment to classify non-annotated data.
  • 1. Read annotated twitter dataset.
  • 2. Data Manipulation/Preparation. Simplified process of data manipulation/preparation. Users could also add more pre-processing using text mining extension
  • 3. Upload, Train, and Apply a BERT model. To execute this part of the workflow, users need to have a dedicated Python environment and then must select File->Preferences->KNIME->Python deep learning->Tensor flow 2. The enviroment needs to have the following packages installed: https://hub.knime.com/redfield/extensions/se.redfield.bert.feature/latest
  • 4. Evaluate the Model. This part of the workflow writes the trained model to a file and validates its accuracy.
  • Workflow source: https://hub.knime.com/knime/spaces/Machine%20Learning%20and%20Marketing/latest/Sentiment%20Analysis~-z5F8gFJ9Fm1756a/ 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.
  • With fine tuning
  • Before using create a folder in your laptop in which upload BERT model
  • Kaggle Dataset N=14640 Tweets from consumers to airlines
  • Only text and category
  • 80% training 20% testing
  • 83% Accuracy
  • lower case text

Nodes

Extensions

Links