ec2(t2.medium 이상)에서만 동작합니다.
sudo apt install python3.7 python3-venv python3.7-venv
python3.7 -m venv <폴더 명>
. <폴더명>/bin/activate
python --version
3.7.15
pip install -r requirements.txt pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
다음 파일들을 다운 받아서 동일한 폴더에 배치
-
002/hi : Swear Word Detector https://drive.google.com/drive/folders/1--rBur0qpMURVvbnKJ_yREaLeEQlxgEs?usp=share_link
-
sentence_classifier/001 : Sentence Classifier https://drive.google.com/drive/folders/1Ue9TGgZ1z0kZPGv-IR7Crx2wq9Z-a7Xq?usp=share_link
문장의 각 토큰이 욕설인지 아닌 지 확인 https://colab.research.google.com/drive/1y8vJg8gvlv86r4fipOX0ERUsqaLRmiaz?usp=sharing
dataset 다운로드
https://drive.google.com/file/d/15EV3_mahFce17TMmJ_KgIzdFFcHKiLDT/view?usp=share_link
문장에 욕설이 있는 지 확인 https://colab.research.google.com/drive/1qN6BV4YQke0x4GYLju653ln1USayLsd_?usp=sharing
dataset 다운로드
https://drive.google.com/file/d/1QZ-_IZ9td2WErFQlucoqsi5TjPRBvL5h/view?usp=sharing https://drive.google.com/file/d/1BkaEXOYVF4sQMCSnZFvxJvnbyFvjzMi9/view?usp=sharing https://drive.google.com/file/d/1iq8bKboFybBl_vTs_5aqbz1_gkyOyHqR/view?usp=sharing https://drive.google.com/file/d/1bnDOdBi45bWzIaEQyxbz-GtDDDN20Mcm/view?usp=sharing
- ai.py : swear word detector만 존재하는 서버파일
- ai2.py : swear word detector + sentence classifier가 존재하는 서버파일
uvicorn <파일 명>:app --reload --host=0.0.0.0 --port=8000
# uvicorn ai:app --reload --host=0.0.0.0 --port=8000