Skip to content

bdok23/Infinitus_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Language Model Integration for PDF Question Answering

This application enables users to ask questions about a specific PDF document and receive answers generated by a language learning model. The project consists of a React frontend that interacts with a Flask backend, which processes the questions using a language model.

Architecture

Frontend

  • Technology: React
  • Responsibilities: Sends user questions to the backend and displays answers.

Backend

  • Technology: Flask
  • Responsibilities: Handles API requests, extracts text from PDFs, and uses a language model to generate answers.

Language Model

  • Model Used: RAG (Retrieval-Augmented Generation) using the Hugging Face Transformers library.
  • Function: Answers questions based on the context extracted from a PDF.

Technologies Used

  • React: For building the user interface.
  • Flask: Serves the API that the frontend consumes.
  • pdfplumber: To extract text from PDF documents.
  • Transformers: Provides access to pre-trained models and utilities for natural language processing.
  • CORS (Cross-Origin Resource Sharing): Handled in Flask to allow communication between the frontend and backend during development.

Setup Instructions

Prerequisites

  • Python 3.8+
  • Node.js 12+

Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install Python dependencies: pip install -r requirements.txt
  3. Start the Flask server: python app.py

Frontend Setup

  1. Navigate to the frontend directory: cd frontend
  2. Install npm packages: npm install
  3. Start the React server: npm start

Assumptions:

The PDF document is text-based and allows text extraction. The environment has adequate resources to handle the processing needs of the language model.

Limitations:

The application is designed for use in a local development environment and is not production-ready. Performance may vary based on the size of the PDF and the complexity of the questions. Errors in text extraction due to the PDF's format or quality could affect answer accuracy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published