This tool extracts content from the PDF files of the Civil Code, Criminal Code, Code of Criminal Procedure, Labor Standards Act, Labor Pension Act, and Occupational Safety and Health Facility Regulations found in the National Regulations Database. This tool is for research and learning purposes only. Please consult a professional lawyer for any legal needs.
- LangChain
- FAISS
- OpenAI
- Streamlit
# install components
pip install --upgrade pip
pip install -r requirements.txt
# generate vector index
python ingest.py
# define OpenAI api key
export OPENAI_API_KEY=$OPENAI_API_KEY
# launch QA AI
streamlit run main.py
# launch chat AI
streamlit run chat.py
- Replace files under
./docs
with your PDFs. - Remove
./faiss_index
folder. - Run
python ingest.py
to create vector index. - Launch server
streamlit run main.py
.
- Join GPT-4 API waitlist, or switch the model
- Choice a model via Models - OpenAI API, for example:
gpt-3.5-turbo
- Modify
main.py
andchat.py
, replacemodel_name="gpt-4"
tomodel_name="gpt-3.5-turbo"