《textanalytics》课程简单总结(1):两种word relations——Paradigmatic vs. Syntagmatic
coursera上的公开课《https://www.coursera.org/course/textanalytics》系列,讲的很不错哦。
1、两种关系:Paradigmatic vs. Syntagmatic(聚合和组合)
• Paradigmatic: A & B have paradigmatic relation if they can
be substituted for each other (i.e., A & B are in the same class)
– E.g., “cat” and “dog”; “Monday” and “Tuesday” (聚合:同一类别的,high similar context)
• Syntagmatic: A & B have syntagmatic relation if they can be combined with each other (i.e., A & B are related semantically)
– E.g., “cat” and “sit”; “car” and “drive”(组合:常在一起出现的,high correlated occurrences but relatively low individual occurrences)
2、挖掘Paradigmatic(聚合)关系:
2.1、怎样挖掘两个词(比如dog和cat)的聚合关系强不强?
由于聚合关系本质上反映的是context similarity,所以我们能够首先获取全部文档中出现dog、cat的句子的context。dog左边一个词的context、dog右边一个词的context,比如:Left1(“cat”) = {“my”, “his”, “big”, “a”, “the”,…}。Right1(“cat”) = {“eats”, “ate”, “is”, “has”, ….}。Window(“cat”) = {“my”, “his”, “big”, “eats”, “fish”, …};同理可获得Left1(“dog”) 、Right1(“dog”)、Window(“dog”) 的context;这样,我们就能够通过计算Sim(“Cat”, “Dog”) = Sim(Left1(“cat”), Left1(“dog”)) + Sim(Right1(“cat”), Right1(“dog”)) + … + Sim(Window(“cat”), Window(“dog”))的大小来表示这两个词之间的聚合关系的强弱了。。。。
2.2详细到计算。经常使用的办法是Bag of Words,也就是Vector Space Model (VSM),须要解决两个问题:
1)怎样计算每个向量,即把Left1(“cat”) = {“my”, “his”, “big”, “a”, “the”,…}转化为vectorLeft1 = {3, 5, 8, 2, 7, ...}等VSM可用的形式。
2)怎样计算Sim(x1,
x2)。
解决这两个问题的一般性办法:Expected
Overlap of Words in Context (EOWC):
d1=(x1, …xN) ,当中xi =count(wi,d1)/|d1| (从文档d1中随机选一个词,是wi的概率)
d2=(y1,
…yN) ,当中yi =count(wi,d2)/|d2| (从文档d2中随机选一个词,是wi的概率)
Sim(d1,d2)=d1.d2=
x1y1+...+xnyn(分别从d1、d2中随机选一个词。两个词一样的概率)
EOWC有两个主要问题:
– It favors matching one frequent term very well over matching more distinct terms. ——通过平滑TF实现
情况1,d1、d2中的w1都很频繁,其它wi却差点儿不匹配,此时Sim(d1,d2)=10*10+0*0+...+1*3=123;情况2,d1、d2中的每一个wi都不是很频繁,但差点儿都出现了几次,此时Sim(d1,d2)=5*5+4*3+...+2*6=111;对于这两种情况,EOWC是无法区分的,而我们更倾向于情况2代表的相似度!
– It treats every word equally (overlap on “the” isn’t as so meaningful as overlap on “eats”).
——通过IDF实现
通过平滑TF:BM25 Transformation
通过IDF:IDF Weighting
终于表达式:
-----
3、挖掘Syntagmatic(组合)关系:
參考下一篇博客:。