NLPclass/Named_entity_recognition_persian
014
1---2library_name: transformers3license: mit4language:5- fa6pipeline_tag: token-classification7---8Named entity recognition On Persian dataset9 10traindataset=20484 persian sentense 11 12valdataset=256113 14AutoTokenizer=HooshvareLab/bert-fa-base-uncased15 16ner_tags=17['O', 'B-pro',18'I-pro',19'B-pers', 20'I-pers', 21'B-org', 22'I-org',23'B-loc',24'I-loc', 25'B-fac',26'I-fac', 27'B-event',28'I-event']29 30training_args=31 learning_rate=2e-5,32 33 per_device_train_batch_size=16,34 35 per_device_eval_batch_size=16,36 37 num_train_epochs=4,38 39 weight_decay=0.0140 41 42Training Loss=0.00100043 44sample1:45 'entity': 'B-loc',46 'score': 0.9998902,47 'index': 2,48 'word': 'تهران',49 50sample2:51 'entity': 'B-pers',52 'score': 0.99988234,53 'index': 2,54 'word': 'عباس',55 56 57for use this model:58 59 from transformers import pipeline60 61 pipe = pipeline("token-classification", model="NLPclass/Named_entity_recognition_persian")62 63 sentence = ""64 65 predicted_ner = pipe(sentence)66 67 for entity in predicted_ner:68 69 print(f"Entity: {entity['word']}, Label: {entity['entity']}")