Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
940 stars 313 forks source link

More clear sentiment analysis example? #148

Closed coodoo closed 8 years ago

coodoo commented 8 years ago

I had been trying to figure out how to implement sentiment analysis by following sequence to one example but found it rather hard to understand.

Just wondering is there any more detailed examples using real world datasets like imdb or twitter to showcase the true power of rnn? Thanks.

nicholas-leonard commented 8 years ago

@coodoo It is on my To Do list to include the twitter dataset. Just to be clear, you mean the one referred to on this page right : http://help.sentiment140.com/for-students/ ?

Sandy4321 commented 8 years ago

yes you may start from this link http://cs.stanford.edu/people/alecmgo/trainingandtestdata.zip

though it is not true data since it was labeled by emotions but code development it is ok however for model tuning to be get useful model it is faked data by the way for me better to have only python based code since torch gives up to python do you know python code example for rnn/last/gru except https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py

http://deeplearning.net/tutorial/lstm.html

https://github.com/mesnilgr/is13

https://github.com/umass-semeval/semeval16 http://k8si.github.io/2016/01/28/lstm-networks-for-sentiment-analysis-on-tweets.html

you will find more data here semeval16-master\data\

On Sun, Mar 6, 2016 at 12:22 PM, Nicholas Léonard notifications@github.com wrote:

@coodoo https://github.com/coodoo It is on my To Do list to include the twitter dataset. Just to be clear, you mean the one referred to on this page right : http://help.sentiment140.com/for-students/ ?

— Reply to this email directly or view it on GitHub https://github.com/Element-Research/rnn/issues/148#issuecomment-192938598 .

coodoo commented 8 years ago

@nicholas-leonard Yes, that's the original source, later on there's a couple of variations based on that, including examples from keras as mentioned above.

I was basically following kaggle's sunny side up example which provides both IMDB and twitter datasets, might be a useful reference.

But really any example that walks the reader from end to end with detailed instructions would be highly appreciated!

Sandy4321 commented 8 years ago

Jeremy

I did not find some RNN based theano source code in this project only search gave me sunny-side-up-master_mar7\src\examples\tufs_cnn.py ''' Model below is based on paper by Xiang Zhang "Character-Level Convolutional Networks for Text Classification" (http://arxiv.org/abs/1509.01626) paper was formerly known as "Text Understanding from Scratch" ( http://arxiv.org/pdf/1502.01710v4.pdf)

THEANO_FLAGS=mode=FAST_RUN,device=gpu1,floatX=float32 python tufs_cnn.py '''

On Mon, Mar 7, 2016 at 7:34 AM, Jeremy Lu notifications@github.com wrote:

@nicholas-leonard https://github.com/nicholas-leonard Yes, that's the original source, later on there's a couple of variations based on that, including examples from keras as mentioned above.

I was basically following kaggle's sunny side up https://github.com/Lab41/sunny-side-up example which provides both IMDB and twitter datasets, might be a useful reference.

But really any example that walks the reader from end to end with detailed instructions would be highly appreciated!

— Reply to this email directly or view it on GitHub https://github.com/Element-Research/rnn/issues/148#issuecomment-193232436 .

coodoo commented 8 years ago

@Sandy4321 Yes, I mentioned sunny side up project only because they provided tweet dataset, not because they are using RNN for sentiment analysis, I was planning to implement one with RNN but to no avail hence asking help here :)

Sandy4321 commented 8 years ago

Did you checked recommend semeval 16 from git, She uses word2vec and lastm lasagna On Mar 10, 2016 18:43, "Jeremy Lu" notifications@github.com wrote:

@Sandy4321 https://github.com/Sandy4321 Yes, I mentioned sunny side up project only because they provided tweet dataset, not because they are using RNN for sentiment analysis, I was planning to implement one with RNN but to no avail hence asking help here :)

— Reply to this email directly or view it on GitHub https://github.com/Element-Research/rnn/issues/148#issuecomment-195102820 .

