← 返回刚才阅读的位置

知识卡片

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

字符计数示例尚未实现BPE训练

理解等级:中级

CountVectorizer按字符1到2元组建词表并计数,能够观察频率,却没有按合并规则改写符号序列。固定重叠二元组的表不能直接叫训练完成的BPE;若要说明下一轮合并,应展示序列和计数如何随已选合并变化。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      >>> vectorizer = CountVectorizer(ngram_range=(1, 2), analyzer='char') >>> vectorizer.fit(texts) CountVectorizer(analyzer='char', ngram_range=(1, 2)) We’ve created a CountVectorizer class that will tokenize the text into characters instead of words. It will count token pairs (character 2-grams), the byte pairs in BPE encoding, in addition to single-character tokens. Now, we can examine our vocabulary to see what they look like: >>> bpevocab_list = [ ... sorted((i, s) for s,

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第02章《思维的词元》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-2.html) - 结论依据:摘录中关于字符计数示例尚未实现BPE训练的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:>>> vectorizer = CountVectorizer(ngram_range=(1, 2), analyzer='char') >>> vectorizer.fit(texts) CountVectorizer(analyzer='char', ngram_range=(1, 2)) We’ve created a CountVectorizer class that will tokenize the text into characters instead of words. It will count token pairs (character 2-grams), the byte pairs in BPE encoding, in addition to single-character tokens. Now, we can examine our vocabulary to see what they look like: >>> bpevocab_list = [ ... sorted((i, s) for s,