You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/word2vecsentiment/Word2VecSentimentRNN.java
/**Example: Given a movie review (raw text), classify that movie review as either positive or negative based on the words it contains.
48
+
/**
49
+
* Example: Given a movie review (raw text), classify that movie review as either positive or negative based on the words it contains.
46
50
* This is done by combining Word2Vec vectors and a recurrent neural network model. Each word in a review is vectorized
47
51
* (using the Word2Vec model) and fed into a recurrent neural network.
48
52
* Training data is the "Large Movie Review Dataset" from http://ai.stanford.edu/~amaas/data/sentiment/
49
53
* This data set contains 25,000 training reviews + 25,000 testing reviews
50
-
*
54
+
* <p>
51
55
* Process:
56
+
* 0. If path to the wordvectors is not set and a download not found previously in the default location you will be prompted if you want to download it.
52
57
* 1. Automatic on first run of example: Download data (movie reviews) + extract
53
-
* 2. Load existing Word2Vec model (for example: Google News word vectors. You will have to download this MANUALLY)
58
+
* 2. Load existing Word2Vec model (for example: Google News word vectors.)
54
59
* 3. Load each each review. Convert words to vectors + reviews to sequences of vectors
55
60
* 4. Train network
56
-
*
61
+
* <p>
57
62
* With the current configuration, gives approx. 83% accuracy after 1 epoch. Better performance may be possible with
58
63
* additional tuning.
59
64
*
60
-
* NOTE / INSTRUCTIONS:
61
-
* You will have to download the Google News word vector model manually. ~1.5GB
62
-
* The Google News vector model available here: https://code.google.com/p/word2vec/
63
-
* Download the GoogleNews-vectors-negative300.bin.gz file
64
-
* Then: set the WORD_VECTORS_PATH field to point to this location.
0 commit comments