Skip to content

Instantly share code, notes, and snippets.

View ytakashina's full-sized avatar
🌊

Yuya Takashina ytakashina

🌊
View GitHub Profile
@ytakashina
ytakashina / model-building-example-5-2.ipynb
Created April 17, 2022 05:17
model-building-example-5.2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import fitz
path_pdf = ...
doc = fitz.open(path_pdf)
for page in doc:
text_raw = page.get_text("text")
line = re.sub(r"\s", "", text_raw)
print(line)
for (x0, y0, x1, y1, text, no, typ) in doc[0].get_text("blocks"):