diff --git a/huixiangdou/primitive/bm250kapi.py b/huixiangdou/primitive/bm250kapi.py index cae1a11..9a5b21f 100644 --- a/huixiangdou/primitive/bm250kapi.py +++ b/huixiangdou/primitive/bm250kapi.py @@ -67,6 +67,8 @@ def _tokenize_corpus(self, corpus): def save(self, chunks:List[Chunk], filedir:str): # generate idf with corpus + if len(chunks) < 1: + return self.chunks = chunks filtered_corpus = []