Git Product home page Git Product logo

sift's Introduction

sift - Knowledge extraction from web data

sift is a toolkit for extracting models of entities and text from a corpus of linked documents.

What can it do?

sift is written in python, runs on Spark and is completely modular.

Out of the box, you can:

  • Convert wikipedia articles into json objects without all the mediawiki cruft
  • Extract entity relations from wikidata and align them with wikipedia mentions
  • Extract plain-text content html and WARC encoded web page crawls
  • Model entity popularity, alternative names and relatedness using inlinks
  • Preprocess text documents for machine learning pipelines
  • Push output into datastores like MongoDB and Redis

Quick Start

Install

pip install git+http://[email protected]/wikilinks/sift.git

Getting Started

To use sift, you'll need some data.

If you'd like to use Wikipedia data, sift includes a helper script for downloading the latest dumps.

Download the latest paritioned Wikipedia dump into the 'latest' directory.

download-wikipedia latest

Once you've got some data, take a look at the sample notebook: sift.ipynb.

Spark

sift uses Spark to process corpora in parallel.

If you'd like to make use of an existing Spark cluster, ensure the SPARK_HOME environment variable is set.

If not, that's fine. sift will prompt you to download and run Spark locally, utilising multiple cores on your system.

Datasets

Web KB datasets built from commoncrawl data are available under a public S3 bucket: s3.amazonaws.com/webkb

  • docs-2017 is built from news articles under the CC-NEWS collection from January to June 2017 (sample)
  • web-201707 is built from a full web crawl for July 2017 filted to English language pages (sample)

The web collection contains plain-text content, entity mentions and endpoint annotations extracted from 1.5 billion documents with over 4 billion web links. Data is encoded in a simple one-JSON-blob-per-line structure.

For example, the first document in the collection is an article from 2012 describing an upcoming tour by Nicki Minaj:

{
  "_id": "http://1019ampradio.cbslocal.com/2012/11/06/nicki-minaj-promises-man-bits-on-her-upcoming-tour/",
  "text": "Nicki Minaj has had quite the year. Currently in the U.K. on her Reloaded Tour she sat down with London DJ Tim Westwood and her U.K. Barbz for a Q & A session. While Nicki took questions from both Westwood and her fans one answer in particular caused the room to pay attention...",
  "links":[{
      "start": 0,
      "endpoint": 0.6358972797,
      "stop": 11,
      "target": "http://1019ampradio.cbslocal.com/tag/nicki-minaj"
    }, {
      "start": 145,
      "endpoint": 0.2769776554,
      "stop": 160,
      "target": "http://www.youtube.com/watch?v=vnyuhDBcQo0"
  }],
  "mentions":[{
      "start": 0,
      "stop": 11,
      "label": "PERSON"
    }, {
      "start": 53,
      "stop": 57,
      "label": "GPE"
    },
    // truncated
}

sift's People

Contributors

andychisholm avatar henningpeters avatar lephong avatar

Watchers

James Cloos avatar Justin Morgan 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.