Giter Club home page Giter Club logo

wikipedia-jargon's Introduction

Wikipedia jargon analysis

What words are used predominantly on Simple Wikipedia pages, vs. those on English Wikipedia?

Installation

pip install -r requirements.txt

Usage

The pipeline goes:

  • grab_subjects.py [list of Wikipedia categories, separated by spaces]

  • grab_text.py [list of title files]

  • make_tf_differences.py [n-grams] [text directory] (where n-gram refers to 1 for unigrams, 2 for bigrams, etc)

  • make_tables.py [term-diffs-dir]/*

The categories that I used were:

  • Anthropology
  • Archaeology
  • Astronomy
  • Biology
  • Chemistry
  • Economics
  • Engineering
  • Linguistics
  • Mathematics
  • Music
  • Physics
  • Psychology
  • Sociology

Initial analysis

I started off doing this on a small scale, with the math pages. That analysis is available in the initial-math-analysis folder and the notebook here: http://nbviewer.ipython.org/github/samzhang111/wikipedia-jargon/blob/master/initial-math-analysis/Jargon%20in%20Mathematics.ipynb

The included data files are

  • simple-wiki-math.xml --> Simple Wikipedia math category pages
  • wiki-math.xml --> English Wikipedia math category pages
  • *.p --> pickled version of cleaned up, dictionary-fied content of the above
  • term_differences.csv --> output, the actual differences in term frequencies

Warning

I wrote this code in 2015. Since then, I think I've gotten a little better at structuring these types of exploratory projects :) (and everything is Python 3 now!). I touched it up so I could finally publish a blog post about this: https://sam.zhang.fyi/projects/2017-04-25-wikipedia-jargon/.

wikipedia-jargon's People

Contributors

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