← 返回刚才阅读的位置

知识卡片

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

文档频率筛选不按总出现次数

理解等级:中级

CountVectorizer的min_df与max_df按包含词项的文档数或比例过滤,非按全语料累计出现次数。一个词在单篇重复上千次,仍可能只有1个文档频率;拟合后新文本必须使用同一列编号与筛选词表。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Once you have set up your environment and installed scikit-learn, you can use its CountVectorizer class whenever you want to count tokens. CountVectorizer is what scikit-learn calls a Transformer class, so it has a .fit() and a .transform() method you need to run, in that order. The .fit() method will count up the tokens in your entire corpus and keep track of how many times

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第03章《词频与逆文档频率向量》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-3.html) - 结论依据:摘录中关于文档频率筛选不按总出现次数的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Once you have set up your environment and installed scikit-learn, you can use its CountVectorizer class whenever you want to count tokens. CountVectorizer is what scikit-learn calls a Transformer class, so it has a .fit() and a .transform() method you need to run, in that order. The .fit() method will count up the tokens in your entire corpus and keep track of how many times