Entity extraction from input sentence


So far I understood , how to train the model with the data and identify the intent.

How can we extract the entities in the user input sentence as part of Bi-directional LSTM model.

For ex : user enters “I want to fly from Mumbai to Delhi” , from this we know intent is “book_ticket” but how do we extract entities from input sentence like source entity is “Mumbai” and destination entity is “Delhi”

This is what I am thinking , please correct me if this expensive approach.We will train below sentences with labels:

label , sentence
book_ticket_mumbai_delhi, I want to fly from Mumbai to Delhi
book_ticket_mumbai_delhi, book ticket from Mumbai to Delhi
book_ticket_delhi_mumbai, I want to fly from Delhi to Mumbai
book_ticket_delhi_mumbai, book ticket from Delhi to Mumbai

Once we do the prediction , we can get the label. From label, we can extract the source and the destination entities?

Is there any other better way to ?


Please see Named-entity recognition

Thanks @balaji.ambresh . So, tensorflow has not support for entity extraction?

You can train a model from scratch or look for NER models online.

Any modern framework can be used to perform NER. Everything boils down to data preparation and model performance on your test set.