Docker compose for ckiplab/ckiptagger
- Download model files and put into
data
folder
- Start the service using
docker-compose
If you want to rebuild the image, adddocker-compose up -d
--build
flag when startupdocker-compose up --build -d
- Service is now on port
5005
- Stop the service using
docker-compose
docker-compose down
- Main
- method:
POST
- route:
/
- parameter
sentence_list
: sentence list for CKIP tagging, split multiple sentences by linebreak(\n
)
- method:
- Send request using curl
curl -X POST localhost:5005 -F $'sentence_list=土地公有政策??還是土地婆有政策。.\n最多容納59,000個人,或5.9萬人,再多就不行了.這是環評的結論.'
- Get the response like the following one
土地公(Nb) 有(V_2) 政策(Na) ?(QUESTIONCATEGORY) ?(QUESTIONCATEGORY) 還是(Caa) 土地(Na) 婆(Na) 有(V_2) 政策(Na) 。(PERIODCATEGORY) .(PERIODCATEGORY) (0, 3, 'PERSON', '土地公') 最多(VH) 容納(VJ) 59,000(Neu) 個(Nf) 人(Na) ,(COMMACATEGORY) 或(Caa) 5.9萬(Neu) 人(Na) ,(COMMACATEGORY) 再(D) 多(D) 就(D) 不行(VH) 了(T) .(PERIODCATEGORY) 這(Nep) 是(SHI) 環評(Na) 的(DE) 結論(Na) .(PERIODCATEGORY) (4, 10, 'CARDINAL', '59,000') (14, 18, 'CARDINAL', '5.9萬')
If you want to run this service without Docker, you can follow this steps after data
folder is ready.
However, we highly recommend using Docker Compose.
- Install required packages
pip3 install -r requirements.txt
- Run
python3 ckip_service.py