Icon

08_​Sentiment_​Analysis_​with_​Deep_​Learning_​KNIME_​nodes

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.

Define Network Preprocessing Training and Predicting Evaluation Sentiment Analysis on IMDB movie reviews This workflow shows how to train a simple neural network fortext classification, in this case sentiment analysis. The usednetwork learns a 128 dimensional word embedding followed byan LSTM. train for 3 epochswith AdamApply DictionaryShape: max number of words per documentsInput: # word in dictionary+2128 unitsActivation function:sigmoidpredict testdataimdb.tableReadDictionary.table Strings To Document Keras NetworkLearner Dictionary Replacer Extract Prediction Scorer (JavaScript) Partitioning Zero Padding Truncation Reduce dictionary Define document anddictionary size Keras Input Layer Keras EmbeddingLayer Keras LSTM Layer Keras Dense Layer Keras NetworkExecutor Table Reader Table Reader Define Network Preprocessing Training and Predicting Evaluation Sentiment Analysis on IMDB movie reviews This workflow shows how to train a simple neural network fortext classification, in this case sentiment analysis. The usednetwork learns a 128 dimensional word embedding followed byan LSTM. train for 3 epochswith AdamApply DictionaryShape: max number of words per documentsInput: # word in dictionary+2128 unitsActivation function:sigmoidpredict testdataimdb.tableReadDictionary.table Strings To Document Keras NetworkLearner Dictionary Replacer Extract Prediction Scorer (JavaScript) Partitioning Zero Padding Truncation Reduce dictionary Define document anddictionary size Keras Input Layer Keras EmbeddingLayer Keras LSTM Layer Keras Dense Layer Keras NetworkExecutor Table Reader Table Reader

Nodes

Extensions

Links