如何在brill词性标注器中定义和理解规则和模板?

时间:2018-01-15 10:25:24

标签: python machine-learning nltk pos-tagger

我试图弄清楚nltk部分语音标记。我正在使用brill tagger,它创建了一系列规则。我的模板如下: -

templates = [
    Template(Pos(1,1)),
    Template(Pos(2,2)),
    Template(Pos(1,2)),
    Template(Pos(1,3)),
    Template(Word(1,1)),
    Template(Word(2,2)),
    Template(Word(1,2)),
    Template(Word(1,3)),
    Template(Pos(-1, -1), Pos(1,1)),
    Template(Word(-1, -1), Word(1,1))
]

我的规则表如下: -

    Found 149 useful rules.

           B      |
   S   F   r   O  |        Score = Fixed - Broken
   c   i   o   t  |  R     Fixed = num tags changed incorrect -> correct
   o   x   k   h  |  u     Broken = num tags changed correct -> incorrect
   r   e   e   e  |  l     Other = num tags changed incorrect -> incorrect
   e   d   n   r  |  e
------------------+-------------------------------------------------------
  24  24   0   1  | VB->VBP if Pos:NN@[1]
  14  14   0   2  | JJ->NN if Pos:CD@[1]
  14  14   0   0  | NN->VBP if Pos:NNS@[1,2,3]
  11  11   0   0  | TO->IN if Pos:NN@[1,2]
   9   9   0   0  | JJ->VBP if Pos:NN@[1]
   1   1   0   0  | TO->IN if Pos:VB@[1]
   1   1   0   0  | VBP->NN if Word:my_group@[1]

我在理解方面存在问题,规则是什么。 例如。 NN->VBP if Pos:NNS@[1,2,3]

  

我的问题是: -

  • 如果给定句子中的1,2或3位置的词性标记是Noun,是否意味着将NN转换为Verb。
  • 相对于给定句子中的当前令牌是1,2和3还是暗示位于绝对指数1,2或3的令牌?
  • 模板如何与规则相关?我的意思是模板(Pos(1,2,3))负责生成规则: - NN->VBP if Pos:NNS@[1,2,3]

提前致谢。

0 个答案:

没有答案