Ejemplo n.º 1
0
    def _process(self, input_pack: MultiPack):
        pack_i = input_pack.get_pack('default')
        pack_j = input_pack.get_pack('duplicate')

        for ent_i, ent_j in zip(pack_i.get(EntityMention),
                                pack_j.get(EntityMention)):
            link = CrossDocEntityRelation(input_pack, ent_i, ent_j)
            link.rel_type = 'coreference'
            input_pack.add_entry(link)
Ejemplo n.º 2
0
    def _process(self, input_pack: MultiPack):
        fp = input_pack.get_pack_at(0)
        sp = input_pack.get_pack_at(1)

        nes1 = list(fp.get(EntityMention))
        nes2 = list(sp.get(EntityMention))

        for ne1 in nes1:
            for ne2 in nes2:
                if ne1.text == ne2.text:
                    CrossDocEntityRelation(input_pack, ne1, ne2)