首页 > 其他 > 详细

PMI(point wise mutual information)笔记

时间:2014-03-18 11:41:31      阅读:596      评论:0      收藏:0      [点我收藏+]

    PMI主要可以用来衡量两个词之间的关联度(word association)

    可以参考论文

    Church K W, Hanks P. Word association norms, mutual information, and lexicography      [J]. Computational linguistics, 1990, 16(1): 22-29.

 

    大概是这么个思想,核心就是下面的公式

   bubuko.com,布布扣

    其中x,y分别代表一个单词。

    直接给例子:

    1.要有大量的文本资料,称为Docs,里面的单词总数为N

    2.计算set和from的关联程度也就是PMI值,记为PMI(set,from)

    3.分别求P(set,from),P(set),P(from)

    P(set) = set在Docs中出现的次数 / N

    P(from) = from在Docs中出现的次数 / N

    P(set,from) = set和from在Docs共现的次数/N

    set和from共现的次数(简称Co(set,from))计算方法:

        要设定一个窗口长度w,假如我们设定为5

        那么如果有这么个句子   we set from xx from xx in chinese(额乱编的不符合语法的 哈哈)

        从set开始(包括set)长度为5的窗口里的单词为 set from xx from xx(5个单词)

        那么Co(set,from) = 2, 因为 set from xx from xx   set from xx from xx

        如果它们在一个窗口里面的共现在次数超过1也就是Co(set,from)>=1的话,需要做标准化处理  

        Co(set,from) = Co(set,from)/(w-1)  为了保证它不超过1,不然就不能保证 P(set,from) <= P(set)了

    4.代入图片中的公式就可以求得PMI(set,from)

 

    需要注意的是,上面的set from是有顺序关系的,也就是PMI(set,from) != PMI(from,set) ,根据具体需要要忽略顺序关系也是可以的,只要分别求出以两个单词为首的共现度然后求和就可以了。

(套= CO(套/W-1
   

本文出自 “Never Stop Sharing” 博客,请务必保留此出处http://loma1990.blog.51cto.com/6082839/1378283

PMI(point wise mutual information)笔记,布布扣,bubuko.com

PMI(point wise mutual information)笔记

原文:http://loma1990.blog.51cto.com/6082839/1378283

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!