知识卡片

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

句子标签不等于完整句义

理解等级:中级

用一个名词短语为句向量贴标签,主要是便于图上辨认,不能保证它覆盖整句观点。max(span列表)也未明确按长度选择,若要最长需显式比较长度;无名词短语的句子被过滤后,图不再覆盖全部正文。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      >>> for sent in doc.sents: ... sent_noun_chunks = list(sent.noun_chunks) ... if sent_noun_chunks: ... sentences.append(sent) ... noun_phrases.append(max(sent_noun_chunks)) >>> sent_vecs = [] >>> for sent in sentences: ... sent_vecs.append(sent.vector) Now that you have sentence vectors and noun phrases, you should normalize61 the sentence vectors so that all your vectors have a length (or 2-norm) of 1. The 2-norm is computed the same way you compute the length

    参考来源

    - 位置:《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) - 结论依据:摘录中关于句子标签不等于完整句义的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:>>> for sent in doc.sents: ... sent_noun_chunks = list(sent.noun_chunks) ... if sent_noun_chunks: ... sentences.append(sent) ... noun_phrases.append(max(sent_noun_chunks)) >>> sent_vecs = [] >>> for sent in sentences: ... sent_vecs.append(sent.vector) Now that you have sentence vectors and noun phrases, you should normalize61 the sentence vectors so that all your vectors have a length (or 2-norm) of 1. The 2-norm is computed the same way you compute the length