A simple annotation widget for labeling examples with speech recognition support.
For an interactive demo check GitHub pages here.
- Interactive annotation: Yes/No/Skip buttons with Previous navigation
- Keyboard shortcuts: Alt+1-6 for quick navigation and actions
- Gamepad support: Controller input with push-to-talk speech
- Notes field: Text annotations with live speech transcription
uv pip install molabelfrom molabel import SimpleLabel
def render_example(example):
return f"<p>{example['text']}</p>"
# Create annotation widget
widget = SimpleLabel(
examples=[{"text": "example 1"}, {"text": "example 2"}],
render=render_example,
notes=True
)
# Display in notebook
widget
# Get annotations after labeling
annotations = widget.get_annotations()widget = SimpleLabel(
examples=examples,
render=render_example,
shortcuts={"Alt+Q": "prev", "Alt+W": "yes"}, # Custom keyboard
gamepad_shortcuts={"button_7": "yes"} # Custom gamepad
)If you're keen to understand your gamepad better and how to map the buttons to actions, you can check this notebook. It will show every name of every button that you press in real time via the browser gamepad API.
- Mouse: Click buttons or microphone icon
- Keyboard: Alt+1 (prev), Alt+2 (yes), Alt+3 (no), Alt+4 (skip), Alt+5 (focus notes), Alt+6 (speech toggle)
- Gamepad: Button mappings with push-to-talk speech on left trigger
You can assign keyboard/gamepad shortcuts to the widget for all the possible actions:
prev- go to the previous exampleyes- label the example as yesno- label the example as noskip- skip the examplefocus_notes- focus the notes fieldspeech_notes- start/stop speech recognition
- Modern web browser for Speech Recognition/Gamepad API support
- Microphone access for speech features
