惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
V
Visual Studio Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
博客园_首页
Recent Announcements
Recent Announcements
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Hacker News: Ask HN
Hacker News: Ask HN
S
Security Affairs
量子位
The Register - Security
The Register - Security
腾讯CDC
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
N
News and Events Feed by Topic
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
TaoSecurity Blog
TaoSecurity Blog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
H
Hacker News: Front Page
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
Know Your Adversary
Know Your Adversary
C
CXSECURITY Database RSS Feed - CXSecurity.com

博客园 - 网际大鱼

大鱼认为好的牛股排名 让所有的实体店成为网店的体验店 QQ机器人小P隆重发布,QQ号:792892125 带强名的.net程序反向工程后汇编中的问题总结 谁是股市上的最大受益者 数据挖掘之web文本自动分类 利用搜索引擎技术抢注域名 推出网站大鱼搜索 网页生成缩略图程序在win2003下IE控件实例超过10个出现错误的问题 oracle 9i以上最有效率的if(exists)update else insert操作 爬虫如何抓取到Asp.Net中__doPostBack获取新页面的数据 goole CodeSearch 的分页bug 域名注册,抢注工具编写 超强的ORC控件Asprise OCR补丁发布 QQ存在重大漏洞,用户可以群发小广告,传播病毒 用开源Carrot2的后缀树算法做Web文本聚类 隆重推出PowerDesinger 12.1.0.1913破解补丁 用OCR技术识别验证码---tesseract 用sniffer技术盗取电话银行密码
关键词与关键词之间的相关度计算
网际大鱼 · 2006-11-29 · via 博客园 - 网际大鱼

在信息论中常用互信息(MI,Mutual Information)来衡量两个词的相关度MI(X,Y)=log2p(x,y)/p(x)p(y)
MI越大,表示两个词之间的结合越紧密。
当X,Y关联大时,MI(X,Y)大于0;当X与Y关系弱时,MI(X,Y)等于0;当MI(X,Y)小于0时,X与Y称为“互补关系”

这个算式看起来很直观,但计算还是有些麻烦,因为计算概率值p(x),p(y)都需要在语料中进行分词,


下面介绍一个简便而直观的算法:
假设一个文章集合 {C},总文章数目为N,其中含有单词X的文章总数为Nx,含有单词Y的文章总数是Ny,含有{X+Y}的文章总数是 Nxy,那么相关性这么计算
Corr(X,Y)= Math.log10(N/Nx)*Math.log10(N/Ny)*Nxy/(Nx+Ny-Nxy)
我写了一个程序进行测试,首先准备一个词典,然后准备大量语料,为检索方便,用lucence建索引,然后查询每个词与两个词交集的个数。测试汽车,前两百名结果非常好。测试一个不常见的词,如活性炭,得到的结果如下,还蛮不错的。

主关键词x 关联词y 关联词数Ny 主关键词数Nx 总文章数N Nxy Coorr(X,y)
活性碳 不织布 16 72 1127199 9 2.316674
活性碳 回力胶 25 72 1127199 9 1.996593
活性碳 吸音棉 29 72 1127199 9 1.883334
活性碳 珍珠棉 31 72 1127199 9 1.831631
活性碳 滤袋 39 72 1127199 8 1.453371
活性碳 防尘网 59 72 1127199 9 1.32477
活性碳 云母片 26 72 1127199 6 1.26853
活性碳 压敏胶 27 72 1127199 6 1.250454
活性碳 超滤膜 19 72 1127199 4 0.92056
活性碳 海棉 119 72 1127199 9 0.82483
活性碳 反渗透 155 72 1127199 10 0.746471
活性碳 滤膜 47 72 1127199 4 0.639034
活性碳 电导仪 4 72 1127199 2 0.617857
活性碳 铜箔 100 72 1127199 6 0.614342
活性碳 糊精 52 72 1127199 4 0.606269
活性碳 铝粉 52 72 1127199 4 0.606269
活性碳 制冰机 27 72 1127199 3 0.605689
活性碳 水净化 219 72 1127199 10 0.554048
活性碳 滤芯 356 72 1127199 15 0.533304
活性碳 ro膜 14 72 1127199 2 0.489964
活性碳 工业水 165 72 1127199 7 0.489529
活性碳 二氧化钛 83 72 1127199 4 0.459238