Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

請問一下,為甚麼斷詞結果是一個字一個字的 #40

Open
LichenghanKevin opened this issue Nov 18, 2021 · 2 comments
Open

Comments

@LichenghanKevin
Copy link

我使用
pip install -U ckiptagger 安裝

"""
from ckiptagger import data_utils, construct_dictionary, WS

data_utils.download_data_gdown("./")
ws = WS("./data")
ckip_tok = ws("老師你好")
"""

出來的結果是 :
[['老'], ['師'], ['你'], ['好']]

想請問我該怎麼改善這個問題

python 版本為 3.8.10
ckip 版本為 0.2.1

@jyhsu2000
Copy link

ws() 的第一個參數是 sentence_list
也就是句子的清單,而不是單一句子
多包一層 list 即可

ckip_tok = ws(["老師你好"])

@LichenghanKevin
Copy link
Author

ws() 的第一個參數是 sentence_list 也就是句子的清單,而不是單一句子 多包一層 list 即可

ckip_tok = ws(["老師你好"])

成功了!!!
太感謝了!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants