Supported Labels
[‘Family’, ‘Pet’, ‘Job’, ‘Likes’, ‘Dislikes’]
How to use
- Load model and perform prediction:
from tner import TransformersNER
model = TransformersNER("apperry-ai/fact_extraction_roberta")
output = model.predict(["My mom and dad is planning a big reunion next weekend"])
for entity in output['entity_prediction'][0]:
print(f"Type: {entity['type']}")
print(f"Entity: {', '.join(entity['entity'])}")
print(f"Position: {', '.join(map(str, entity['position']))}")
print(f"Probability: {', '.join(map(str, entity['probability']))}\n")