Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vietnamese Legal Question-Answering System

A comprehensive question-answering system for Vietnamese legal documents, featuring semantic search and natural language processing capabilities.

Overview

This project implements an intelligent legal assistant that can answer questions about Vietnamese laws across multiple legal domains including:

  • Civil Law (Bộ luật Dân sự)
  • Criminal Law (Bộ luật Hình sự)
  • Labor Law (Bộ luật Lao động)
  • Criminal Procedure Law (Bộ luật Tố tụng Hình sự)
  • Land Law (Luật Đất đai)
  • Marriage and Family Law (Luật Hôn nhân và Gia đình)

Project Structure

.
├── backend/               # Backend server implementation
│   ├── data/             # Legal document corpus
│   ├── legal_index/      # FAISS vector indices
│   ├── models/           # NLP models and processors
│   └── src/              # Source code
│       ├── api/          # FastAPI routes and endpoints
│       ├── core/         # Core business logic
│       └── utils/        # Helper utilities
├── frontend/             # Next.js frontend application
│   ├── app/             # Page components
│   └── components/      # Reusable UI components
└── legal_index/         # Preprocessed vector indices

Features

  • Semantic Search: Utilizes FAISS for efficient similarity search across legal documents
  • Natural Language Processing: Leverages VnCoreNLP for Vietnamese text processing
  • Modern Web Interface: Built with Next.js for a responsive user experience
  • RESTful API: FastAPI-based backend with documented endpoints
  • Multi-domain Support: Handles questions across multiple areas of Vietnamese law

Getting Started

Prerequisites

  • Python 3.9+
  • Node.js 16+
  • Java Runtime Environment (for VnCoreNLP)

Backend Setup

  1. Create and activate a virtual environment:
cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the backend server:
python run.py

Frontend Setup

  1. Install dependencies:
cd frontend
npm install
  1. Start the development server:
npm run dev

The application will be available at http://localhost:3000

API Documentation

Once the backend server is running, API documentation is available at:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Testing

Run the test suite:

cd backend
python -m pytest tests/

Evaluation

The system includes evaluation scripts and metrics in the backend/evaluation/ directory:

  • Question-answering accuracy
  • Response relevance
  • Processing speed

License

This project is part of a thesis work. All rights reserved.

Author

Do Duy Hiep

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages