Skip to main content

This package provides an annotation UI for arbitrary dataset in json format.

Project description

jupyter json annotator

This package provides an annotation UI for arbitrary dataset in json format.

Install

pip install jupyter-annotator

Usage

# Normal usage
from jupyter_annotator import Annotator
problems = [{
    "problem": "Where would I not want a fox? (a problem from coommonsenseQA)",
    "options": {
        "a": "hen house", "b": "england", "c": "mountains", "d": "english hunt", "e": "california"
    },
    "answer": "a"
}]

annotator = Annotator(problems)
annotator.start()
# Add custom fields
from jupyter_annotator import Annotator
problems = [{
    "problem": "What is the perimeter of a rectangular field whose diagonal is 5 m and width is 3 m ?",
    "options": {
        "a":"20 m", "b":"15 m", "c":"14 m", "d":"10 m", "e":"25 m"
    },
    "answer": "c"
}]

custom_fields = [("rationale", str, 100)] # (field_name, type, max_length)
annotator = Annotator(problems, custom_fields=custom_fields)
annotator.start()
# Skip fields
from jupyter_annotator import Annotator
problems = [{
    "id": 1,
    "problem": "Where would I not want a fox? (a problem from coommonsenseQA)",
    "options": {
        "a": "hen house", "b": "england", "c": "mountains", "d": "english hunt", "e": "california"
    },
    "answer": "a"
}]

filtered_fields = ['id'] 
annotator = Annotator(problems, filtered_fields=filtered_fields)
annotator.start()
  • Normal Usage

  • Add custom fields

  • Skip fields

References

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

jupyter-annotator-1.1.1.tar.gz (4.1 kB view hashes)

Uploaded Source

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