MananSuri27/VisDoM

46

stars

8

commits

Python

primary language

Jul 28, 2025

updated

README

🧐📄 VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal RAG 🎯🤖

Files for the NAACL 2025 paper, VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal Retrieval-Augmented Generation. 📚📊🔍

📂 What's Inside?

This repo contains the 5 data splits in VisDoMBench, a cutting-edge multi-document, multimodal QA benchmark 🚀🔎 designed for answering questions across visually rich document content like:

📊 Tables | 📉 Charts | 🖼️ Slides

Perfect for evaluating multimodal, multi-document QA systems in a comprehensive way! ✅📖

VisDoM Benchmark

🤖 VisDoMRAG

This repository includes visdomrag.py, our implementation of the VisDoMRAG framework, a multimodal retrieval-augmented pipeline specifically designed for visual document understanding and question answering.

Key Components

  1. Visual Retrieval: Using models like ColPali and ColQwen for image-to-image and text-to-image retrieval
  2. Text Retrieval: Supporting BM25, MiniLM, MPNet, and BGE embeddings
  3. Multi-Stage Pipeline:
    • Document caching and preprocessing
    • Visual and textual index building
    • Context retrieval based on queries
    • Response generation from each modality
    • Response combination for final answers

Configuration Options

config = {
    "data_dir": "path/to/data",
    "output_dir": "path/to/output",
    "llm_model": "gpt4",  # Options: "gpt4", "gemini", "qwen"
    "vision_retriever": "colpali",  # Options: "colpali", "colqwen"
    "text_retriever": "bm25",  # Options: "bm25", "minilm", "mpnet", "bge"
    "top_k": 5,  # Number of contexts to retrieve
    "chunk_size": 3000,  # Text chunk size for retrieval
    "chunk_overlap": 300,  # Overlap between chunks
    "force_reindex": False,  # Whether to rebuild indexes
    "qa_prompt": # Refer to context dataset specific prompts in the code
}

📊 Dataset Summary

DatasetDomainContent TypeQueriesDocsAvg. Question LengthAvg. Doc Length (Pages)Avg. Docs per QueryAvg. Pages per Query
PaperTabWikipediaTables, Text37729729.44 ± 6.310.55 ± 6.310.82 ± 4.4113.10 ± 50.4
FetaTabScientific PapersTables35030012.96 ± 4.115.77 ± 23.97.77 ± 3.1124.33 ± 83.0
SciGraphQAScientific PapersCharts40731918.05 ± 1.922.75 ± 29.15.91 ± 2.0129.71 ± 81.7
SPIQAScientific PapersTables, Charts58611716.06 ± 6.614.03 ± 7.99.51 ± 3.5135.58 ± 55.2
SlideVQAPresentation DecksSlides55124422.39 ± 7.820.00 ± 0.06.99 ± 2.0139.71 ± 40.6
VisDoMBenchCombinedTables, Charts, Slides, Text2271127719.11 ± 5.416.43 ± 14.58.36 ± 3.0128.69 ± 62.7

📌 Table: Summary of data splits included in VisDoMBench.

🚀 Usage

from visdomrag import VisDoMRAG

# Configure the pipeline
config = {
    "data_dir": "./path/to/dataset",
    "output_dir": "./results",
    "llm_model": "gpt4",
    "vision_retriever": "colpali",
    "text_retriever": "bm25",
    "api_keys": {
        "openai": "your-openai-key",
        "gemini": "your-gemini-key"
    }
}

# Initialize and run
pipeline = VisDoMRAG(config)
pipeline.run()  # Process all queries
# Or process a specific query
pipeline.process_query(query_id)

📚 Dependencies

Main requirements:

  • PyTorch
  • pandas, numpy
  • pdf2image, PyPDF2, pytesseract (for PDF processing)
  • chromadb, langchain (for text retrieval)
  • Optional model-specific dependencies:
    • google.generativeai for Gemini
    • openai for GPT-4
    • colpali_engine for ColPali/ColQwen visual retrievers
    • transformers for Qwen models

📖 Cite us:

@misc{suri2024visdommultidocumentqavisually,
      title={VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal Retrieval-Augmented Generation}, 
      author={Manan Suri and Puneet Mathur and Franck Dernoncourt and Kanika Goswami and Ryan A. Rossi and Dinesh Manocha},
      year={2024},
      eprint={2412.10704},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.10704}, 
}

Contributors

MananSuri27

8 commits

MananSuri27/VisDoM

46

stars

8

