Skip to main content

Table Detr Model Service

Overview

ai-core-table-service is designed for extracting tables from PDF documents using the table_detection_detr Python library for. The service leverages aiohttp for handling HTTP and WebSocket connections, enabling efficient processing and real-time updates. For more details about table_detection_detr, please refer to Table Detection Package.

Installation

The required dependencies can be installed using pip along with the FURY_AUTH authentication token:

FURY_AUTH=${FURY_AUTH} pip install --use-deprecated=legacy-resolver -r requirements.txt

Running the Service Locally

Launching the Server:

Start the server by running:

python app/server.py

[Optional] Monitor Service Progress in Real-Time via WebSocket [Optional]

  • Set the request type to WebSocket
  • Enter the WebSocket URL: ws://localhost:8080/table/ws
  • Click Connect

Uploading PDF File to Process:

  • Open Postman
  • Set the request type to http
  • Set the method to POST
  • Use the URL http://localhost:8080/table
  • Add a key with the type File and name it file
  • Select the PDF file from your computer that you wish to upload
  • Click Send to upload the file and start the Table Detection Creation process

Viewing the Output:

  • Response Format: The response will appear in JSON with the following format:
{
"result": "formatted tables",
"filename": "uploaded_file.pdf"
}
  • WebSocket Updates: If connected via WebSocket, you'll receive real-time updates on the process of Table Detection.