Spaces:
Sleeping
Sleeping
Download app.py from AmiKim/BookRecommend: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/spaces/AmiKim/BookRecommend/resolve/main/app.py
- Command line
-
hf download hf://spaces/AmiKim/BookRecommend/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AmiKim/BookRecommend/resolve/main/app.py
384 Bytes
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from kiwipiepy import Kiwi | |
| app = FastAPI() | |
| kiwi = Kiwi() | |
| class TextInput(BaseModel): | |
| text: str | |
| def tokenize(input: TextInput): | |
| tokens = kiwi.tokenize(input.text) | |
| return { | |
| "tokens": [t.form for t in tokens], | |
| "tagged": [{"form": t.form, "tag": t.tag} for t in tokens] | |
| } |