知识卡片
逐词审计表有助定位抽取错误
把文本、词性、实体类型、依存和子节点并列显示,可以发现识别漏项与错分。保留token位置比单用词面作索引可靠,因为同一句可多次出现同一词;表格展示预测,不能替代标注正确性检查。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Let’s bring all the information about your tokens together in one table: >>> import pandas as pd >>> def token_dict(token): ... return dict(TOK=token.text, ... POS=token.pos_, TAG=token.tag_, ... ENT_TYPE=token.ent_type_, DEP=token.dep_, ... children=[c for c in token.children]) >>> token_dict(doc[0]) {'TOK': 'Gebru', 'POS': 'PROPN', 'TAG': 'NNP', 'ENT_TYPE': 'PERSON', 'DEP': 'nsubjpass', 'children': []} Now, you have a function you can use to extract the tags you are interested in
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第11章《信息抽取与知识图谱》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-11.html)
- 结论依据:摘录中关于逐词审计表有助定位抽取错误的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Let’s bring all the information about your tokens together in one table: >>> import pandas as pd >>> def token_dict(token): ... return dict(TOK=token.text, ... POS=token.pos_, TAG=token.tag_, ... ENT_TYPE=token.ent_type_, DEP=token.dep_, ... children=[c for c in token.children]) >>> token_dict(doc[0]) {'TOK': 'Gebru', 'POS': 'PROPN', 'TAG': 'NNP', 'ENT_TYPE': 'PERSON', 'DEP': 'nsubjpass', 'children': []} Now, you have a function you can use to extract the tags you are interested in