# Extracting name entity from text

**URL:** <https://forum.rasa.com/t/extracting-name-entity-from-text/20114>\
**Category:** Rasa Open Source\
**Created:** [October 21, 2019, 12:13pm UTC](https://forum.rasa.com/t/extracting-name-entity-from-text/20114 "2019-10-21T12:13:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sravan2366](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sravan2366](https://forum.rasa.com/u/sravan2366)\
**Post date:** [October 21, 2019, 12:13pm UTC](https://forum.rasa.com/t/extracting-name-entity-from-text/20114/1 "2019-10-21T12:13:25Z")

</div>

Hi all,

I am looking for a suggestion here.

For some scenarios our bot requests the user to enter first and last names.

Below is the Example:-

Bot response:- What is your first name

User response:- test

Bot response:- what is your last name

User response:- Kumar

for the above scenario user entered details properly so there is no issue.

**if we observe the below scenario**

Bot response:- What is your first name

User response:- my first name test

Bot response:- what is your last name

User response:- Kumar - this is my last name

Here I just need to extract the first name as **Test** and last name as **Kumar**

I have used the Spacy library to extract the name details but that is too complicated approach. Is there any simple approach to extract the required info.

Note:- Our approach should not be limited to name, sometimes we request the user to enter email, Phone and etc.

---

<div class="post-metadata">

**Author:** ![IgNoRaNt23](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ignorant23/32/8029_2.png) [@IgNoRaNt23](https://forum.rasa.com/u/IgNoRaNt23)\
**Post date:** [October 22, 2019, 5:27am UTC](https://forum.rasa.com/t/extracting-name-entity-from-text/20114/2 "2019-10-22T05:27:07Z")

</div>

Personal name recognition is a pain in the ass. Go with spaCy whenever you can.

You need to rely on you entity extractor to pick up the right entities. This gets easier for more formal enitites like emails (where you can use a regex to support the recognition). For general entity regocnition see

> **[Rasa NLU in Depth: Entity Recognition](https://rasa.com/blog/rasa-nlu-in-depth-part-2-entity-recognition/)**
>
> Part 2 of our Rasa NLU in Depth series covers entity recognition. Learn more about fuzzy entities, address extraction, and mapping of entities.

If youre using a FormAction, you can also make use of ‘from\_text’ mapping, which takes the whole input of the user as a slot value. In this case it might be necessary to postprocess the message in the validate\_{slotname}-function.
