Skip to content

Suvanwita/Legalisers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Legalisers - Legal Document Analysis Chatbot

A sophisticated legal document analysis system that combines RAG (Retrieval-Augmented Generation) with modern web technologies to provide intelligent document processing and chat capabilities.

πŸš€ Features

  • Document upload and processing (PDF, DOCX support)
  • Intelligent chat interface for legal document analysis
  • RAG-based document retrieval and generation
  • Real-time communication between frontend and backend
  • Cross-Origin Resource Sharing (CORS) enabled for development

πŸ› οΈ Tech Stack

Frontend

  • React 18
  • Vite
  • Axios for API communication
  • Modern CSS styling

Backend

  • FastAPI
  • ChromaDB for document storage
  • Sentence Transformers for text embedding
  • Google's Generative AI
  • spaCy for NLP tasks
  • PyPDF2 and python-docx for document processing

πŸ“‹ Prerequisites

  • Node.js (for frontend)
  • Python 3.x (for backend)
  • npm or yarn package manager

πŸš€ Getting Started

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Run development server:

    npm run dev

    The frontend will be available at http://localhost:5173

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install Python dependencies:

    pip install fastapi uvicorn chromadb sentence-transformers google-generativeai spacy pypdf2 python-docx
  3. Run the FastAPI server:

    uvicorn legal_rag_api:app --reload

    The backend API will be available at http://localhost:8000

πŸ—οΈ Project Structure

.
β”œβ”€β”€ README.md
β”œβ”€β”€ backend/
β”‚   └── legal_rag_api.py         # FastAPI backend server
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ ChatBox.jsx      # Chat interface component
    β”‚   β”‚   β”œβ”€β”€ MessageBubble.jsx # Individual message component
    β”‚   β”‚   └── UploadBox.jsx    # Document upload component
    β”‚   β”œβ”€β”€ App.jsx              # Main application component
    β”‚   └── main.jsx             # Application entry point
    β”œβ”€β”€ index.html
    β”œβ”€β”€ package.json
    └── vite.config.js

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •