How to prevent NER model to overfit entity position with Spacy

Viewed 315

I'm building a custom NER model to detect brands in product titles using a well sized dataset of 98k products with their corresponding title, the train contains around 84k records, validation split 10k and test split 3k. The only problem with the dataset is that 89% of all product titles have the brand as their first words.

When training the NER model from scratch, it gives a good F1 score of 85% after just few epochs (batch size =32), however when testing the model I noticed the follwoign :

  • The model is strongly biased toward predicting the first word of the title as a brand
  • The model is very good at detecting brands when they occur as first words, but is quite weak for titles having brands in their middle or end.

I had the idea to solve this by resampling the dataset and removing some brands from some titles as their first word and put it at the end or the middle.

However, I would like to know if there is a technique in NLP that allow the model to not give a large importance to the entity position in the text ? I used dropout of 0.6 but with no success

0 Answers
Related