Git Product home page Git Product logo

sociothese's Introduction

A quick try at topic models (see discussion).

Run 0.build.r from the sociothese folder to replicate the model and plots. The script sets a few model parameters and estimates LDA models:

  1. first on summaries that match the relig* keyword: N = 220 (runs in one hour)
  2. and then on the full sample: N = 3,219 (much slower, needs a dozen hours at least).

The functions come from Grün and Hornik 2011 or from this example (in Japanese).

Here's what the topic models for the full sample look like in network form, trimmed down to the most common terms that appear in the summaries:

Instead of working with a network object, you can also turn the result of the topic.graph function into a d3.js object with Christopher Gandrud's d3Network function:

library(devtools)
install_github("christophergandrud/d3Network")
library(d3Network)
d3SimpleNetwork(as.data.frame(g), file = "d3Network.html", 
                fontsize = 14, width = 800, height = 800, opacity = 1)

The result will be a clickable object on which you can underline the nodes with highest degree (the connecting terms that appear in many summaries):

If the sociothese repo is made public, this link should display the d3 network.

sociothese's People

Contributors

briatte avatar

Watchers

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