-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b47e90c
commit 0425c8e
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from fastapi import UploadFile | ||
|
||
from pdf_layout_analysis.run_pdf_layout_analysis import analyze_pdf | ||
from pdf_layout_analysis.run_pdf_layout_analysis_fast import analyze_pdf_fast | ||
from toc.extract_table_of_contents import extract_table_of_contents | ||
|
||
|
||
def get_toc(file: UploadFile, fast: bool): | ||
file_content = file.file.read() | ||
if fast: | ||
return extract_table_of_contents(file_content, analyze_pdf_fast(file_content)) | ||
return extract_table_of_contents(file_content, analyze_pdf(file_content, "")) |