新词发现算法
Project description
pyUnit-NewWord
无监督训练文本词库
安装
pip install pyunit-newword
注意事项
该算法采用Hash字典存储,大量消耗内存。100M的纯中文文本需要12G以上的内存,不然耗时太严重。
训练代码(文本是UTF-8格式)
from pyunit_newword import NewWords
if __name__ == '__main__':
nw = NewWords(filter_cond=10, filter_free=2)
nw.add_text(r'C:\Users\Administrator\Desktop\微博数据.txt')
nw.analysis_data()
with open('分析结果.txt', 'w', encoding='utf-8')as f:
for word in nw.get_words():
print(word)
f.write(word[0] + '\n')
爬虫的微博数据一部分截图(大概100M纯文本)
训练微博数据后的结果
训练后得到的词语视频
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pyunit_newword-2018.2.28-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8747c988011f133a702d0830e568c15229036230101d34a6e71d9a7b930446b |
|
MD5 | 1a46f7dafa8f773e0a7ac7f6734683b8 |
|
BLAKE2b-256 | b1ef6a30ac73a49d79198ba73f2a34a56cb00f8308655b7ab23b4df1a313a250 |