cntext更新至1.1 版本
本次更新了共(现)词矩阵的计算函数。
更新方法
pip3 install cntext --upgrade
或指定版本安装
pip3 install cntext==1.1
co_occurrence_matrix
词共现矩阵
from cntext.dictionary import co_occurrence_matrix
documents = ["I go to school every day by bus .",
"i go to theatre every night by bus"]
co_occurrence_matrix(documents, window_size=2, lang='english')
documents2 = ["编程很好玩",
"Python是最好学的编程"]
co_occurrence_matrix(documents2, window_size=2, lang='chinese')
近期文章
如何在DataFrame中使用If-Else条件语句创建新列
SmartScraper | 简单、自动、快捷的Python网络爬虫