tests.py 文件源码

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

项目:django-corenlp 作者: arunchaganty 项目源码 文件源码
def test_annotate_filter(self):
        """
        Filter mentions that are 'O' mentions.
            the mentions should correctly identify:
            - character offsets
            - glosses
            - links to canonical_mentions
            - links to parent_mentions
        """
        sentences, mentions = annotate_document(self._doc, self._client,
                                                mention_filter=lambda mentions:[m for m in mentions if m.type != 'O'])

        ipdb.set_trace()

        # Just assert counts.
        self.assertEqual(3, len(sentences))
        self.assertEqual(19, len(mentions))

        for m in mentions:
            self.assertTrue(m.ner != 'O')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号