Giter Club home page Giter Club logo

pingnote / chat-with-taiwan-laws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tpai/chat-with-taiwan-laws

0.0 0.0 0.0 3.43 MB

A question answering AI tool for the 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.

Home Page: https://chat-with-taiwan-laws.streamlit.app/

Python 96.71% Dockerfile 3.29%

chat-with-taiwan-laws's Introduction

Chat with Taiwan Laws

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.

Development Components

  • LangChain
  • FAISS
  • OpenAI
  • Streamlit
# install components
pip install --upgrade pip
pip install -r requirements.txt

Usage

# 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

Create your own QA AI

  1. Replace files under ./docs with your PDFs.
  2. Remove ./faiss_index folder.
  3. Run python ingest.py to create vector index.
  4. Launch server streamlit run main.py.

Demo

Chat

chat

QA

qa

FAQ

openai.error.InvalidRequestError: The model: \`gpt-4\` does not exist

Switch the model

  1. Choice a model via Models - OpenAI API, for example: gpt-3.5-turbo
  2. Modify main.py and chat.py, replace model_name="gpt-4" to model_name="gpt-3.5-turbo"

chat-with-taiwan-laws's People

Contributors

tpai avatar pingnote avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.