# How can I train model to extract custom entities from text?

I have a 100-150 words text and I want to extract particular information like location, product type, dates, specifications and price.

Suppose if I arrange a training data which has a text as input and location/product/dates/specs/price as a output value. So I want to train the model for these specific output only.

I have tried Spacy and NLTK for entity extraction but that doesn't suffice above requirements.

Sample text:

For your specific problem i would use a hierarchical search. The first step should be to separate the text, each fragment should contain several entities, but would be more easy to identify them.

For example:

• Location, Dates, prices: You can use regex search, link.
• Specifications, locations: You can try using Deep Learning with character level bigrams, or word bigrams.

You need to make the training data as given below.

U.N. I-ORG
official O
Ekeus I-PER

Treat this as a classification task. here in given example, we have 3 classes ( I-ORG I-PER and I-LOC ). Now you can process such data using Multilayer Perceptron. LSTM, or CNN or Ensemble of all. For detail you may follow this blog