8000 GitHub - pdfix/action-pdf-accessibility-openai-docker: Solving PDF accessibility with OpenAI
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pdfix/action-pdf-accessibility-openai-docker

Repository files navigation

PDF Accessibility with OpenAI

A Docker image that enhances the accessibility of PDF documents using OpenAI and PDFix SDK. Automatically generates alternate text for images and formulas, summarizes tables, and produces MathML associate files for formulas.

Table of Contents

Available Actions

  • Generate Alternate Text for images
  • Generate Table Summary
  • Generate MathML Associated Files for Formulas

Generate Alternate Text for images

Automatically generates alternate text for Figure and Formula tags using OpenAI, embedding it into each tag’s Alt attribute.

Generate Table Summary

Automatically generates table summaries for Table tags using OpenAI, inserting them into each tag’s Summary attribute.

Generate MathML Associated Files for Formulas

Automatically generates MathML for Formula tags using OpenAI, attaching it as an associated file to each tag.

PDF Accessibility with OpenAI

commands:
    generate-table-summary
                        Generate table summary. Supported file combinations: PDF -> PDF, Image -> TXT. Supported images: .jpg .jpeg .png .bmp.
    generate-alt-text   Generate alternate text for images. Supported file combinations: PDF -> PDF, Image or XML -> TXT. Supported images: .jpg .jpeg .png .bmp.
    generate-mathml     Generate MathML for formulas. Supported file combinations: PDF -> PDF, Image -> TXT. Supported images: .jpg .jpeg .png .bmp.
    config              Save the default configuration file.

common options:
  -h, --help                show this help message and exit
  --openai-key OPENAI_KEY   OpenAI API key
  --input INPUT             The input PDF or image file
  --output OUTPUT           The output file
  --tags TAGS               Regular expression defining the tag names tpo process
  --name NAME               PDFix license name
  --key KEY                 PDFix license key

generate-alt-text, generate-table-summary:
  --lang LANG               The laguage of the alternate description and table summary
  --overwrite OVERWRITE     Overwrite the existing value

generate-mathml:
  --mathml-version          MathML version
      {mathml-1,mathml-2,mathml-3,mathml-4}

Getting Started

To use this Docker application, you'll need to have Docker installed on your system. If Docker is not installed, please follow the instructions on the official Docker website to install it.

Run using Command Line Interface

To run the docker container as CLI, you should share the folder containing the PDF for processing using the -v parameter. In this example, the current folder is used.

docker run -v $(pwd):/data/ -w /data pdfix/pdf-accessibility-openai:latest generate-alt-text --input document.pdf --output out.pdf --tags "Figure|Formula" --openai-key <api_key> --lang English --overwrite true

To run With a PDFix License add these arguments.

--name ${LICENSE_NAME} --key ${LICENSE_KEY}

Contact support for more infomation.

First run will pull the docker image, which may take some time. Make your own image for more advanced use.

For more detailed information about the available command-line arguments, you can run the following command:

docker run --rm pdfix/pdf-accessibility-openai:latest --help

Export the Configuration File for Integration

To export the configuration JSON file, use the following command:

docker run -v $(pwd):/data -w /data --rm pdfix/pdf-accessibility-openai:latest config --output config.json

License & libraries used

Trial version of the PDFix SDK may apply a watermark on the page and redact random parts of the PDF including the scanned image in background. Contact us to get an evaluation or production license.

Help & Support

To obtain a PDFix SDK license or report an issue please contact us at support@pdfix.net. For more information visit https://pdfix.net

About

Solving PDF accessibility with OpenAI

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0