Coder Social home page Coder Social logo

sandy4321 / py-semi-lda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fancyspeed/semi-lda

0.0 2.0 0.0 26 KB

Semi-supervised Latent Dirichlet Allocation (LDA)

Home Page: https://www.cs.princeton.edu/~blei/topicmodeling.html

Python 98.46% Shell 1.54%

py-semi-lda's Introduction

Description

Semi-supervised LDA, which allows labelling of some documents in training, and a rule file to assign seed words for each topic.

Besides topics appear in training data and the rule file, new topics can also be learned.

Data format

  • training data:

    label1,label2 word1:num1 word2:num2 ...

    word3:num3 word4:num4 ...

  • rule file:

    label1 word1,word2 ...

    label2 word3,word4 ...

(also compatible with LibSVM.)

Example

  • train:

    $ python lda_train.py -train train.txt -rule rule.txt -k 5 -alpha 0.1 -beta 0.01 -burnin 50 -iter 50 -model model.txt -dump topic_words.txt

  • inference:

    $ python lda_infer.py -model model.txt -test test.txt -output output.txt -burnin 50 -iter 50

Evaluation

Model performance is evaluated by log-likelihood.

py-semi-lda's People

Contributors

fancyspeed avatar

Watchers

 avatar  avatar

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.