Skip to content

coronarita1991/Fraiday

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emergency Response Chatbot

  • if you want to read in KOREAN, click here

Usage

1. Clone the Repository:

git clone https://github.com/seongyeon1/Fraiday.git
cd Fraiday

2-1 Use the Makefile

To start the application for the first time:

make startapp
  • setup.sh will prompt you to enter your UPSTAGE_API_KEY during execution.

To rerun the application:

make rerun

2-2. Use the setup.sh Script

chmod +x setup.sh
./setup.sh
  • setup.sh will prompt you to enter your UPSTAGE_API_KEY during execution.

After execution, you can check the results at http://0.0.0.0:8000/

Rerun the App

python app/main.py

2-2. Do it step-by-step

Create a Virtual Environment

python3 -m venv .venv
. .venv/bin/activate

pip install --upgrade pip
pip install -r requirements.txt

Create a .env File

cat > .env
UPSTAGE_API_KEY='Your issued API key' # e.g., UPSTAGE_API_KEY=up_YW~
  • After entering, close the cat command using Ctrl+C.

Run the App

cd app
python main.py

Directory Structure

Fraiday
├── app
│   ├── main.py
│   ├── chat.py
│   ├── rag.py
│   └── template
│       └── (prompt templates)
├── preprocessing
│   ├── ocr.py
│   └── chunking.py
├── setup.sh
├── requirements.txt
└── .env(example)
└── .env(example)

app

  • app/main.py: The main page utilizing FastAPI and Langserve.
  • app/chat.py:
    • Uses the Upstage API to fine-tune prompts for an emergency response chatbot demo (under development).
    • Excels in multi-turn conversations.
    • Chats like a real emergency responder but lacks precise knowledge for professional expertise.
  • app/rag.py: Uses RAG (Seoul National University First Aid).
    • A more specialized model compared to the chat page.
    • Proficient in explaining first aid using RAG.
    • Informs about KTAS levels and summarizes conversations.
    • Lacks flexibility in conversations as it follows procedures to inform about KTAS levels.
  • app/templates: Stores prompt templates.

preprocessing

  • preprocessing/ocr.py
  • preprocessing/chunking.py
    • Functions for embedding and OCR processing for RAG.
    • Currently used for OCR processing and embedding Seoul National University data and the First Aid Guidebook.

Use Case Diagram

Now

Now

Future Work

Future Work

It will be implemented in the form of a router model that combines all of the following features

  • Multi-turn dialogue: It is possible to respond and respond quickly according to the context by being proficient in multi-turn dialogue (currently, it is possible to implement through chat.py model)
  • Provide first aid information: Provide accurate information based on clear knowledge (Currently, the rag.py model has been verified for implementation)
  • Conversation summary: Summarise the information received at the end of an emergency conversation and use it as an aid for emergency room visits (implemented by tuning the prompt to summarise specific conditions based on history)

Execution Results

  • Excels in multi-turn conversations.
  • Provides detailed explanations of first aid methods.
  • Informs about KTAS levels.
  • Summarizes the entire conversation for use as supplementary material when visiting the emergency room.

About

응급구조 요원 챗봇

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 96.9%
  • Python 3.0%
  • Other 0.1%