How to extract person names from user input?

Hi @huseyinyilmaz01. Names are tricky to extract since there is now general pattern, but there are some techniques you can use to get the best possible result. Here are my thoughts on it:

  1. A little comment on your training data - I can see that some examples like “what is the homework for Adam” doesn’t have the label for the entity. Is there a reason for that? In general, labelling some of the entities while leaving out some other ones will make your model prone to mistakes. So the first thing I would suggest is to make sure that all names you have in your training data are labelled.

  2. Using the SpacyEntityExtractor for names is great since it should do a pretty good job in extracting common names.

  3. You could also try using a form with a custom slot mapping. The method is quite nicely described in this thread.

  4. You could also include a lookup table in your pipeline if you can get a list of names to be extracted.

3 Likes