coodoo commented 8 years ago

@Sandy4321 Thanks for pointing out semeval, their char-based LSTM for sentiment analysis example looks very interesting, will have a thorough study today.

It would be prefect if there's a RNN implementation so that it could be run on OpenCL (e.g. mackbook pro) instead of CUDA, maybe @nicholas-leonard could help? :)

Sandy4321 commented 8 years ago

try this https://github.com/youssefahres/EntitySentiment

https://github.com/Vict0rSch/deep_learning/tree/master/keras/recurrent

https://github.com/itdxer/neupy/tree/release/v0.2.0

https://github.com/stevenxxiu/senti/tree/master/senti

https://github.com/dandxy89/DeepLearning_MachineLearning/tree/master/EmbeddingKeras

On Thu, Mar 10, 2016 at 10:20 PM, Jeremy Lu notifications@github.com wrote:

@Sandy4321 https://github.com/Sandy4321 Thanks for pointing out semeval, their char-based LSTM for sentiment analysis example looks very interesting, will have a thorough study today.

It would be prefect if there's a RNN implementation so that it could be run on OpenCL (e.g. mackbook pro) instead of CUDA, maybe @nicholas-leonard https://github.com/nicholas-leonard could help? :)

— Reply to this email directly or view it on GitHub https://github.com/Element-Research/rnn/issues/148#issuecomment-195160995 .

Sandy4321 commented 8 years ago

and this https://github.com/fchollet/keras/issues/1327 https://github.com/fchollet/keras/issues/631 https://github.com/fchollet/keras/issues/853

On Thu, Mar 10, 2016 at 10:20 PM, Jeremy Lu notifications@github.com wrote:

@Sandy4321 https://github.com/Sandy4321 Thanks for pointing out semeval, their char-based LSTM for sentiment analysis example looks very interesting, will have a thorough study today.

It would be prefect if there's a RNN implementation so that it could be run on OpenCL (e.g. mackbook pro) instead of CUDA, maybe @nicholas-leonard https://github.com/nicholas-leonard could help? :)

— Reply to this email directly or view it on GitHub https://github.com/Element-Research/rnn/issues/148#issuecomment-195160995 .

coodoo commented 8 years ago

Thanks for the links.

I went through semval16 example the other day and found it's code quite hard to understand (not sure it's due to the nature of lasagne or author's coding style). I also looked at various keras examples on LSTM but none of them are char-based.

Lastly, as a total newbie in deep learning and NLP, I'm really looking forward to examples built with torch so that it supports cltorch and clnn which can be run on macbook pro with OpenCL graphic card to make the computation time acceptable.

IMHO example like that could really showcase the power of rnn lib.

Sandy4321 commented 8 years ago

OpenCL graphic card

is it external card?

On Tue, Mar 15, 2016 at 3:47 AM, Jeremy Lu notifications@github.com wrote:

Thanks for the links.

I went through semval16 example the other day and found it's code quite hard to understand (not sure it's due to the nature of lasagne or author's coding style). I also looked at various keras examples https://github.com/fchollet/keras/tree/d229c4784505346e6a039cf2bdd5cbca3ce9e648/examples on LSTM but none of them are char-based.

Lastly, as a total newbie in deep learning and NLP, I'm really looking forward to examples built with torch so that it supports cltorch and clnn which can be run on macbook pro with OpenCL graphic card to make the computation time acceptable.

IMHO example like that could really showcase the power of rnn lib.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Element-Research/rnn/issues/148#issuecomment-196705561

nicholas-leonard commented 8 years ago

@coodoo @Sandy4321 We (me, @sagarwaghmare69, @ywelement) just completed wrapping the Twitter Sentiment140 dataset into a wrapper. @sagarwaghmare69 will be working on a example using the dataset.

nicholas-leonard commented 8 years ago

@coodoo @Sandy4321 https://github.com/Element-Research/rnn/blob/master/examples/twitter_sentiment_rnn.lua