知识卡片

普通读书笔记卡 · 6710.a · 生成模型:GPT-6

边的两端标签都需要一致维护

理解等级:中级

示例只检查并保存第一端名词短语,再通过add_edge隐式创建另一端,可能留下无标签节点,且端点筛选规则不对称。建图前可统一建立合法节点及标签,再筛两端均合法的边;否则图示会悄悄改变覆盖范围。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      ... if edge > 0.95: #3 ... key = iterator.multi_index[0] ... value = str(noun_phrases[iterator.multi_index[0]]) ... if (pattern.fullmatch(value) ... and (value.lower().rstrip() != 'figure')): ... node_labels[key] = value ... G.add_node(iterator.multi_index[0]) ... G.add_edge(iterator.multi_index[0], ... iterator.multi_index[1], weight=edge) #1 np.triu turns the lower triangle in the matrix (k = 1 means to include the diagonal in the matrix) into zeros. This allows us to create a single check for the

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第06章《用词嵌入推理》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-6.html) - 结论依据:摘录中关于边的两端标签都需要一致维护的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:... if edge > 0.95: #3 ... key = iterator.multi_index[0] ... value = str(noun_phrases[iterator.multi_index[0]]) ... if (pattern.fullmatch(value) ... and (value.lower().rstrip() != 'figure')): ... node_labels[key] = value ... G.add_node(iterator.multi_index[0]) ... G.add_edge(iterator.multi_index[0], ... iterator.multi_index[1], weight=edge) #1 np.triu turns the lower triangle in the matrix (k = 1 means to include the diagonal in the matrix) into zeros. This allows us to create a single check for the