Skip to content

koaning/molabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

molabel

A simple annotation widget for labeling examples with speech recognition support.

For an interactive demo check GitHub pages here.

Features

localhost_2719_

  • 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

Installation

uv pip install molabel

Usage

from 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()

Custom Shortcuts

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.

Controls

  • 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 example
  • yes - label the example as yes
  • no - label the example as no
  • skip - skip the example
  • focus_notes - focus the notes field
  • speech_notes - start/stop speech recognition

Requirements

  • Modern web browser for Speech Recognition/Gamepad API support
  • Microphone access for speech features

About

Widgets to make it easy to add labels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •