We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
範例中設定權重字典為: word_to_weight = {"土地公": 1,"土地婆": 1,"公有": 2,"": 1,"來亂的": "啦","緯來體育台": 1,}
應該是希望可將 "土地公有政策??還是土地婆有政策。" 這句話斷成 ['土地', '公有', '政策' ...]
但是定義好字典後,斷出來仍是 ['土地公', '有', '政策' ...]
請問問題出在哪裡呢? (ps: 範例的字典也怪怪的,"來亂的": "啦" 跑掉了)
The text was updated successfully, but these errors were encountered:
參考 demo 網站,範例的自訂詞典作為 coerce_dictionary 時應會斷開 土地 和 公有。
Sorry, something went wrong.
您好,我也遇到相同問題,加入專有名詞後,如下 word_to_weight = { "緯來體育台": 1, "鬼金棒": 2, "海底撈": 2 } 仍無法斷出專有名詞"鬼金棒"或是"海底撈"... 句子:海底撈桌邊服務,服務態度超優的 斷詞結果:['海', '底', '撈', '桌', '邊', '服務', ',', '服務', '態度', '超優', '的']
再請您幫忙解惑使用方式了,謝謝您~
@r07725012 @alalachin, demo.py 裡面註解的地方要消掉。 Example:
sentence_list = [ "土地公有政策??還是土地婆有政策。.", "海底撈桌邊服務,服務態度超優的" ] word_to_weight = { "土地公": 1, "土地婆": 1, "公有": 2, "來亂的": "啦","緯來體育台": 1, "緯來體育台": 1, "鬼金棒": 2, "海底撈": 2 } word_sentence_list = ws(sentence_list) """ 會得到: 土地公 有 政策 ? ? 還是 土地 婆 有 政策 。 . 海 底 撈 桌 邊 服務 , 服務 態度 超優 的 """ word_sentence_list = ws(sentence_list, coerce_dictionary=dictionary) """ 會得到: 土地 公有 政策 ? ? 還是 土地婆 有 政策 。 . 海底撈 桌 邊 服務 , 服務 態度 超優 的 """
BTW @jacobvsdanniel 我看 Readme 或是 Wiki 裡面沒有提到 coerce_dictionary 跟 recommend_dictionary 還有 sentence_segmentation 是什麼意思QQ
No branches or pull requests
範例中設定權重字典為:
word_to_weight = {"土地公": 1,"土地婆": 1,"公有": 2,"": 1,"來亂的": "啦","緯來體育台": 1,}
應該是希望可將 "土地公有政策??還是土地婆有政策。" 這句話斷成
['土地', '公有', '政策' ...]
但是定義好字典後,斷出來仍是
['土地公', '有', '政策' ...]
請問問題出在哪裡呢?
(ps: 範例的字典也怪怪的,"來亂的": "啦" 跑掉了)
The text was updated successfully, but these errors were encountered: