# Accessibility Auto-Fixer Environment for Atropos **Team/Author:** Accessibility Bot / Josh Garza **Track:** Objective (WCAG rules are specific and rule-based) **wandb run:** https://wandb.ai/joshgarza-n-a/atropos/runs/tqpiiofa?nw=nwuserjoshgarza ## Environment Design and Motivation ### Problem Addressed Web accessibility is crucial for ensuring that websites and web applications are usable by everyone, including people with disabilities. Manually auditing and fixing HTML to meet Web Content Accessibility Guidelines (WCAG) is time-consuming and requires specialized knowledge. This Atropos environment fine-tunes an LLM to automatically identify and apply minimal, correct fixes to HTML snippets to improve their WCAG compliance. ### Why This Is Important Automating accessibility improvements reduces effort and cost, leading to more inclusive web experiences. A fine-tuned model can serve as a developer assistant, batch-processor for large codebases, or educational tool. ### How the Environment Works 1. **Input:** - HTML snippets from `data/accessibility_dataset.jsonl` - Each snippet is tagged with WCAG issues to fix (e.g. `missing_alt_text`, `missing_label_for`) 2. **LLM Interaction:** - Prompt the model (e.g. GPT-3.5-turbo) to output only the corrected HTML 3. **Scoring (Rule-Based):** - Define `AccessibilityRule` classes (e.g. `MissingAltTextRule`, `LabelAssociationRule`, `LinkHasTextRule`) - Parse the LLM’s output with BeautifulSoup - Check each issue in `issues_to_fix` against the corresponding rule - Assign a score: - **+1.0** All targeted issues fixed correctly - **0.0–0.8** Some but not all issues fixed - **–0.5** Parseable HTML, but none of the targeted issues fixed - **–1.0** Unparseable HTML or regressions on targeted issues 4. **Output:** - Rollouts compatible with Atropos (tokenized prompts/responses, masks, scores) for RL training ### MVP: Targeted WCAG Criteria 1. **Images (``):** missing or empty `alt` attributes (WCAG 1.1.1) 2. **Form labels:** improper `