Skip to content

Erro de instanciação de variável complement  #2

@lucasyanm

Description

@lucasyanm

Alguns casos a variável complement nunca era instânciada porque caia em alguns casos de if onde não havia um else.

Adicionei uma instanciação da variável antes das iterações do método extract_clauses no meu colab para conseguir rodar o código.

def extract_clauses(span):
    clauses = []
    verb_chunks = _get_verb_chunks(span)
    for verb in verb_chunks:

        subject = _get_subject(verb)
        if not subject:
            continue
        
        complement = None

        # Check if there are phrases of the form, "AE, a scientist of ..."
        # If so, add a new clause of the form:
        # <AE, is, a scientist>
        for c in subject.root.children:
            if c.dep_ in APPOSITIVE_DEPREL:                
                appos = extract_span_from_entity(c)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions