PDF无障碍化工具

AI驱动的PDF无障碍化工具,自动为PDF和LaTeX文档生成替代文本、添加语义结构,并验证其是否符合PDF/UA标准。

  • by AIScientists-Dev
  • Python
  • 本地部署
  • 10 星标
  • 更新于
在 GitHub 查看 AIScientists-Dev/AI-Powered-PDF-Accessibility

使用说明

AI-Powered PDF Accessibility

Make PDFs accessible to screen readers — automatically

Supports PDF and LaTeX input — outputs accessible PDF or modified LaTeX source.
Uses AI vision to generate alt-text for images, charts, and math formulas.
Adds semantic structure (headings, paragraphs, reading order) for screen reader navigation.
Validates against PDF/UA standard with a 0-100 accessibility score.

Turn hours of manual remediation into minutes.

Quick Start • Features • API Reference • Deployment • Contributing


关于

该项目是与 MorphMind 的.

立即尝试——无需设置: agentlab.morphmind.ai (免费试用)


🚀 快速开始

选项1:通过MorphMind AgentLab使用(推荐)

最简单的方法——无需设置:

  1. 访问 agentlab.morphmind.ai
  2. 找到 PDF辅助功能修正器 代理
  3. 上传您的PDF并立即获得结果

免费试用 --在几秒钟内开始修复PDF。

方案2:地方发展

# Clone the repository
git clone https://github.com/AIScientists-Dev/AI-Powered-PDF-Accessibility.git
cd AI-Powered-PDF-Accessibility

# Create virtual environment
python3.11 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install veraPDF (required for validation)
# macOS:
brew install verapdf
# Linux: Download from https://verapdf.org/software/

# Set up environment
echo "GEMINI_API_KEY=your_api_key_here" > .env

# Run the server
python -m uvicorn http_server:app --host 0.0.0.0 --port 8080

# Test it
curl http://localhost:8080/health

✨ 特性

🎯 MorphMind无障碍评分

得到一瞬间 0-100分 基于PDF/UA合规性,提供字母等级和可操作的见解。

{
  "score": 82,
  "grade": "B",
  "issues_by_severity": {
    "critical": 0,
    "serious": 3,
    "moderate": 1
  }
}

🤖 AI驱动的Alt文本

使用Google Gemini视觉AI自动生成图像和图形的描述性替代文本。

📋 25专用工具

类别 工具
分析 analyze_pdf, validate_pdfua, validate_pdfa, detect_headings
补救 make_accessible, add_full_structure, add_alt_text, fix_link_alt_texts
图 extract_figures, generate_alt_text, get_link_annotations
乳胶 analyze_latex, prepare_latex, make_latex_accessible
教育 get_accessibility_tutorial

🏗️ 建立在标准之上

  • 主控程序 (模型上下文协议)-人工智能工具集成的开放标准
  • PDF/UA (ISO 14289)-国际PDF可访问性标准
  • veraPDF -行业标准验证引擎
  • WCAG 2.1 -Web内容可访问性指南对齐

📖 API 参考

代理优化端点

这些端点返回为AI代理消费而设计的干净、结构化的JSON:

POST /agent/validate

使用MorphMind评分根据PDF/UA验证PDF。

curl -X POST http://localhost:8080/agent/validate \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"pdf_path": "/path/to/file.pdf"}}'

答复:

{
  "success": true,
  "score": 82,
  "grade": "B",
  "compliant": false,
  "summary": {
    "passed_rules": 100,
    "failed_rules": 4
  },
  "issues_by_severity": {
    "critical": 0,
    "serious": 3,
    "moderate": 1,
    "minor": 0
  },
  "failures": [
    {
      "clause": "7.1",
      "test_number": "10",
      "description": "DisplayDocTitle key missing"
    }
  ]
}

POST /agent/make-accessible

具有AI alt文本生成功能的完整修复管道。

curl -X POST http://localhost:8080/agent/make-accessible \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"pdf_path": "file_id", "document_type": "technical report"}}'

答复:

{
  "success": true,
  "output_file": "abc123_document_accessible.pdf",
  "figures_processed": 3,
  "structure_enhancements": {
    "headings_tagged": 15,
    "links_fixed": 8,
    "xmp_metadata_added": true
  }
}

标准终结点

端点 方法 描述
/health GET 健康检查
/tools GET 列出所有可用工具
/tools/{name} POST 按名称执行任何工具
/upload POST 上传PDF文件,返回 file_id
/download/{file_id} GET 下载已处理文件
/batch POST 按顺序执行多个工具

🏛️ 建筑

┌─────────────────────────────────────────────────────────────────┐
│                         Your Application                         │
│                  (AgentLab, MCP Clients, etc.)                  │
└───────────────────────────────┬─────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────┐
│                    Accessibility Agent Backend                   │
│  ┌─────────────────────────┐  ┌─────────────────────────────┐  │
│  │  HTTP API (Port 8080)   │  │  MCP Transport (Port 8081)  │  │
│  │  • /agent/validate      │  │  • Streamable HTTP          │  │
│  │  • /agent/make-accessible│  │  • API Key authenticated    │  │
│  │  • /upload, /download   │  │                             │  │
│  └───────────┬─────────────┘  └───────────┬─────────────────┘  │
│              │                            │                     │
│              └──────────┬─────────────────┘                     │
│                         ▼                                       │
│              ┌─────────────────────────┐                       │
│              │   src/mcp_server.py     │                       │
│              │   25 Accessibility Tools │                       │
│              └───────────┬─────────────┘                       │
│                          │                                      │
│    ┌─────────────────────┼─────────────────────┐               │
│    ▼                     ▼                     ▼               │
│ ┌──────────┐      ┌────────────┐      ┌────────────┐          │
│ │ veraPDF  │      │  Gemini AI │      │  pikepdf   │          │
│ │Validation│      │  Alt-text  │      │PDF Editing │          │
│ └──────────┘      └────────────┘      └────────────┘          │
└─────────────────────────────────────────────────────────────────┘

🚢 部署

自托管部署

在任何云提供商(AWS、GCP、Azure)或本地部署:

# Clone and setup
git clone https://github.com/AIScientists-Dev/AI-Powered-PDF-Accessibility.git
cd AI-Powered-PDF-Accessibility

# Configure environment
cp .env.example .env
# Edit .env with your GEMINI_API_KEY

# Run with systemd (see deploy/ folder for service files)
./deploy/update-ec2.sh

CI/CD: 推至 main 触发GitHub Actions部署。

环境变量

变量 描述 必填
GEMINI_API_KEY Google Gemini API生成alt-text密钥 是
PORT HTTP服务器端口(默认:8080) 否
HOST 绑定地址(默认值:0.0.0.0) 否
MCP_API_KEYS 用于MCP传输的逗号分隔API密钥 否

🤝 贡献

我们欢迎捐款!这个项目是MIT许可证下的开源项目。

需要帮助的领域

  • 🌍 国际化 -支持更多语言
  • 📊 表修复 -改进复杂的表格处理
  • 📐 数学可访问性 -更好的方程式支持
  • 🧪 测试 -更多样化的PDF测试用例
  • 📚 文档 -教程和指南

开发设置

# Fork and clone
git clone https://github.com/YOUR_USERNAME/AI-Powered-PDF-Accessibility.git

# Install dev dependencies
pip install -r requirements.txt
pip install pytest black flake8

# Run tests
pytest

# Format code
black .

📊 为什么可访问性很重要

  • 10亿+人 全世界都有残疾人(世界卫生组织)
  • 90%以上的PDF 缺乏适当的辅助功能
  • 法律要求 在大多数国家(ADA,第508节,欧盟指令)
  • 2-4小时 → 2-4分钟:通过AI自动化节省时间

内置教育内容

向客服询问可访问性:

curl -X POST http://localhost:8080/tools/get_accessibility_tutorial \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"topic": "what_is_accessibility"}}'

可用主题:

  • what_is_accessibility -PDF可访问性介绍
  • common_struggles -人们面临的挑战
  • how_we_help -AI代理如何解决这些问题
  • getting_started -快速入门指南
  • about_project -关于这个项目

📜 许可证

MIT许可证-免费使用,如果可以的话,请回馈。


🔗 链接


Built with ❤️ by MorphMind