Giter Site home page Giter Site logo

ntm's Introduction

#NTM + Doc2vec (version 0.2 alpha) Requirements: Version: Python 2.7+ The program requires some of the python packages including gensim, numpy, scipy, pickle and so on. If your python distribution misses any package it will produce an error called "No module found named ... (Module name)"

doc2vec_TopicVector_NonDet.py: I used the code to generate the results. Here you will find a method named "Train" that is NTM part in addition to doc2vec. I also included an evaluation metric for classification and saving only the topic vectors.

word2vec.py: I changed a little bit in the file to initialize some values such as ntopics (# of Topics) and so on.

NTM (version 0.1 alpha)

Neural Network Topic Modeling

Requirements: Version: Python 2.7+ The program requires some of the python packages including gensim, numpy, scipy, pickle and so on. If your python distribution misses any package it will produce an error called "No module found named ... (Module name)"

Steps to run the code:

  1. Process the data as you do for giving input to word2vec or doc2vec or you may use the preprocessData.py if it fits on your datasets.
  2. Open the file doc2vec.py. Change the line of the "main" function as follow: sentences = LabeledLineSentence(file_path)

for my case: sentences = LabeledLineSentence('./ntm_3group_news.txt').

The data file is in the same directory the doc2vec.py exists. 3) To save the model of word2vec and doc2vec for further use, you can use the doc2vec python implementation. However, to save the P(ngram|topic) and P(topic|document) distribution, you can dump the variable value (w_lt, w_ld). You will find sample a code in the saveData.py to do so.

ntm's People

Contributors

dshamanta avatar

Watchers

Sakala Venkata Krishna Rohit avatar

Forkers

nagyistge

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.