Skip to content

something wrong with run_time.py #6

Description

@weikang-wang
if previous_label > 0:  # If remaining previous not O we must write it.
            entity_label = config.id2label[previous_label]
            add_entity(data, doc_name, entity_label, previous_offset)

in line 163 to 165 , entity_label is "str" type

def add_entity(data, doc_name, label, offset):
    entity_label = config.id2label[label] if label > 0 else None
    if entity_label is not None:
        anafora.AnaforaEntity()
        entity = anafora.AnaforaEntity()
        num_entities = len(data.xml.findall("annotations/entity"))
        entity.id = "%s@%s" % (num_entities, doc_name)
        entity.spans = ((offset[0], offset[1]),)
        entity.type = entity_label.replace("B-", "")
        data.annotations.append(entity)

in line 123 to 132
But label is "int" type in entity_label = config.id2label[label] if label > 0 else None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions