Icon

07_​Sentiment_​Analysis_​with_​Deep_​Learning

Sentiment Analysis

This workflow shows how to train a simple neural network for text classification, in this case sentiment analysis. The used network learns a 128 dimensional word embedding followed by an LSTM.

This example is adapted from the following Keras example script:
https://github.com/keras-team/keras/blob/master/examples/imdb_lstm.py

In order to run the example, please make sure you have the following KNIME extensions installed:

* KNIME Deep Learning - Keras Integration (Labs)

You also need a local Python installation that includes Keras. Please refer to https://www.knime.com/deeplearning#keras for installation recommendations and further information.

Training Deployment Evaluation Sentiment Analysis on IMDB movie reviews This workflow shows how to train a simple neural networkfor text classification, in this case sentiment analysis. Theused network learns a 128 dimensional word embeddingfollowed by an LSTM. PreprocessingHere we load a preprocessed dataset from Keras but one couldalso prepare the data with KNIME Textprocessing. Get all sequencesto same lengthdefine network structuretrain/validation80/20Get all sequencesto same lengthtop trainingbottom testdictionary sizeToo small valuescan decrease modelperformanceToo large valuesresult in too large modelspredict testdatatrain for 3 epochswith Adam Pad or Truncate DL PythonNetwork Creator Partitioning Pad or Truncate Read Data Integer Input DL Network Executor(deprecated) MISSING KerasNetwork Learner Scorer (deprecated) ROC Curve Extract Prediction Training Deployment Evaluation Sentiment Analysis on IMDB movie reviews This workflow shows how to train a simple neural networkfor text classification, in this case sentiment analysis. Theused network learns a 128 dimensional word embeddingfollowed by an LSTM. PreprocessingHere we load a preprocessed dataset from Keras but one couldalso prepare the data with KNIME Textprocessing. Get all sequencesto same lengthdefine network structuretrain/validation80/20Get all sequencesto same lengthtop trainingbottom testdictionary sizeToo small valuescan decrease modelperformanceToo large valuesresult in too large modelspredict testdatatrain for 3 epochswith Adam Pad or Truncate DL PythonNetwork Creator Partitioning Pad or Truncate Read Data Integer Input DL Network Executor(deprecated) MISSING KerasNetwork Learner Scorer (deprecated) ROC Curve Extract Prediction

Nodes

Extensions

Links