Fix field missing issue. (#3931)

### What problem does this PR solve?

#3905
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-12-09 13:20:58 +08:00 committed by GitHub
parent aaec630759
commit 215e9361ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,7 +273,7 @@ def embedding(docs, mdl, parser_config=None, callback=None):
batch_size = 16 batch_size = 16
tts, cnts = [], [] tts, cnts = [], []
for d in docs: for d in docs:
tts.append(rmSpace(d["title_tks"])) tts.append(rmSpace(d.get("docnm_kwd", "Title")))
c = "\n".join(d.get("question_kwd", [])) c = "\n".join(d.get("question_kwd", []))
if not c: if not c:
c = d["content_with_weight"] c = d["content_with_weight"]