Views
No views yet
1import torch
2from transformers import pipeline
3
4# Load the NER pipeline
5ner_pipeline = pipeline("ner", model="ViravirastSHZ/Hafez-NER")
6
7# Example text in Persian
8text = "باراک اوباما در هاوایی متولد شد."
9
10# Perform NER
11entities = ner_pipeline(text)
12
13# Output the entities
14print(entities)
151@misc{ViravirastSHZ,
2 author = {ViravirastSHZ},
3 title = {Named-Entity-Recognition for Persian using Transformers},
4 year = {2024},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/"ViravirastSHZ/Hafez-NER}},
7}