### What problem does this PR solve? #5705 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)tags/v0.17.1
| ents.append({ | ents.append({ | ||||
| "Entity": n, | "Entity": n, | ||||
| "Score": "%.2f" % (ent["sim"] * ent["pagerank"]), | "Score": "%.2f" % (ent["sim"] * ent["pagerank"]), | ||||
| "Description": json.loads(ent["description"]).get("description", "") | |||||
| "Description": json.loads(ent["description"]).get("description", "") if ent["description"] else "" | |||||
| }) | }) | ||||
| max_token -= num_tokens_from_string(str(ents[-1])) | max_token -= num_tokens_from_string(str(ents[-1])) | ||||
| if max_token <= 0: | if max_token <= 0: |