Skip to main content

Data annotation done right: easy, fun, hyper-productive, and inducing insight.

Project description

Hover

Imagine editing a picture layer by layer, not pixel by pixel, nor by splashing paint.

We can apply this idea to datasets.

PyPI Stage PyPI Version Build Workflow Codacy Grade Codacy Coverage

Demo


Hover is a machine teaching library that enables intuitive and effecient supervision. In other words, it provides a map where you hover over and label your data... differently. For instance, you can:

  • Binder :seedling: annotate an intuitively selected group of data points at a time
  • Binder :ferris_wheel: throw a model in the loop and exploit active learning
  • Binder :whale: cross-check with Snorkel-based distant supervision

Check out @phurwicz/hover-binder for a complete list of demo apps.

:flags: Latest Announcements

  • Dec 12 Common usage workflows are now available in hover.recipes. Much cleaner code!
  • Dec 6 Video tutorials coming soon! The first one is projected to be available by Dec 15.

:flight_departure: Quick Start

Step 0: load your dataset and compute its 2-d embedding

from hover.core.dataset import SupervisableTextDataset

dataset = SupervisableTextDataset(
    # 'raw' contains the data to be supervised
    raw_dictl=[{"content": "this is great"}],
    # train/dev/test sets can be empty
    # train_dictl=[],
    dev_dictl=[{"content": "this is awesome", "mark": "POSITIVE"}],
    test_dictl=[{"content": "this is meh", "mark": "NEGATIVE"}],
    # specify feature/label keys
    feature_key="content",
    label_key="mark",
)

# define a vectorizer for your feature, then call dimensionality reduction
nlp = spacy.load('en')
vectorizer = lambda text: nlp(text).vector
dataset.compute_2d_embedding(vectorizer, "umap")

Step 1: choose a recipe (or create your own with examples)

from hover.recipes.experimental import (
    simple_annotator,
    active_learning,
    snorkel_crosscheck,
)

handle = simple_annotator(dataset)

Step 2: fire it up

Hover uses bokeh to deliver its annotation interface:

# Option 1: in Jupyter
from bokeh.io import show, output_notebook
output_notebook()
show(handle)

# Option 2: in app.py (`bokeh serve app.py` in the command line)
from bokeh.io import curdoc
doc = curdoc()
handle(doc)

# Option 3: elsewhere as an embedded app
from bokeh.server.server import Server
server = Server({'my-app': handle})
server.start()

:package: Installation

Python: 3.6+

OS: tested on Mac & Linux

To get the latest release version, you can use pip:

pip install hover

Installation through conda is not yet available. Please open an issue if you would like conda or conda-forge support.

:flamingo: Features

Here we attempt a quick comparison with a few other packages that do machine teaching:

Package Hover Prodigy Snorkel
Core idea supervise like editing a picture scriptable active learning programmatic distant supervision
Annotates per batch of just the size you find right piece predicted to be the most valuable the whole dataset as long as it fits in
Supports all classification (text only atm) text & images, audio, vidio, & more text classification (for the most part)
Status open-source proprietary open-source
Devs indie Explosion AI Stanford / Snorkel AI
Related many imports of the awesome Bokeh builds on the Thinc/SpaCy stack Variants: Snorkel Drybell, MeTaL, DeepDive
Vanilla usage define a vectorizer and annotate away choose a base model and annotate away define labeling functions and apply away
Advanced usage combine w/ active learning & snorkel patterns / transformers / custom models transforming / slicing functions
Hardcore usage exploit hover.core templates custom @prodigy.recipe the upcoming Snorkel Flow

Hover claims the best deal of scale vs. precision thanks to

  • the flexibility to use, or not use, any technique beyond annotating on a "map";
  • the speed, or coarseness, of annotation being literally at your fingertips;
  • the interaction between multiple "maps" that each serves a different but connected purpose.

:book: Resources

Documentation

  • Contains API references of the most crucial components.
  • A lot more is on the way! (video tutorials, for example)

Dependencies

  • ./requirements-test.txt lists additional dependencies for the test suite.
  • ./requirements-dev.txt lists recommended packages for developers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hover-0.3.1.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

hover-0.3.1-py2-none-any.whl (38.1 kB view details)

Uploaded Python 2

File details

Details for the file hover-0.3.1.tar.gz.

File metadata

  • Download URL: hover-0.3.1.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200323 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for hover-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8589f9cabac6bceb832efb06d8d4c03d69930c4cd686b33d2e3273e60c734f38
MD5 3cc7c63289d6a9d05d8d6a3b228f51a3
BLAKE2b-256 1e286fb438088d0003428d5809ead43536e0664ee0f3d81c08ec565bb7d72556

See more details on using hashes here.

File details

Details for the file hover-0.3.1-py2-none-any.whl.

File metadata

  • Download URL: hover-0.3.1-py2-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200323 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for hover-0.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 29ab540d4ee049dab74e57769af2d53e9f43d03fd80c1b917aeb6c972d958bc1
MD5 0ced8ab069d3a80999f9dee4ac977214
BLAKE2b-256 2fc144813cd068584e912865484a04804b309048f4cb5fd44e3aafb2f712d888

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page