Open drevicko opened 7 years ago
deleting the WordNetCorpusReader from self.sh in the plugins activate()
method does indeed fix the problem.
It seems that class is not piclable, at least not without some massaging.
That is not happen to me:
Senpy version 0.8.7 Server running on port 0.0.0.0:5000. Ctrl+C to quit [nltk_data] Package punkt is already up-to-date! [nltk_data] Downloading package wordnet to /root/nltk_data... [nltk_data] Package wordnet is already up-to-date! INFO:senpy.extensions:Plugin activated: sentiment-basic ^CBye! INFO:senpy.extensions:Plugin deactivated: emotion-wnaffect INFO:senpy.extensions:Plugin deactivated: Ekman2FSRE INFO:senpy.extensions:Plugin deactivated: sentiment-140 INFO:senpy.extensions:Plugin deactivated: Ekman2PAD INFO:senpy.extensions:Plugin deactivated: ExamplePlugin INFO:senpy.extensions:Plugin deactivated: sentiment-meaningCloud INFO:senpy.extensions:Plugin deactivated: emotion-anew INFO:senpy.extensions:Plugin deactivated: affect INFO:senpy.extensions:Plugin deactivated: sentiment-vader INFO:senpy.extensions:Plugin deactivated: sentiment-basic
Are you using senpy 0.8.7 version?
On the other hand, in case the problem does not a version problem, i think deleting WordNetCorpusReader from self.sh is a good idea
Maybe it's a python 2/3 thing? I've been using python 3 here.
But yes, not shelving the WordnetCorpusBuilder could be a good idea.
fyi: I've been building a multilingual wordnet in python 3 (since I can't do pos tagging). I'm converting wn1.6 ids in wn-affect to wn3.0 ids so I can use nltk.corpus.wordnet
(which uses wn3.0) and don't need wn1.6.
I'll try to have a look once I get my next version running.
I would guess it's my nltk version that's different. I can investigate if you prefer to keep the WordnetCorpusBuilder in the shelf.
btw: I've built a similar plugin (will be adding it here soon - it's in my fork if you're interested). The main things are 1) it uses the "open multilingual wordnet" in combination with NUIG's polylingual wordnet, so it covers some 40 languages and 2) it doesn't do word sense disambiguation, but instead counts a word if ANY of it's senses are in wordnet-affect emotion classes. Oh, I've also modified/expanded the classes used somewhat, especially for disgust, and added surprise. It uses wn-affect heirarchy levels 5, 6 and 7. Not yet tested in python 2 (hence I've not made a pull request yet).
This looks like an object fairly deep in an object heirarchy. Could it be a file object stored in the WordNetCorpusReader??