Giter VIP home page Giter VIP logo

wikiwords's Introduction

Frequency of words in the English 2012 Wikipedia

This Python module can be used to quickly retrieve absolute word frequency for English language, as used in Wikipedia articles as of year 2012.

Author: Paweł Foremski <[email protected]>, IITiS PAN www.iitis.pl

Usage

>>> import wikiwords
>>> wikiwords.freq("monty")
6.348454761413523e-06
>>> wikiwords.occ("python")
18972
>>> wikiwords.freq("no such word", lambda x: 1./len(x))
0.08333333333333333

Installation

$ sudo pip install wikiwords

Details

Wikipedia files were downloaded on 23.11.2012

The corpus was filtered:

  1. all words containing non-latin letters were removed (A-Z)
  2. in single files (see below), words with frequency < 5e-7 were removed
  3. in the final file (28 files merged), words with f < 5e-8 were removed
  4. all words shorter than 2 characters were removed (see below)

The final corpus contains over 100,000 words with over 2 billion occurances.

For copyright information on data, see
http://en.wikipedia.org/wiki/Wikipedia:Copyrights

The Python source code is licensed to you under the GNU GPL v3

See "the making of/" subdirectory for details on how the data was created.

The single letter words

The single-letter words were removed by the gensim parser. In order to address this, relevant frequencies and number of occurances were artifically injected from the Google Web Trillion Word Corpus, described by Thorsten Brants and Alex Franz in 2006 [1]. For more information -- and for an example of possible application of wikiwords.py -- see Peter Norvig ngrams site at [2].

  1. http://googleresearch.blogspot.com/2006/08/all-our-n-gram-are-belong-to-you.html
  2. http://norvig.com/ngrams/

wikiwords's People

Contributors

pforemski avatar

Watchers

James Cloos avatar Charles J. Daniels 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.