def pyrata2conll (dictList, **kwargs):
"""
See 3.1 Reading IOB Format and the CoNLL 2000 Corpus http://www.nltk.org/book/ch07.html
can be used wi
nltk.chunk.conllstr2tree(text, chunk_types=['NP']).draw()
"""
if 'raw' in kwargs.keys():
rawFeatureName = kwargs['raw']
if 'pos' in kwargs.keys():
posFeatureName = kwargs['pos']
if 'chunk' in kwargs.keys():
chunkFeatureName = kwargs['chunk']
text = ''
for e in dictList:
text.append(' '.join([e[rawFeatureName], e[posFeatureName], e[chunkFeatureName], '\n']))
return text
# extend a given dictList
# merge dictList
# """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
# Run all the tests
# """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
评论列表
文章目录