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

hi, i want to use the tensorflow as keras's backend,how i should modify #10

Open cyzLoveDream opened 6 years ago

cyzLoveDream commented 6 years ago

like title..

ruidan commented 6 years ago

The Keras version for this code is 1.2.1.

If you want to keep the Keras version unchanged, you need to check which version of tensorflow will work with it. You don't need to change much on the code in this way. You may simply switch the backend of Keras from theano to tensorflow and try if it works.

If you want to upgrade Keras to a version that is compatible with more recent tensorflow versions, you need to modify the code a bit. As the api of Keras 2 is different in many places. You may need to read their release documentation.

harpaj commented 6 years ago

Hello @cyzLoveDream @ruidan, I have created a version of the code using Python3, Tensorflow and recent versions of all dependencies, including Keras, in my fork here: https://github.com/harpaj/Unsupervised-Aspect-Extraction. In the master branch, I tried to keep all other things unchanged, results are very similar to those reported in the paper. Most credit goes to @alexeyev, I used some of the changes in his fork.

Hope this helps someone!

ruidan commented 6 years ago

@harpaj Thank you! That is very helpful :)

cyzLoveDream commented 6 years ago

@harpaj Thank you very much