# Fine tuning NER BERT model on Phone numbers

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027%3E%5C
**Category:** Beginners\
**Created:** [March 17, 2023, 1:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027 "2023-03-17T13:17:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kosaraju](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@kosaraju](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkosaraju)%5C
**Post date:** [March 17, 2023, 1:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027%2F1 "2023-03-17T13:17:56Z")

</div>

Hello, I am new to this community. I have bit confusion regarding Fine tuning NER BERT model on Phone Numbers. According to my research fine tuning on BERT NER model. I need to create custom data with a inputs like Tag/Masks and POS tags, words and sentence\_idx( i.e is word related to same sentence). Sent it to a model. then as i understood pre trained model create word\_idx from Dictionary makes the model understand (word\_idx belonging Tagged data(PHONE\_NUMBER)) and simultaneously understand text contextual. Next time any data releated to same word\_idx as well as context is tagged as Phone\_number. What I have understand from BERT Model. So, I am preparing tags based on model tokenization like [‘drop’, ‘us’, ‘a’, ‘line’, ‘at’, ‘the’, ‘following’, ‘+’, ‘46’, ‘(’, ‘0’, ‘)’, ‘8’, ‘505’, ‘139’, ‘02’, ‘.’] and my tag should be some what [‘o’, ‘o’, ‘o’, ‘o’, ‘o’, ‘o’, ‘o’, ‘+’, ‘PHONE\_B’, ‘(’, ‘PHONE\_I’, ‘)’, ‘PHONE\_I’, ‘PHONE\_I’, ‘PHONE\_I’, ‘PHONE\_I’, ‘.’] and i will prepare POS tags based SPACY and FLAIR this is my pre processing. Then fine tuning. Is it correct procedure/understanding? I would be glad to have references and suggestion related to this.

---

<div class="post-metadata">

**Author:** ![iamdev](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iamdev](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fiamdev)%5C
**Post date:** [February 2, 2024, 3:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027%2F2 "2024-02-02T15:11:06Z")

</div>

Hi, trying the same. Were you able to achieve it?

---

<div class="post-metadata">

**Author:** ![EnesPux](https://avatars.discourse-cdn.com/v4/letter/e/ed8c4c/32.png) [@EnesPux](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FEnesPux)%5C
**Post date:** [May 30, 2024, 8:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027%2F3 "2024-05-30T08:12:47Z")

</div>

Hi, what’s the situation?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [May 31, 2024, 6:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-ner-bert-model-on-phone-numbers%2F34027%2F4 "2024-05-31T06:53:03Z")

</div>

For named-entity recognition (NER) you only need a list of words and corresponding labels (no need for POS tags).

See my [demo notebook](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/BERT/Custom_Named_Entity_Recognition_with_BERT.ipynb) to fine-tune BERT for NER.
