Comments (5)
@ebaggott Sorry it has taken me a while to reply. Please stand by while I bring the docs up to date -- expect an update in this thread within the next few days.
from tethne.
This will be TETHNE-130
from tethne.
@ebaggott Just an update: DTM support was removed in v0.7, but I'm bringing it back for v0.8.1. I took it out because there was a nasty memory leak, but it looks like someone patched that so we're back in business. I'll let you know when it's ready to test.
In the meantime, can I get your help developing our new Q/A group, here? It would be great if you could create questions about things you've already figured out (and post your answer!), so that others who are getting started can benefit. I really appreciate it!
from tethne.
@ebaggott Ok, DTM is back! For now it's in v0.8.1.dev5, which means that you'll have to upgrade Tethne with the --pre flag:
pip install -U tethne --pre
The API is a little different (see the example in the docstring, below). It would be great to get your feedback on this, and any ideas for how to make it easier to use. I'll write up some better documentation soon.
Here's the docstring for reference:
Provides a wrapper for Dynamic Topic Model by David Blei et al [1][2].
In order to use this class you must have already compiled the ``dtm``
package by Blei and Gerrish, located
[here](https://github.com/blei-lab/dtm). If you run into memory issues you
may want to try [this fork](https://github.com/fedorn/dtm).
You must provide the path to the binary executable (usually called ``main``)
either by setting the DTM_PATH environment variable, or by passing
``dtm_path='/path/to/dtm/main'`` to the constructor.
[1] D. Blei and J. Lafferty. Dynamic topic models. In Proceedings of the
23rd International Conference on Machine Learning, 2006.
[2] S. Gerrish and D. Blei. A Language-based Approach to Measuring
Scholarly Impact. In Proceedings of the 27th International Conference on
Machine Learning, 2010.
Examples
--------
.. code-block:: python
>>> from tethne.readers.wos import read
>>> from nltk.tokenize import word_tokenize
>>> corpus = read('/path/to/my/data')
>>> corpus.index_feature('abstract', word_tokenize)
>>> from tethne import DTMModel
>>> model = DTMModel(corpus,
... featureset_name='abstract',
... dtm_path='/path/to/dtm/main')
>>> model.fit(Z=5)
In practice you will want to do some filtering prior to modeling.
from tethne.
Sorry, I know it's been at least a year since this was last looked at, but I was wondering if v0.8.1.dev5 is still the right version of tethne to use for DTM? I do see dtm.py and dtm.pyc in this version's model/corpus, but nothing in init.py, so as a result when I try to use dtm.from_gerrish I get
AttributeError: 'module' object has no attribute 'dtm'
Could you please help. Thanks!
from tethne.
Related Issues (20)
- direct_citation creates undirected graph with no node attributes HOT 11
- Possibility to ignore certain WoS-tags HOT 5
- value error importing metadata zotero RDF HOT 1
- Transform FeatureSet HOT 5
- Using Mallet file as corpus for the LDA model HOT 6
- RuntimeError: MALLET import-file failed with exit code 127 HOT 9
- ImportError: failed to find libmagic. Check your installation` HOT 1
- attachment_probability does not work in v0.8 HOT 8
- Error in reading all wos files in a folder HOT 2
- availability of topic coherence measure HOT 1
- Missing module HOT 2
- ImportError: cannot import name _iterable HOT 1
- Tethne Install Error setup.py egg_info HOT 3
- AttributeError: 'module' object has no attribute 'wos'
- KeyError: 'date' same error in generating co-author and co-citation graphs HOT 1
- 'module' object has no attribute 'wos' HOT 1
- Installation error HOT 4
- Documentation for 0.8 incorrectly specifies what's returned in a direct_citation graph
- authorKeywords and keywordsPlus are inversed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tethne.