Commit
·
cf27cda
1
Parent(s):
414dfdc
Chage get to post
Browse files- routers/tokenize.py +2 -2
routers/tokenize.py
CHANGED
@@ -28,7 +28,7 @@ class WordTokenizeResponse(BaseModel):
|
|
28 |
class SubwordTokenizeResponse(BaseModel):
|
29 |
subwords: List[str] = []
|
30 |
|
31 |
-
@router.
|
32 |
def word_tokenize(text: str, engine: WordTokenizeEngine = "newmm"):
|
33 |
"""
|
34 |
Word tokenize
|
@@ -36,6 +36,6 @@ def word_tokenize(text: str, engine: WordTokenizeEngine = "newmm"):
|
|
36 |
return {"words": py_word_tokenize(text=text, engine=engine)}
|
37 |
|
38 |
|
39 |
-
@router.
|
40 |
def subword_tokenize(text: str, engine: SubwordTokenizeEngine = "tcc"):
|
41 |
return {"subwords": py_subword_tokenize(text=text, engine=engine)}
|
|
|
28 |
class SubwordTokenizeResponse(BaseModel):
|
29 |
subwords: List[str] = []
|
30 |
|
31 |
+
@router.post('/word_tokenize', response_model=WordTokenizeResponse)
|
32 |
def word_tokenize(text: str, engine: WordTokenizeEngine = "newmm"):
|
33 |
"""
|
34 |
Word tokenize
|
|
|
36 |
return {"words": py_word_tokenize(text=text, engine=engine)}
|
37 |
|
38 |
|
39 |
+
@router.post('/subword_tokenize', response_model=SubwordTokenizeResponse)
|
40 |
def subword_tokenize(text: str, engine: SubwordTokenizeEngine = "tcc"):
|
41 |
return {"subwords": py_subword_tokenize(text=text, engine=engine)}
|