以conll格式输出结果(POS标记,stanford pos标记器) [英] Output results in conll format (POS-tagging, stanford pos tagger)

查看:151
本文介绍了以conll格式输出结果(POS标记,stanford pos标记器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Stanford POS-tagger,我想问问是否有可能解析(实际上只有pos标签就足够了)英文文本并以conll格式输出结果.有这样的选择吗?

I am trying to use Stanford POS-tagger, I want to ask if it is possible to parse (actually only pos tag would be enough) an english text and output the results in conll format. Is there such an option?

我正在使用斯坦福pos标记程序的完整3.2.0版本

I am using the full 3.2.0 version of the Stanford pos tagger

非常感谢

推荐答案

谈到CONLL格式,我想你是说CONLL2000分块任务格式如下:

When it comes to the CONLL format, i presume you mean the CONLL2000 chunking task format as such:

   He        PRP  B-NP
   reckons   VBZ  B-VP
   the       DT   B-NP
   current   JJ   I-NP
   account   NN   I-NP
   deficit   NN   I-NP
   will      MD   B-VP
   narrow    VB   I-VP
   to        TO   B-PP
   only      RB   B-NP
   #         #    I-NP
   1.8       CD   I-NP
   billion   CD   I-NP
   in        IN   B-PP
   September NNP  B-NP
   .         .    O

CONLL分块任务格式中包含三列:

There are three columns in the CONLL chunking task format:

  1. token(即单词)
  2. POS标签
  3. 块/短语标签的
  4. BIO(开始,内部,外部)
  1. token (i.e. word)
  2. POS tag
  3. BIO (begin, inside, outside) of chunk/phrase tag

遗憾的是,如果您使用stanford MaxEnt标记器,则它仅仅提供tokenPOS信息,而没有BIO块信息.

Sadly, if you use the stanford MaxEnt tagger, it only give you the token and POS information but has no BIO chunk information.

java -cp stanford-postagger.jar edu.stanford.nlp.tagger.maxent.MaxentTagger -model models/left3words-wsj-0-18.tagger -textFile short.txt -outputFormat tsv 2> /dev/null

使用上述命令,斯坦福POS标记器已经为您提供了制表符分隔的格式,只是它没有第三列(请参见

Using the above command the Stanford POS tagger already give you the tab separated format, just that it's without the 3rd column (see http://nlp.stanford.edu/software/pos-tagger-faq.shtml):

   He        PRP
   reckons   VBZ
   the       DT
   ...

要获取BIO列,您需要:

To get the BIO colum, you would require either:

  • 统计分块器
  • 完整解析器
  • a statistical chunker or
  • a full parser

请参见 http://www-nlp.stanford.edu/links/statnlp.html 有关分块器/解析器的列表,如果您想使用斯坦福工具,我建议您使用斯坦福解析器,但是它为您提供了括号内的解析格式,您必须进行一些后期处理才能将其转换为CONLL2000格式,请参见 http://nlp.stanford.edu/software/lex-parser.shtml

see http://www-nlp.stanford.edu/links/statnlp.html for a list of chunker/parser, if you want to stick with stanford tools, i suggest the stanford parser but it gives you the bracketed parse format, which you have to do some post-processing to get it into CONLL2000 format, see http://nlp.stanford.edu/software/lex-parser.shtml

这篇关于以conll格式输出结果(POS标记,stanford pos标记器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