spacy (nlp.make_doc(text), entities)` to check the alignment. Misaligned entities ('-') will be ignored during training.
https://www.cnpython.com/qa/1301944
Use `spacy.gold.biluo_tags_from_offsets(nlp.make_doc(text), entities)` to check the alignment. Misaligned entities ('-') will be ignored during training.
TRAIN_DATA = [
("XYZxyzg hat die beste Camera für Selfies", {"entities": [(0, 7, "BRAND"), (23, 28, "CAMERA")]}),
]
实体偏移需要与标记边界对齐。不能在令牌的中间启动/结束实体。在您的例子中,似乎出现了一个小错误,第二个实体的偏移量应该是(22, 28, "CAMERA")
中文也一样
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步