知识卡片

问题卡 · 6273.a

旧片段标签不能借用新词标签

理解等级:中级

示例在开始新名词块时,把旧块文本与当前新词的pos一起保存,可能给旧片段配上下一块标签。积累的文本及其标注属于同一结果,必须一起维护,不能只保留文本再拿当前循环状态凑元数据;否则后续按(实体,词性)计数也会被污染。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 2 处

    • · 查看原书依据

      all_entity_chunks.append((' '.join(current_entity_chunk), pos)) current_entity_chunk = [token] previous_pos = pos # Store the chunks as an index for the document # and account for

    • · 查看原书依据

      current_entity_chunk = [] for (token, pos) in sentence: if pos == previous_pos and pos.startswith('NN'): current_entity_chunk.append(token) elif pos.startswith('NN'): if current_en

    参考来源

    - 位置:《社交网站的数据挖掘与分析(原书第2版)》第5章《5.4 以实体为中心的分析:范式转换》(spine95;extracted/OReilly精品图书系列共21册(《Javascript权威指南》、《机器学习:实用案例解析》、《编写可读代码的艺术》、《算法精解》等)/_epub-src/text/part0084.html;u080-ch05-028)。 - 结论依据:原文在“all_entity_chunks.append((' '.join(current_entity_chunk), pos))”附近的定义、例子或代码支撑本卡核心说明:示例在开始新名词块时,把旧块文本与当前新词的pos一起保存,可能给旧片段配上下一块标签。边界按已读前提解释;示例未执行。 - 原始内容:all_entity_chunks.append((' '.join(current_entity_chunk), pos)) current_entity_chunk = [token] previous_pos = pos # Store the chunks as an index for the document # and account for - 位置:《社交网站的数据挖掘与分析(原书第2版)》第5章《5.4.1 领会人类语言数据》(spine95;extracted/OReilly精品图书系列共21册(《Javascript权威指南》、《机器学习:实用案例解析》、《编写可读代码的艺术》、《算法精解》等)/_epub-src/text/part0084.html;u081-ch05-028)。 - 结论依据:重构函数仍把旧块与当前词pos配对,需要同步维护片段状态。 - 原始内容:current_entity_chunk = [] for (token, pos) in sentence: if pos == previous_pos and pos.startswith('NN'): current_entity_chunk.append(token) elif pos.startswith('NN'): if current_en