pdf2html / README.md
jrpark's picture
Upload folder using huggingface_hub
d1aa69e verified

A newer version of the Gradio SDK is available: 6.3.0

Upgrade
metadata
title: pdf2html
app_file: web_interface.py
sdk: gradio
sdk_version: 5.20.1

pdf2html

PDF ํŒŒ์ผ์„ ๋‹จ์ผ ์ปฌ๋Ÿผ HTML๋กœ ๋ณ€ํ™˜ํ•˜๋Š” Python ํŒจํ‚ค์ง€์ž…๋‹ˆ๋‹ค.

์„ค์น˜

# Poetry๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ
poetry install

# ๋˜๋Š” pip ์‚ฌ์šฉ
pip install pdf2html

ํ•„์š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

pip install PyMuPDF beautifulsoup4 langchain gradio gradio-pdf

์‚ฌ์šฉ๋ฒ•

๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค

# ์ง์ ‘ ์‹คํ–‰
poerty run python -m pdf2html ๊ฒฝ๋กœ/ํŒŒ์ผ๋ช….pdf
poerty run python -m pdf2html ๊ฒฝ๋กœ/ํŒŒ์ผ๋ช….pdf --output ์ถœ๋ ฅ๋””๋ ‰ํ† ๋ฆฌ

# ์„ค์น˜ ํ›„ ์‹คํ–‰
pdf2html ๊ฒฝ๋กœ/ํŒŒ์ผ๋ช….pdf
pdf2html ๊ฒฝ๋กœ/ํŒŒ์ผ๋ช….pdf --output ์ถœ๋ ฅ๋””๋ ‰ํ† ๋ฆฌ

์›น ์ธํ„ฐํŽ˜์ด์Šค

# ์ง์ ‘ ์‹คํ–‰
poetry run python -m web_interface

# ์„ค์น˜ ํ›„ ์‹คํ–‰
pdf2html-web

Python ์ฝ”๋“œ์—์„œ ์‚ฌ์šฉ

from pdf2html import PDFToHTMLConverter

converter = PDFToHTMLConverter("๊ฒฝ๋กœ/ํŒŒ์ผ๋ช….pdf")
output_path = converter.convert()
print(f"๋ณ€ํ™˜ ์™„๋ฃŒ: {output_path}")

์ฃผ์š” ๊ธฐ๋Šฅ

  • PDF ๋ฌธ์„œ์˜ ํ…์ŠคํŠธ, ์ด๋ฏธ์ง€, ํ‘œ ์ถ”์ถœ
  • 1๋‹จ ์„ธ๋กœ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ์žฌ๊ตฌ์„ฑ
  • ๋ฌธ๋‹จ ๊ตฌ์กฐ ๋ฐ ์„œ์‹ ์œ ์ง€
  • ์ด๋ฏธ์ง€ ์ž๋™ ์ถ”์ถœ ๋ฐ ํฌํ•จ
  • ํ‘œ ๊ตฌ์กฐ ๊ฐ์ง€ ๋ฐ HTML ํ…Œ์ด๋ธ”๋กœ ๋ณ€ํ™˜
  • Gradio ๊ธฐ๋ฐ˜ ์›น ์ธํ„ฐํŽ˜์ด์Šค ์ œ๊ณต