def parse(self, tagged_sent):
'''Parsed tagged tokens into parse Tree of chunks'''
if not tagged_sent: return None
(words, tags) = zip(*tagged_sent)
chunks = self.tagger.tag(tags)
# create conll str for tree parsing
wtc = zip(words, chunks)
return conlltags2tree([(w,t,c) for (w,(t,c)) in wtc])
chunkers.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录