Instructions to use apperry-ai/fact_extraction_roberta_crf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apperry-ai/fact_extraction_roberta_crf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="apperry-ai/fact_extraction_roberta_crf")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("apperry-ai/fact_extraction_roberta_crf") model = AutoModelForTokenClassification.from_pretrained("apperry-ai/fact_extraction_roberta_crf") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
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")
- Downloads last month
- 3