ruidan / Unsupervised-Aspect-Extraction

Code for acl2017 paper "An unsupervised neural attention model for aspect extraction"
Apache License 2.0
338 stars 117 forks source link

Problems with dependencies #3

Closed ghost closed 6 years ago

ghost commented 6 years ago

I'm solved the last issue using "KERAS_BACKEND=theano" before your example script. But I'm still having problems with python libraries. Take a look in my exit: (Sorry for my lack of knowledge, I'm a beginner with python)


2018-02-21 11:59:49,538 INFO Arguments:
2018-02-21 11:59:49,538 INFO   algorithm: adam
2018-02-21 11:59:49,538 INFO   aspect_size: 14
2018-02-21 11:59:49,538 INFO   batch_size: 50
2018-02-21 11:59:49,539 INFO   command: train.py --emb ../preprocessed_data/restaurant/w2v_embedding --domain restaurant -o output_dir
2018-02-21 11:59:49,539 INFO   domain: restaurant
2018-02-21 11:59:49,539 INFO   emb_dim: 200
2018-02-21 11:59:49,539 INFO   emb_path: ../preprocessed_data/restaurant/w2v_embedding
2018-02-21 11:59:49,539 INFO   epochs: 15
2018-02-21 11:59:49,539 INFO   maxlen: 0
2018-02-21 11:59:49,539 INFO   neg_size: 20
2018-02-21 11:59:49,539 INFO   ortho_reg: 0.1
2018-02-21 11:59:49,539 INFO   out_dir_path: output_dir
2018-02-21 11:59:49,539 INFO   seed: 1234
2018-02-21 11:59:49,539 INFO   vocab_size: 9000
Using Theano backend.
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10).  Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
 https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

2018-02-21 11:59:49,873 WARNING The cuda backend is deprecated and will be removed in the next release (v0.10).  Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
 https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.
2018-02-21 11:59:49,879 ERROR nvcc compiler not found on $PATH. Check your nvcc installation and try again.
Reading data from restaurant
 Creating vocab ...
   2061408 total words, 45041 unique words
  keep the top 9000 words
 Reading dataset ...
  train set
   <num> hit rate: 0.84%, <unk> hit rate: 3.73%
  test set
   <num> hit rate: 0.41%, <unk> hit rate: 4.22%
Number of training examples:  279885
Length of vocab:  9003
2018-02-21 12:00:00,628 INFO   Building model
Traceback (most recent call last):
  File "train.py", line 108, in <module>
    model = create_model(args, overall_maxlen, vocab)
  File "/home/italo/Unsupervised-Aspect-Extraction-master/code/model.py", line 51, in create_model
    from w2vEmbReader import W2VEmbReader as EmbReader
  File "/home/italo/Unsupervised-Aspect-Extraction-master/code/w2vEmbReader.py", line 4, in <module>
    import gensim
ImportError: No module named gensim```
ruidan commented 6 years ago

A few libraries is used. You need to install them first if there is an import error. In the example above, you need to install gensim that is used for training word embeddings.

ghost commented 6 years ago

Problem solved! Thank you (I had to install gensim 0.12.4)