sudhof / politeness

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

incompatibility issue with machine learning files Python 3.6 #8

Open XinYi-Karen-Zheng opened 5 years ago

XinYi-Karen-Zheng commented 5 years ago

I am running model.py and got the following error. It seems like the script has incompatibility issue with sklearn in Python 3.6.

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'

How could I solve this??

cristiandnm commented 5 years ago

Could you try using the Politeness transformer in ConvoKit instead (http://convokit.cornell.edu)? It should give you more flexibility and control, as it generates the politeness features directly.

We have integrated the Politeness functionality into ConvoKit, leaving this here only as a legacy repository.