Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

腾讯AI Lab开源的汉语词汇语料库 腾讯词向量 #24

Closed
Huandeep opened this issue Sep 5, 2022 · 14 comments
Closed

腾讯AI Lab开源的汉语词汇语料库 腾讯词向量 #24

Huandeep opened this issue Sep 5, 2022 · 14 comments
Labels
dict 词库相关

Comments

@Huandeep
Copy link

Huandeep commented Sep 5, 2022

提取自腾讯词向量

Small (2,000,000)
Large (12,287,936)

删除掉不必要的条目以及单字条目,Large 再逆序生成词频,再把SmallLarge 中交集出一份。
Large Small都分割成1-5个字的和5个字以上的两份文件。
感觉这玩意跟搜狗输入法的有点...嗯...熟悉

-_-y 有个别条目没有删干净,含有@等符号,不过不影响...

https://encrypt.lanzout.com/b06udvaxe
密码: 23fa

@iDvel
Copy link
Owner

iDvel commented Sep 5, 2022

这个真不错,之前也用过百万维基词库,腾讯这个包含了较多的日常用语,用起来应该很舒服。
我觉得在 small 取 3 个字以上的作为扩展词库,数量应该大约在 100 万左右,比较合适。

@iDvel
Copy link
Owner

iDvel commented Sep 6, 2022

似乎包含了大量的黄色网站相关内容😂

@iDvel
Copy link
Owner

iDvel commented Sep 6, 2022

提取了 small 3~8 个字的词。
已经完成异形词的修订、多音字的注音。
另外在两字词中找到了很多不在各种汉语词典的词汇,且很常用。
数量挺多的,准备选前几千个热门的,每天辨别挑选并加入一些。

@QiangF
Copy link

QiangF commented Sep 7, 2022

5个字以上的感觉用处不大。

@iDvel
Copy link
Owner

iDvel commented Sep 7, 2022

5个字以上的感觉用处不大。

还好,占比大概 10%,因为有很多常用句子,不都是冷门名词,就加进来了。

@lvii
Copy link

lvii commented Sep 7, 2022

新增的腾讯扩展字库 build 之后 的大小接近原来 3 倍,扩展词库都比主词库大了好多。

AI 有点凶猛呀,反客为主的节奏。

现在更新配置后,重新加载时间也变长了好多。

不知能否优化一下扩展词库,把腾讯 AI 单独词库单独分离出来,给用户一个轻量级的选择。

感谢!

size before

❯ du -sh *|sort -hr
 22M    build
 16M    cn_dicts
9.9M    zh-hans-t-essay-bgw.gram
2.2M    opencc
168K    sync
152K    en_dicts
 84K    pinyin_simp.userdb
 32K    symbols.custom.yaml.bak
 32K    symbols.custom.yaml
 20K    weasel.custom.yaml
 20K    squirrel.custom.yaml
...

