sudhof / politeness

Sample implementation of a politeness model, trained on the Stanford Politeness Corpus
Apache License 2.0
147 stars 41 forks source link

Can't run on Python 3.6.2 according to documentation #5

Closed nasifimtiazohi closed 6 years ago

nasifimtiazohi commented 7 years ago

I'm having trouble running this tool. I have explained my problems in the question asked here- https://stackoverflow.com/questions/46410220/cannot-find-numpy-module-and-python-setup-py-egg-info-failed-with-error-code-1

Probably there's some problem with installing scipy or setup files in my python library. I just thought if you guys have any idea about this? @sudhof @cristiandnm

cristiandnm commented 7 years ago

Thanks for trying this out. For questions regarding the port to Python 3, please contact @meyersbs bsm9339@rit.edu (Benjamin Meyers). We are also working on another Python 3 version that uses spaCy instead of Stanford Parser, so stay tuned.

cristiandnm commented 7 years ago

you can test the spaCy version here: https://github.com/vegetable68/politeness_with_spacy This is untested, so please let us know what your experience is.

meyersbs commented 7 years ago

@nasifimtiazohi Which operating system are you using? If you are on Ubuntu (or similar), you will likely need to run sudo apt install python3-scipy and sudo apt install python3-numpy. Unfortunately, this will only work for the system level Python 3, not your pipenv.

[Edit] It's also possible that chocolately installed Python 3 incorrectly -- I have no experience with that software, nor have I tested this code on a Windows system.

nasifimtiazohi commented 6 years ago

this ran fine on ubuntu. had to switch from windows. sorry to come back so late.

XinYi-Karen-Zheng commented 5 years ago

@nasifimtiazohi Hi! Am wondering if you successfully ran model.py on ubuntu with Python3.6? I am also using Python3.6. After changing many lines to fit Python3 syntax(for example, changing cPickle to pickle), I still encountered the following error:

Traceback (most recent call last): File "model.py", line 111, in probs = score(doc) File "model.py", line 94, in score probs = clf.predict_proba(X) File "/home/karenzheng/.local/lib/python3.6/site-packages/sklearn/svm/base.py", line 616, in predict_proba self._check_proba() File "/home/karenzheng/.local/lib/python3.6/site-packages/sklearn/svm/base.py", line 582, in _check_proba if not self.probability: AttributeError: 'SVC' object has no attribute 'probability'

Have you encountered the same error when you ran the model? If so, how did you solve it?

nasifimtiazohi commented 5 years ago

@XinYi-Karen-Zheng , I don't exactly remember but I think I used python 2.7 on ubuntu to run this and not python3.

XinYi-Karen-Zheng commented 5 years ago

@nasifimtiazohi I will try Python 2.7 then. Thanks!

wil2210 commented 5 years ago

@nasifimtiazohi Hi, did you manage to install the politeness package ? From what I have tried, the pip install does not work. And I cannot figure out how to use it in bash once you have linked the url to the stanford coreNLP server ?