RAGChain Docs
  • Introduction
  • Quick Start
  • Installation
  • RAGchain Structure
    • File Loader
      • Dataset Loader
        • Ko-Strategy-QA Loader
      • Hwp Loader
      • Rust Hwp Loader
      • Win32 Hwp Loader
      • OCR
        • Nougat Loader
        • Mathpix Markdown Loader
        • Deepdoctection Loader
    • Text Spliter
      • Recursive Text Splitter
      • Markdown Header Splitter
      • HTML Header splitter
      • Code splitter
      • Token splitter
    • Retrieval
      • BM25 Retrieval
      • Hybrid Retrieval
      • Hyde Retrieval
      • VectorDB Retrieval
    • LLM
    • DB
      • MongoDB
      • Pickle DB
    • Reranker
      • BM25 Reranker
      • UPR Reranker
      • TART Reranker
      • MonoT5 Reranker
      • LLM Reranker
    • Benchmark
      • Auto Evaluator
      • Dataset Evaluators
        • Qasper
        • Ko-Strategy-QA
        • Strategy-QA
        • ms-marco
  • Utils
    • Query Decomposition
    • Evidence Extractor
    • Embedding
    • Slim Vector Store
      • Pinecone Slim
      • Chroma Slim
    • File Cache
    • Linker
      • Redis Linker
      • Dynamo Linker
      • Json Linker
    • REDE Search Detector
    • Semantic Clustering
  • Pipeline
    • BasicIngestPipeline
    • BasicRunPipeline
    • RerankRunPipeline
    • ViscondeRunPipeline
  • For Advanced RAG
    • Time-Aware RAG
    • Importance-Aware RAG
Powered by GitBook
On this page
  • Overview
  • Usage
  • Run Deepdoctection API sever
  • Initialization
  • Loading Documents
  1. RAGchain Structure
  2. File Loader
  3. OCR

Deepdoctection Loader

DeepdoctectionPDFLoader Class Documentation

PreviousMathpix Markdown LoaderNextText Spliter

Last updated 1 year ago

Overview

The DeepdoctectionPDFLoader class is a powerful tool for loading academic document PDF files. It leverages the capabilities of the Deepdoctection model, developed by deepdoctection, to provide an accurate conversion of academic papers from PDF format.

Usage

Run Deepdoctection API sever

You must run Deepdoctection API server for using this loader. You will need server with CUDA installed for running deepdoctection model properly. More detailed installation of deepdoctection, please go to .

Use Docker (Recommend)

First, clone NomaDamas/deepdoctection repository to your machine, and move to docker/NomaDamas-api-server folder.

git clone https://github.com/NomaDamas/deepdoctection-api-server.git
cd deepdoctection-api-server/docker/NomaDamas-api-server

Then, build and run your docker container following this .

Use Local Environment

First, clone NomaDamas/deepdoctection-api-server repository to your machine, and move to folder.

git clone https://github.com/NomaDamas/deepdoctection-api-server.git
cd deepdoctection-api-server

Then, run api server with this command.

python3 setup.py install
python3 app.py

Initialization

After runs your Deepdoctection API server, you first need to create an instance by providing two parameters: file_path and deepdoctection_host.

  • file_path: This is a string representing the path to your PDF file.

  • deepdoctection_host: This is a string representing the host address where your Deepdoctection API server is running.

Example:

from RAGchain.preprocess.loader import DeepdoctectionPDFLoader

loader = DeepdoctectionPDFLoader(file_path="path/to/your/file.pdf", deepdoctection_host="http://localhost:8000")

During initialization, it checks if it can establish a connection with the provided Deepdoctection server host. If it cannot establish a connection, it raises a ValueError.

Loading Documents

The class provides two methods for loading documents: load() and lazy_load().

Example:

documents = loader.load()

or

for doc in loader.lazy_load():
    # process each document here...

These methods return instances of Document objects that contain processed content from your PDF file.

official github repo
instruction