-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError while trying to create a topicmodel #56
Comments
Ack, this bug won't die. There were a couple of places where we assumed that metadata records and feature sets were complete for all papers in a corpus, which is often false. This should be an easy fix, hopefully can get a patch out next week. Thanks for reporting this!
|
Hi Erick, Any update on rectifying this issue?? |
Yes, sorry it took so long. The patched version is available as release v0.6.3.3-beta2 , or via PyPI. If you're using pip, you should be able to just do: $ pip uninstall tethne
$ pip install tethne --pre Let me know whether this solves the problem. |
Hi Eric, You may also have noticed the Mallet path error in Window or received a query from some other tethne user. When I try to build the model using following syntax, I am getting the following error in windows. However the program runs fine in Linux. model = M.build(Z=50, max_iter=300, prep=True) OSError Traceback (most recent call last) C:\Anaconda\lib\site-packages\tethne\model\managers__init__.pyc in build(self, Z, max_iter, prep, **kwargs) C:\Anaconda\lib\site-packages\tethne\model\managers__init__.pyc in prep(self, meta) C:\Anaconda\lib\site-packages\tethne\model\managers\mallet.pyc in _generate_corpus(self, meta) C:\Anaconda\lib\site-packages\tethne\model\managers\mallet.pyc in _export_corpus(self) OSError: MALLET path invalid or non-existent. I wonder if windows should be give Mallet path in any specific format? |
Hi @mubashirqasim, Can you post your code for initializing the MALLETModelManager? Its constructor accepts a parameter mallet_path, and I'm specifically interested in what you're passing there. Tethne is almost entirely untested in Windows. Maybe if I get some time/funding I'll start pushing it in that direction, but until then I'm afraid that you'll find plenty of odd things when you run Tethne in Windows. |
Hi Eric, Thanks for the prompt response. Here is the code to call MALLETModelManager. from tethne.model.managers import MALLETModelManager |
Flagging this for a future Windows-compatible version |
This may be fixed in v0.8-beta. If anyone has a chance to test this in Windows, I'd appreciate hearing about it! |
Hi there,
I have been trying to follow the tutorial on topic modelling on the main tethne website. I installed anaconda, tethne, nltk, and also mallet. But when I run the line
MyLDAModel = MyManager.build(Z=50, max_iter=300, prep=True)
i get the following error
Traceback (most recent call last):
File "", line 1, in
File "//anaconda/lib/python2.7/site-packages/tethne/model/managers/init.py", line 108, in build
self.prep()
File "//anaconda/lib/python2.7/site-packages/tethne/model/managers/init.py", line 89, in prep
self._generate_corpus(meta)
File "//anaconda/lib/python2.7/site-packages/tethne/model/managers/mallet.py", line 152, in _generate_corpus
vocab=self.D.features[self.feature]['index'] )
File "//anaconda/lib/python2.7/site-packages/tethne/writers/corpora.py", line 59, in to_documents
meta += [ str(metadict[p][f]) for f in metakeys ]
KeyError: '10.1525/rac.2006.16.1.95'
I will appreciate all the help in this regard
The text was updated successfully, but these errors were encountered: