openai / generating-reviews-discovering-sentiment

Code for "Learning to Generate Reviews and Discovering Sentiment"
https://arxiv.org/abs/1704.01444
MIT License
1.51k stars 379 forks source link

Add a requirements.txt #3

Open sjqtentacles opened 7 years ago

sjqtentacles commented 7 years ago

Getting a weird module version issue with tensorflow and the method 'unpack' not being an attribute. Would be helpful if a requirements.txt file was included to use with virtualenv.

dribnet commented 7 years ago

I'm similarly having trouble with the html dependency - cannot run the code because html.unescape is not found (even after installing html via pip).

edit: aha, this seems to imply python3. so it would be good to note that.

update: code now works fine for me with Python 3.5.3 and tensorflow (0.12.1).

bitliner commented 7 years ago

@dribnet for python 2 you can use text=HTMLParser.HTMLParser().unescape(text)

@Nixonite you might run it in anaconda, that would make it easier to make it work I think

dthiagarajan commented 7 years ago

Using HTMLParser doesn't work exactly like you would want it to - I think you found this in #2 as well. I'm not sure what the way to fix it is in python 2 is, though.

igauravsehrawat commented 6 years ago

Use python3 and pip3.

Added requirements.txt in this PR. #43

hoangcuong2011 commented 6 years ago

This should work well with python 3.6, but not python 2.7.

I did a mistake with html.unescape(). Because I use python 2.7, I did change the code to

HTMLParser.HTMLParser().unescape(text)

After I import HTMLParser

This turned out to be a bad idea.

So again, my recommendation is to use python 3.6 to run this amazing work.

Hope this helps other people who have this problem as well.