chunkers.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Natural-Language-Processing-Python-and-NLTK 作者: PacktPublishing 项目源码 文件源码
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])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号