Example #1
0
def _(s: Influence, ontology: str = "UN", cutoff: float = 0.7) -> bool:
    """ Returns true if both subj and obj are grounded to the specified
    ontology"""

    return all(
        map(lambda c: is_well_grounded(c, ontology, cutoff), s.agent_list())
    )
Example #2
0
def contains_concept(s: Influence, concept_name: str, cutoff=0.7) -> bool:
    return any(
        map(
            lambda c: is_grounded_to_name(c, concept_name, cutoff),
            s.agent_list(),
        )
    )
Example #3
0
def is_well_grounded_statement(s: Influence, cutoff: float = 0.7) -> bool:
    """ Returns true if both subj and obj are grounded to the UN ontology. """

    return all(map(lambda c: is_well_grounded_concept(c, cutoff), s.agent_list()))