1. 简介
TextRank, 基于图模型的关键词和句子抽取. 与 google 的PageRank有一定的相通之处. 都是 unsupervised.
2. theory
术语约定:
- vote
G=(V,E). 点 A links to B , 可以认为是 A 对 B 发起的一次vote, 即 A casts a vote for B.
TextRank model 的基本思想是:
- 点A得到的投票数越多, A越重要.
- 点A的重要性直接影响到它所投票的重要性.
2.1 formula
S(Vi)=(1−d)+d∗∑j∈In(Vi)1|Out(Vj)|S(Vj)(1)
-
S(Vi)
score of Vi - d
damping factor that can be set [0,1], usually set to 0.85. -
In(Vi)
the set of vertices that point to Vi -
Out(Vi)
the set of vertices that Vi point to .
3.build graph
基于图的排序模型, 那么关键就是建图.
3.1 edge
two vertices are connected if they co-occur within a window of maximum N words, where N can be set anywhere between [2,10].
- directed edge
若要有序, the direction was set following the natural flow of the text. - undirected edge
无向边可以认为是双向的弧.
3.2 vertex
句子由若干个word组成 , 需要对这些 word 作简单的处理, 才能当作 vertices , added to the graph.
- pre-processing
根据stop word, 词性标注过滤一部分, 剩下的当作vertex.
论文实验显示, 仅考虑 noun 和 adjective 是好的. - processing
根据文本构建 graph 的过程. - post-processing
相邻接的 key word sequence 会 collapsed into multi-word keyword.
论文中是这么举例的. 在文章Matlab code for plotting ambiguity functions
中, 如果Matlab
与code
总是邻接, 那么就可以考虑合成为Matlab code
, 丰富意思的表达.
4. discussion
论文中试验用的 data set is a collection of 500 abstracts from the Inspec
database.
结果: precision:31.2, Recall:43.1, F-measure:36.2 .
- window size
论文中用了(2,3,510), 取2时效果最好. - directed or undirected edge
论文中用 无向边 的时候, 效果最好.
5. sentence extraction
可以用于 自动生成摘要.
- 顶点
不再是单词, 而是整个句子. - 边
不再以 co-occurrence 作为连接的条件, 因为 “co-occurrence” is not a meaningful relation for such large context.
而是依据 similarity.
记 句子 S=w1,w2,...,wn , 表示为单词的序列, 那么句子之间的相似度为:
Similarity(Si,Sj)=|{wk|wk∈Si∩wk∈Sj}|log(|Si|)+log(|Sj|)(5-1)
把相似度作为权重, 计算顶点的重要性:
WS(Vi)=(1−d)+d∗∑j∈In(Vi)wj,i∑k∈Out(Vj)wj,kWS(Vj)(5-2)