commits

Python

primary language

Jul 28, 2025

updated

README

🧐📄 VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal RAG 🎯🤖

Files for the NAACL 2025 paper, VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal Retrieval-Augmented Generation. 📚📊🔍

📂 What's Inside?

This repo contains the 5 data splits in VisDoMBench, a cutting-edge multi-document, multimodal QA benchmark 🚀🔎 designed for answering questions across visually rich document content like:

📊 Tables | 📉 Charts | 🖼️ Slides

Perfect for evaluating multimodal, multi-document QA systems in a comprehensive way! ✅📖

VisDoM Benchmark

🤖 VisDoMRAG

This repository includes visdomrag.py, our implementation of the VisDoMRAG framework, a multimodal retrieval-augmented pipeline specifically designed for visual document understanding and question answering.

Key Components

  1. Visual Retrieval: Using models like ColPali and ColQwen for image-to-image and text-to-image retrieval
  2. Text Retrieval: Supporting BM25, MiniLM, MPNet, and BGE embeddings
  3. Multi-Stage Pipeline:
    • Document caching and preprocessing
    • Visual and textual index building
    • Context retrieval based on queries
    • Response generation from each modality
    • Response combination for final answers

Configuration Options

config = {
    "data_dir": "path/to/data",
    "output_dir": "path/to/output",
    "llm_model": "gpt4",  # Options: "gpt4", "gemini", "qwen"
    "vision_retriever": "colpali",  # Options: "colpali", "colqwen"
    "text_retriever": "bm25",  # Options: "bm25", "minilm", "mpnet", "bge"
    "top_k": 5,  # Number of contexts to retrieve
    "chunk_size": 3000,  # Text chunk size for retrieval
    "chunk_overlap": 300,  # Overlap between chunks
    "force_reindex": False,  # Whether to rebuild indexes
    "qa_prompt": # Refer to context dataset specific prompts in the code
}

📊 Dataset Summary

DatasetDomainContent TypeQueriesDocsAvg. Question LengthAvg. Doc Length (Pages)Avg. Docs per QueryAvg. Pages per Query
PaperTabWikipediaTables, Text37729729.44 ± 6.310.55 ± 6.310.82 ± 4.4113.10 ± 50.4
FetaTabScientific PapersTables35030012.96 ± 4.115.77 ± 23.97.77 ± 3.1124.33 ± 83.0
SciGraphQAScientific PapersCharts40731918.05 ± 1.922.75 ± 29.15.91 ± 2.0129.71 ± 81.7
SPIQAScientific PapersTables, Charts58611716.06 ± 6.614.03 ± 7.99.51 ± 3.5135.58 ± 55.2
SlideVQAPresentation DecksSlides55124422.39 ± 7.820.00 ± 0.06.99 ± 2.0139.71 ± 40.6
VisDoMBenchCombinedTables, Charts, Slides, Text2271127719.11 ± 5.416.43 ± 14.58.36 ± 3.0128.69 ± 62.7

📌 Table: Summary of data splits included in VisDoMBench.

🚀 Usage

from visdomrag import VisDoMRAG

# Configure the pipeline
config = {
    "data_dir": "./path/to/dataset",
    "output_dir": "./results",
    "llm_model": "gpt4",
    "vision_retriever": "colpali",
    "text_retriever": "bm25",
    "api_keys": {
        "openai": "your-openai-key",
        "gemini": "your-gemini-key"
    }
}

# Initialize and run
pipeline = VisDoMRAG(config)
pipeline.run()  # Process all queries
# Or process a specific query
pipeline.process_query(query_id)

📚 Dependencies

Main requirements:

  • PyTorch
  • pandas, numpy
  • pdf2image, PyPDF2, pytesseract (for PDF processing)
  • chromadb, langchain (for text retrieval)
  • Optional model-specific dependencies:
    • google.generativeai for Gemini
    • openai for GPT-4
    • colpali_engine for ColPali/ColQwen visual retrievers
    • transformers for Qwen models

📖 Cite us:

@misc{suri2024visdommultidocumentqavisually,
      title={VisDoM: Multi-Document QA with Visually Rich Elements Using Multimodal Retrieval-Augmented Generation}, 
      author={Manan Suri and Puneet Mathur and Franck Dernoncourt and Kanika Goswami and Ryan A. Rossi and Dinesh Manocha},
      year={2024},
      eprint={2412.10704},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.10704}, 
}

Contributors

MananSuri27

8 commits

Languages

Python

100.0%