Code Monkey home page Code Monkey logo

entitysentiment's Introduction

EntitySentiment

Entity level sentiment analysis for product reviews using deep learning

The objective of this project is to analyze Amazon reviews at the entity level: That is, looking at most most important aspects of a particular item, we would like to be able to predict the sentiment for each of these aspects on the same model. For more information about the methodology and theory please refer to:

http://cs224d.stanford.edu/reports/AhresY.pdf

In this code we implemented 4 models: Recurrent Neural Network (RNN) Bidirectionnal Recurrent Neural Network (BRNN) Weighted Recurrent Neural Network (WRNN): weighting cost function to balance training data Long Short Term Memory Neural Network (LSTM) Bidirectionnal Long Short Term Memory Neural Network (BLSTM)

In order to install and run the current implementation, you need:

  • Python 2.7
  • Install the required packages summarized in requirement.txt

To run an example you simply type: python RunRNN.py

However, we are unable to release the full data set we worked on. We hereby share parts of it that allow the models to run. It can be found on example_data folder.

entitysentiment's People

Contributors

sktnikolaus avatar youssefahres avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

entitysentiment's Issues

Explanation for Dataset .

Explanation for output vector . What are they representing and how to decode them .
like : for "Fun camera, not a fun amazon experience"
output is " 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 "
what are these "0"s and "1"s are representing .

咨询

请问下获取京东评论里的找不到输入输出路径呢,那个数据集没有,在哪儿找呢

Error in RunRNN_lstmw.py

The line 6 has to be changed from from blstm_sw import BLSTM to from blstm_sw import BLSTM. It is just a simple import error.

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

After running
python RunRNN.py
for a long while, at the end, I get this error:


  [33600]: mean loss 0.121167
  Seen 34000 in 1886.55 s
  [34000]: mean loss 0.137862
  Seen 34400 in 1909.40 s
  [34400]: mean loss 0.1298
  Seen 34800 in 1932.91 s
  [34800]: mean loss 0.120234
  [35000]: mean loss 0.121845
SGD complete: 35000 examples in 1948.43 seconds.
Traceback (most recent call last):
  File "RunRNN.py", line 85, in <module>
    score1.append(build_confusion_matrix(X_dev,Y_dev,model))
  File "/scratch2/debate_tweets/sentiment/EntitySentiment/misc.py", line 139, in build_confusion_matrix
    conf_arr[true_label,guessed_label]+=1
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

Error in base.py

ValueError Traceback (most recent call last)
in ()
10 model = BRNN(L0, U0=None, alpha=0.05, rseed=10, bptt=20)
11 #print w
---> 12 curve = model.train_sgd(X,Y,idxiter_random,None,400,400)
13 score1.append(build_confusion_matrix(X_dev,Y_dev,model))
14 print score1

/Users/Desktop/Python/EntitySentiment-master/nn/base.py in train_sgd(self, X, y, idxiter, alphaiter, printevery, costevery, devidx)
384 printevery=10000, costevery=10000,
385 devidx=None):
--> 386 if idxiter==None: # default training schedule
387 idxiter = xrange(len(y))
388 if alphaiter == None: # default training schedule

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.