Coder Social home page Coder Social logo

nikolayvoronchikhin / ldavis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpsievert/ldavis

0.0 2.0 0.0 24.6 MB

R package for web-based interactive topic model visualization.

License: Other

Makefile 0.14% R 29.03% HTML 0.48% CSS 0.35% JavaScript 70.00%

ldavis's Introduction

LDAvis

Build Status

R package for interactive topic model visualization.

LDAvis icon

LDAvis is designed to help users interpret the topics in a topic model that has been fit to a corpus of text data. The package extracts information from a fitted LDA topic model to inform an interactive web-based visualization.

Installing the package

  • Stable version on CRAN:
install.packages("LDAvis")
  • Development version on GitHub (with devtools):
devtools::install_github("cpsievert/LDAvis")

Getting started

Once installed, we recommend a visit to the main help page:

library(LDAvis)
help(createJSON, package = "LDAvis")

The documentation and example on the bottom of that page should provide a quick sense of how to create (and share) your own visualizations. If you want more details about the technical specifications of the visualization, see the vignette:

vignette("details", package = "LDAvis")

Note that LDAvis itself does not provide facilities for fitting the model (only visualizing a fitted model). If you want to perform LDA in R, there are several packages, including mallet, lda, and topicmodels.

If you want to perform LDA with the R package lda and visualize the result with LDAvis, our example of a 20-topic model fit to 2,000 movie reviews may be helpful.

LDAvis does not limit you to topic modeling facilities in R. If you use other tools (MALLET and gensim are popular), we recommend that you visit our Twenty Newsgroups example to help quickly understand what components LDAvis will need.

Sharing a Visualization

To share a visualization that you created using LDAvis, you can encode the state of the visualization into the URL by appending a string of the form:

"#topic=k&lambda=l&term=s"

to the end of the URL, where "k", "l", and "s" are strings indicating the desired values of the selected topic, the value of lambda, and the selected term, respectively. For more details, see the last section of our Movie Reviews example, or for a quick example, see the link here:

https://ldavis.cpsievert.me/reviews/vis/#topic=3&lambda=0.6&term=cop

Video demos

More documentation

To read about the methodology behind LDAvis, see our paper, which we presented at the 2014 ACL Workshop on Interactive Language Learning, Visualization, and Interfaces in Baltimore on June 27, 2014.

Additional data

We included one data set in LDAvis, 'TwentyNewsgroups', which consists of a list with 5 elements:

  • phi, a matrix with the topic-term distributions
  • theta, a matrix with the document-topic distributions
  • doc.length, a numeric vector with token counts for each document
  • vocab, a character vector containing the terms
  • term.frequency, a numeric vector of observed term frequencies

We also created a second data-only package called LDAvisData to hold additional example data sets. Currently there are three more examples available there:

  • Movie Reviews (a 20-topic model fit to 2,000 movie reviews)
  • AP (a 40-topic model fit to approximately 2,246 news articles)
  • Jeopardy (a 100-topic model fit to approximately 20,000 Jeopardy questions)

ldavis's People

Contributors

cpsievert avatar kshirley avatar marcinkosinski avatar crew102 avatar benmarwick avatar bmabey avatar dpmccabe avatar matthieubizien avatar

Watchers

James Cloos 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.