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

CV2-5247-support-yake-keyword-extraction-for-chinese #115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/model/yake_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def normalize_special_characters(self, text):
return text

def run_chinese_segmentation_with_jieba(self, text):
return " ".join(list(jieba.cut_for_search(text)))
return " ".join(list(jieba.cut(text)))

def run_yake(self, text: str,
language: str,
Expand Down
2 changes: 1 addition & 1 deletion test/lib/model/test_yake_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_normalize_special_characters(self):

def test_run_chinese_segmentation_with_jieba(self):
test_text = '''哈里斯同意与特朗普再进行一次美大选辩论'''
expected = "哈里 里斯 哈里斯 同意 与 特朗普 再 进行 一次 美 大选 辩论"
ahmednasserswe marked this conversation as resolved.
Show resolved Hide resolved
expected = "哈里斯 同意 与 特朗普 再 进行 一次 美 大选 辩论"
self.assertEqual(self.yake_model.run_chinese_segmentation_with_jieba(test_text), expected)

def test_run_yake_real_with_chinese(self):
Expand Down
Loading