Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
predicted_entities = []
for s in spans:
predicted_entities.append(
{
"value": s.text,
"start": s.start_pos,
"end": s.end_pos,
"entity": s.tag,
"extractor": "flair",
"confidence": s.score,
}
)
entity_results.append(
EntityEvaluationResult(
ex.get("entities", []), predicted_entities, result.get("tokens", [])
)
)
if entity_results:
extractors = ["flair"]
return evaluate_entities(entity_results, set(extractors), None)["flair"]
return {}