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')
评论列表
文章目录