groundingauburn/hot_annotator
title: Fact Tag Annotation Interface emoji: ๐ท๏ธ colorFrom: indigo colorTo: blue sdk: docker # use "gradio" or "streamlit" if you use those SDKs
app_file: app.py # only for gradio/streamlit; not used with docker
pinned: false license: mit short_description: Annotating and editing fact tags for crowdsourcing. tags:
- annotation
- crowdsourcing
- labeling
- flask
- a/b-testing ---
Fact Tag Annotation Interface
An interactive web application for annotating and editing fact tags in text, designed for crowdsourcing platforms like Amazon Mechanical Turk.
Features
๐จ Different Colors for Each Fact
- Each fact tag (
fact1,fact2, etc.) has a unique color for easy identification - Color legend shows all fact types and their corresponding colors
- High contrast text automatically selected based on background color
๐ฑ๏ธ Interactive Editing
- Click any fact tag to edit it in a modal interface
- Real-time text editing with save/cancel/remove options
- Visual feedback with animations and status indicators
๐ Progress Tracking
- Live statistics showing total facts, edited count, and time spent
- Visual progress bar
- Change history tracking for each annotation session
๐พ Data Collection
- Automatic saving of all changes with timestamps
- Session tracking for each annotator
- JSON export of annotation results
- Admin dashboard to review submissions
๐ฑ Responsive Design
- Works on desktop, tablet, and mobile devices
- Professional appearance suitable for crowdsourcing platforms
- Keyboard shortcuts for power users
Installation
- Clone or download this directory
- Install dependencies:
pip install -r requirements.txt- Run the application:
python app.py- Open your browser and go to
http://localhost:5000
Usage
For Annotators
- Visit the main interface at
http://localhost:5000 - Read the instructions and review the color legend
- Click on any colored fact tag to edit it
- Make your changes in the editing modal
- Add optional notes about your annotation process
- Submit when finished
For Administrators
- Visit the admin dashboard at
http://localhost:5000/admin - Review all submitted annotations
- View statistics and completion metrics
- Export data for analysis
Configuration
Custom Fact Colors
Edit the FACT_COLORS dictionary in app.py to customize colors:
FACT_COLORS = {
'fact1': '#FF6B6B', # Red
'fact2': '#4ECDC4', # Teal
'fact3': '#45B7D1', # Blue
# Add more as needed
}Sample Data
Update the SAMPLE_DATA dictionary in app.py with your own content:
SAMPLE_DATA = {
"question": "Your question with <fact1>tagged facts</fact1>...",
"answer": "Your answer with <fact1>corresponding tags</fact1>..."
}API Endpoints
GET /- Main annotation interfacePOST /api/save_annotation- Save annotation dataGET /api/get_task_data- Retrieve task dataGET /admin- Admin dashboard
Data Storage
Annotations are saved as JSON files in the annotations/ directory with the following structure:
{
"session_id": "unique-session-id",
"timestamp": "2023-12-07T10:30:00",
"original_question": "...",
"original_answer": "...",
"modified_question": "...",
"modified_answer": "...",
"changes_made": [
{
"factId": "fact1",
"action": "edit",
"originalText": "old text",
"newText": "new text",
"timestamp": 1701947400000
}
],
"worker_notes": "Optional notes from annotator",
"completion_time_seconds": 245,
"total_facts": 6,
"edited_facts": 3
}Customization
Styling
- Modify
static/css/style.cssfor custom themes - Update color schemes and layouts
- Add your organization's branding
Functionality
- Edit
static/js/annotation.jsfor custom behavior - Add new annotation features
- Implement custom validation rules
Backend
- Modify
app.pyfor custom data handling - Add database integration
- Implement user authentication
Integration with AMT
This application is designed to work with Amazon Mechanical Turk:
- Host the application on a public server
- Create an AMT HIT that loads your annotation interface
- Configure submission to capture the annotation data
- Use the admin dashboard to review and approve work
Security Notes
- Change the
secret_keyinapp.pyfor production use - Implement proper authentication for the admin interface
- Use HTTPS in production environments
- Validate and sanitize all user input
Browser Compatibility
- Chrome 70+
- Firefox 65+
- Safari 12+
- Edge 79+
License
This project is open source and available under the MIT License.
