forked from langchain-ai/langchain
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
community: support advanced text extraction options for pdf documents (…
…langchain-ai#20265) **Description:** - Updated constructors in PyPDFParser and PyPDFLoader to handle `extraction_mode` and additional kwargs, aligning with the capabilities of `PageObject.extract_text()` from pypdf. - Added `test_pypdf_loader_with_layout` along with a corresponding example text file to validate layout extraction from PDFs. **Issue:** fixes langchain-ai#19735 **Dependencies:** This change requires updating the pypdf dependency from version 3.4.0 to at least 4.0.0. Additional changes include the addition of a new test test_pypdf_loader_with_layout and an example text file to ensure the functionality of layout extraction from PDFs aligns with the new capabilities. --------- Co-authored-by: Bagatur <[email protected]> Co-authored-by: Bagatur <[email protected]> Co-authored-by: Erick Friis <[email protected]>
- Loading branch information
1 parent
a402de3
commit 034a8c7
Showing
7 changed files
with
101 additions
and
6 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
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
49 changes: 49 additions & 0 deletions
49
libs/community/tests/integration_tests/examples/layout-parser-paper-page-1.txt
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,49 @@ | ||
LayoutParser : A Unified Toolkit for Deep | ||
Learning Based Document Image Analysis | ||
|
||
|
||
Zejiang Shen 1 ( ), Ruochen Zhang 2, Melissa Dell 3, Benjamin Charles Germain | ||
Lee 4, Jacob Carlson 3, and Weining Li 5 | ||
|
||
1 Allen Institute for AI | ||
[email protected] | ||
2 Brown University | ||
ruochen [email protected] | ||
3 Harvard University | ||
{melissadell,jacob carlson }@fas.harvard.edu | ||
4 University of Washington | ||
[email protected] | ||
5 University of Waterloo | ||
[email protected] | ||
|
||
|
||
|
||
Abstract. Recentadvancesindocumentimageanalysis(DIA)havebeen | ||
primarily driven by the application of neural networks. Ideally, research | ||
outcomes could be easily deployed in production and extended for further | ||
investigation. However, various factors like loosely organized codebases | ||
and sophisticated model configurations complicate the easy reuse of im- | ||
portant innovations by awide audience. Though there havebeen on-going | ||
efforts to improve reusability and simplify deep learning (DL) model | ||
development in disciplines like natural language processing and computer | ||
vision, none of them are optimized for challenges in the domain of DIA. | ||
This represents a major gap in the existing toolkit, as DIA is central to | ||
academic research across a wide range of disciplines in the social sciences | ||
and humanities. This paper introduces LayoutParser , an open-source | ||
library for streamlining the usage of DL in DIA research and applica- | ||
tions. The core LayoutParser library comes with a set of simple and | ||
intuitive interfaces for applying and customizing DL models for layout de- | ||
tection,characterrecognition,andmanyotherdocumentprocessingtasks. | ||
To promote extensibility, LayoutParser also incorporates a community | ||
platform for sharing both pre-trained models and full document digiti- | ||
zation pipelines. We demonstrate that LayoutParser is helpful for both | ||
lightweight and large-scale digitization pipelines in real-word use cases. | ||
The library is publicly available at https://layout-parser.github.io . | ||
|
||
Keywords: DocumentImageAnalysis ·DeepLearning ·LayoutAnalysis | ||
· Character Recognition · Open Source library · Toolkit. | ||
|
||
1 Introduction | ||
|
||
Deep Learning(DL)-based approaches are the state-of-the-art for a wide range of | ||
documentimageanalysis(DIA)tasksincludingdocumentimageclassification[ 11 , |
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