Edit model card

Hafez NER for Persian using Transformers

Model Details

Model Description: This Named-Entity-Recognition (NER) model is designed to identify and classify named entities in Persian (Farsi) text into predefined categories such as person names, organizations, locations, dates, and more. The model is built using the Hugging Face Transformers library and fine-tuned on the ViravirastSHZ/Hafez_Bert model.

Intended Use: The model is intended for use in applications where identifying and classifying entities in Persian text is required. It can be used for information retrieval, content analysis, customer support automation, and more.

Model Architecture:

Training Data

Dataset: The model was trained on a diverse corpus of Persian text, with a training dataset of 23,000

Data Preprocessing:

  • Text normalization and cleaning were performed to ensure consistency.
  • Tokenization was done using the BERT tokenizer.

Training Procedure

Training Configuration:

  • Number of Epochs: 3
  • Batch Size: 8
  • Learning Rate: 1e-5
  • Optimizer: AdamW

Hardware:

  • Training Environment: NVIDIA P100 GPU
  • Training Time: Approximately 1 hour

Model Prediction Tags

The model predicts the following tags:

  • "O"
  • "I-DAT"
  • "I-EVE"
  • "I-FAC"
  • "I-LOC"
  • "I-MON"
  • "I-ORG"
  • "I-PCT"
  • "I-PER"
  • "I-PRO"
  • "I-TIM"
  • "B-DAT"
  • "B-EVE"
  • "B-FAC"
  • "B-LOC"
  • "B-MON"
  • "B-ORG"
  • "B-PCT"
  • "B-PER"
  • "B-PRO"
  • "B-TIM"

How To Use

import torch
from transformers import pipeline

# Load the NER pipeline
ner_pipeline = pipeline("ner", model="ViravirastSHZ/Hafez-NER")

# Example text in Persian
text = "باراک اوباما در هاوایی متولد شد."

# Perform NER
entities = ner_pipeline(text)

# Output the entities
print(entities)
@misc{ViravirastSHZ,
  author = {ViravirastSHZ},
  title = {Named-Entity-Recognition for Persian using Transformers},
  year = {2024},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/"ViravirastSHZ/Hafez-NER}},
}
Downloads last month
29
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Space using ViravirastSHZ/Hafez-NER 1