add segment with keyword issue (#3351)

Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
Jyong
2024-04-11 16:57:02 +08:00
committed by GitHub
parent 37024afe9c
commit 1f302990c6
3 changed files with 89 additions and 80 deletions

View File

@@ -48,6 +48,9 @@ class Jieba(BaseKeyword):
text = texts[i]
if keywords_list:
keywords = keywords_list[i]
if not keywords:
keywords = keyword_table_handler.extract_keywords(text.page_content,
self._config.max_keywords_per_chunk)
else:
keywords = keyword_table_handler.extract_keywords(text.page_content, self._config.max_keywords_per_chunk)
self._update_segment_keywords(self.dataset.id, text.metadata['doc_id'], list(keywords))