Skip to content

About

Intelligent PDF Document Understanding System with semantic document search using multilingual neural embeddings and vector database technology. Search any PDF in any language.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocVision AI: search any PDF in any language

Upload a PDF and search it by meaning, in any language: ask in English and find the answer in a Polish manual. Each page is split into short passages, embedded locally with a multilingual sentence-transformer and stored in Milvus. A query returns the closest passage, and the viewer jumps to its page and highlights it.

Stack: Python, FastAPI, PyTorch, Hugging Face, LangChain, Milvus, PDF.js

0807.mp4

How it works

Index on upload: PDF, FastAPI, PyMuPDF, chunking, MiniLM, then Milvus. Search over WebSocket: query, MiniLM, Milvus, top match, viewer.

Module What it does
Backend/api FastAPI app: PDF upload, and a WebSocket per browser session for processing and search.
Backend/core Reads the PDF with PyMuPDF and processes its pages in parallel threads.
Backend/embeddings Splits page text into 160-character passages (30 overlap) and embeds them with paraphrase-multilingual-MiniLM-L12-v2.
Backend/db Milvus collection of passages, page numbers and session ids; cosine search filtered to the session.
Frontend Upload screen and a PDF.js viewer that jumps to the result's page and highlights the passage.

Passages are short on purpose: the result is a precise spot to highlight, not a whole page. The multilingual model maps Polish and English text into the same 384-dimensional space, so the language of the query does not have to match the document.

Cross-lingual search

The same manual, queried in English and in Polish:

How to do a factory reset, asked in English and Polish What username should I use for login, asked in English and Polish

Quickstart

Needs Python 3.10+ and Milvus standalone 2.3 or newer running on localhost:19530. A CUDA GPU is used when available.

pip install -r requirements.txt
uvicorn Backend.api.server:app --reload     # http://localhost:8000

Smoke tests for the pipeline and the database (Milvus has to be running):

python -m Backend.core.unit_tests
python -m Backend.db.unit_tests

Limitations

  • It returns the single best passage. It does not generate an answer from it.
  • A session lives as long as its WebSocket: when the tab closes, its file and vectors are deleted.
  • No authentication: anyone who can reach the server can upload.

License

MIT

About

Intelligent PDF Document Understanding System with semantic document search using multilingual neural embeddings and vector database technology. Search any PDF in any language.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages