A legal knowledge search and Q&A application based on Vietnam's Legal Code and legal document database ⚖️
A legal knowledge search and Q&A application based on Vietnam's Legal Code and legal document database
Explore the docs »
🐛 Report Bug
|
✈️ Request Feature
|
💬 Join Our Telegram
|
📚 Read Wiki
|
📋 Roadmap
⚙️ This project used SonarCloud to analyze the code quality of the project. Pulumi for infrastructure as code (IaC). The badge below shows the quality of the code. Click on the badge to see the details.
Law Knowledge is an app designed to provide quick access to Vietnam's legal information, including laws and legal documents. It's ideal for professionals, students, or anyone needing insights into Vietnamese legal codes and regulations.
Law Knowledge is a legal knowledge search and Q&A application based on Vietnam's Legal Code and legal document database. The application is built on the Microservice Architecture and uses Generative AI to extract legal terms and Question Answering to answer user questions. The application is built with Open Source technologies and is deployed on Cloud platforms.
If you want to find out more about the contest, please visit the VFOSSA website.
We used Microservice Architecture to build this project to make it easier to scale and maintain. The following diagram shows the architecture of the project.
You can download the dataset from the following link:
First, clone the repository to your local machine:
git clone https://github.com/foxminchan/LawKnowledge
Next, navigate to the root directory of the project and install the dependencies:
pnpm install --force
For the website, you can run the following command:
npx nx serve website --prod
For the API, you can run the following command:
# For the API Gateway
npx nx serve api-gateway --prod
# For the Auth Service
npx nx serve auth-svc --prod
# For the Law Service
npx nx serve law-svc --prod
# For the Search Service, navigate to the search-svc directory
npx nx build search-svc && cd apps/api/search-svc/search-svc && python main.py
# For the Chat Service, navigate to the chat-svc directory
npx nx build chat-svc && cd apps/api/chat-svc/chat-svc && python main.py
To traning the model, you can run the following command:
npx nx build bert && cd apps/nlp/bert/bert && python main.py
To set up the infrastructure, you can run the following command:
npx nx up pulumi
[!IMPORTANT]
If you want to run with Nx, make sure you have installed `poetry` globally. Python version must be `>=3.9.1
For the website, you can run the following command:
npx nx test website-e2e
For the API, you can run the following command:
# For the Auth Service
npx nx test auth-svc-e2e
# For the Law Service
npx nx test law-svc-e2e
# For the Search Service
npx nx test search-svc-e2e
# For the Chat Service
npx nx test chat-svc
To test the model, you can run the following command:
npx nx test bert
To run the tooling for processing the dataset, you can run the following command:
npx nx build processor && cd apps/nlp/processor/processor && python main.py
For running documentation, you can run the following command:
npx nx serve docs
For running the Diagram as Code, you can run the following command:
npx nx build dac && cd assets/dac/dac && python main.py
Some useful scripts:
# Navigate to the scripts directory
cd tools/scripts && ls
# + scripts
# +-- build.sh --> Build the project
# +-- clean.sh --> Clean the docker image
# +-- init.sh --> Initialize the project
# +-- prepare.sh --> Prepare the project
# +-- start.sh --> Start the project
# +-- start-o11y.sh --> Start the observability stack
# +-- stop-o11y.sh --> Stop the observability stack
# Run the script
./<script-name>
You can see the dependency graph of the project by running the following command:
npx nx dep-graph
Here is the dependency graph of the project:
We are excited that you are interested in contributing to this project! Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
Read through our contributing guidelines to learn about our submission process, coding rules, and more.
Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Help us keep Law Knowledge open and inclusive. Please read and follow our Code of Conduct.
This project is licensed under the terms of the MIT license.