❯ du -sh cn_dicts/*|sort -hr
 13M    cn_dicts/main.dict.yaml
2.6M    cn_dicts/ext.dict.yaml
112K    cn_dicts/8105.dict.yaml
8.0K    cn_dicts/others.dict.yaml
8.0K    cn_dicts/av.dict.yaml

❯ du -sh build/*|sort -hr
 21M    build/pinyin_simp.table.bin
1.2M    build/melt_eng.prism.bin
212K    build/melt_eng.table.bin
 92K    build/melt_eng.reverse.bin
 56K    build/pinyin_simp.reverse.bin
 44K    build/pinyin_simp.schema.yaml
 44K    build/pinyin_simp.prism.bin
...

size after

$ du -sh *|sort -hr
 60M	build
 31M	cn_dicts
9.9M	zh-hans-t-essay-bgw.gram
2.2M	opencc
152K	en_dicts
 32K	symbols.custom.yaml
 20K	weasel.custom.yaml
 20K	squirrel.custom.yaml
...

$ du -sh cn_dicts/*|sort -hr
 17M	cn_dicts/ext.dict.yaml
 13M	cn_dicts/main.dict.yaml
112K	cn_dicts/8105.dict.yaml
8.0K	cn_dicts/others.dict.yaml
8.0K	cn_dicts/av.dict.yaml

$ du -sh build/*|sort -hr
 59M	build/pinyin_simp.table.bin
1.2M	build/melt_eng.prism.bin
216K	build/melt_eng.table.bin
 92K	build/melt_eng.reverse.bin
 60K	build/pinyin_simp.reverse.bin
 44K	build/pinyin_simp.schema.yaml
 44K	build/pinyin_simp.prism.bin
...

@iDvel
Copy link
Owner

iDvel commented Sep 7, 2022

好的,正准备拆出来,也准备单独拆一个引入搜狗流行词。等写好了相关脚本,异形词和注音问题越来越多,之前的小脚本不够用了。

@lvii
Copy link

lvii commented Sep 7, 2022

这个 搜狗 词库 build 加载后的大小竟然比原字典还小:

https://github.com/ssnhd/rime/tree/master/配置文件

可以参考参考

❯ du -sh *|sort -hr|head
 46M    build
 42M    luna_pinyin.sogou.dict.yaml
2.8M    easy_en.dict.yaml
872K    luna_pinyin.dict.yaml
116K    opencc
 28K    squirrel.custom.yaml
 24K    luna_pinyin.userdb
 20K    easy_en.userdb
8.0K    luna_pinyin_simp.custom.yaml
4.0K    user.yaml

❯ du -sh build/*|sort -hr|head
 37M    build/luna_pinyin.extended.table.bin
2.8M    build/easy_en.table.bin
2.2M    build/stroke.prism.bin
1.9M    build/easy_en.prism.bin
1.1M    build/easy_en.reverse.bin
248K    build/luna_pinyin.extended.reverse.bin
 40K    build/luna_pinyin_simp.schema.yaml
 40K    build/double_pinyin.schema.yaml
 32K    build/luna_pinyin_simp.prism.bin
 16K    build/double_pinyin.prism.bin

@iDvel
Copy link
Owner

iDvel commented Sep 7, 2022

是因为他的词库都注音了,ext.dict.yaml 没有注音,尤其是含有「都 dou du」「长 chang zhang」等热门多音字的比较多,130 万的词库额外扩充了 40 万行左右,所以 build 之后比较大。
找到一个扩展包的方式:https://github.com/rime/home/wiki/DictionaryPack
研究一阵,有点摸不着头脑😓,再研究研究看看。

@lvii
Copy link

lvii commented Sep 7, 2022

@iDvel 原来如此,涨姿势了。那看来制作一个优质词库需要蛮多学问呢。

@lisansas
Copy link

腾讯加进来后输入顺畅了不少,非常实用。想着能不能更流畅,自己试了下,将large的2-5字(删除词频,深蓝筛选)词部署后花了两个小时都没成功。

做词库真的太难了。

iDvel大佬真的辛苦。

@iDvel
Copy link
Owner

iDvel commented Sep 21, 2022

@lisansas 还好,不是大佬,没什么技术含量,就是花点时间。

@lvii
Copy link

lvii commented Sep 24, 2022

词库里面 人名 还是蛮多的,不知是否能 精简 一下呢

@iDvel
Copy link
Owner

iDvel commented Sep 24, 2022

词库里面 人名 还是蛮多的,不知是否能 精简 一下呢

#10
每天都在弄,只弄两个字的。
三个字及以上不好弄,重码也不多,影响也不大。
这个只能肉眼检查纯手工弄,预计年底弄完。

@iDvel iDvel closed this as completed in 424eae4 Oct 19, 2022
@iDvel iDvel added the dict 词库相关 label Oct 21, 2022
Fankbai pushed a commit to Fankbai/customize_rime_clover_pinyin_input_method that referenced this issue Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dict 词库相关
Projects
None yet
Development

No branches or pull requests

5 participants