Giter VIP home page Giter VIP logo

Comments (5)

erickpeirson avatar erickpeirson commented on September 15, 2024

@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.

erickpeirson avatar erickpeirson commented on September 15, 2024

This will be TETHNE-130

from tethne.

erickpeirson avatar erickpeirson commented on September 15, 2024

@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.

erickpeirson avatar erickpeirson commented on September 15, 2024

@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.

hedgy123 avatar hedgy123 commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.