# Can we extract two different name within one user utternace?

**URL:** <https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873>\
**Category:** Rasa Open Source\
**Created:** [November 10, 2020, 3:51pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873 "2020-11-10T15:51:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 10, 2020, 3:51pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/1 "2020-11-10T15:51:26Z")

</div>

assume i asked the bot i want two person akela and amanda and can i extract this two names at the same time?

---

<div class="post-metadata">

**Author:** ![wafaa](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@wafaa](https://forum.rasa.com/u/wafaa)\
**Post date:** [November 11, 2020, 11:06am UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/2 "2020-11-11T11:06:17Z")

</div>

Hi @faiza_conte,

If I understood your question, I think you can if you provide more examples in nlu.md files to related intents.

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 11, 2020, 11:36am UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/3 "2020-11-11T11:36:24Z")

</div>

What if am using spacy for extracting names??

---

<div class="post-metadata">

**Author:** ![wafaa](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@wafaa](https://forum.rasa.com/u/wafaa)\
**Post date:** [November 11, 2020, 12:13pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/4 "2020-11-11T12:13:49Z")

</div>

I think it could help : [What is the best method for entity extraction for names?](http://forum.rasa.com/t/what-is-the-best-method-for-entity-extraction-for-names/4077)

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 11, 2020, 1:22pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/5 "2020-11-11T13:22:04Z")

</div>

Yes I did see that before…but that question is only for one name and what I want is …is it possible to extract two names at the same time…for example.\*I want to get in touch with adele and bella \* can these two name be extracted within one intent or it will.just took one if am doing \*name =tracker.get\_slot("name ").and there is two names and how will this tracker get the name ??

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [November 12, 2020, 2:23pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/6 "2020-11-12T14:23:13Z")

</div>

Yes, you can extract multiple entities in the same sentence. The last entity of a specific type that is extracted will be used to fill a slot of the same name. You can gather all the extracted entities in a custom action by looking at the message parsing info. e.g.

```auto
    all_entities = tracker.latest_message.get("entities", [])
    name_entities = [e for e in all_entities if e.get("entity") == "name"]

```

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 12, 2020, 3:42pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/7 "2020-11-12T15:42:22Z")

</div>

Okay I will try that…here for extracting name which way is better like duckling used to extract time,number and such things from a text or user utterance or message??

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [November 12, 2020, 8:53pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/8 "2020-11-12T20:53:08Z")

</div>

I think this is the same question you were asking here [Do I have to put from\_entity inorder for duckling to extract while we are doing formaction in rasa 2.0?](http://forum.rasa.com/t/do-i-have-to-put-from-entity-inorder-for-duckling-to-extract-while-we-are-doing-formaction-in-rasa-2-0/36786) so I’ll just quote the answer from there for the record:

> Duckling does not extract names. It extracts regularly patterned entities (like dates, numbers, etc.). For proper names, try SpaCy.

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 13, 2020, 7:50am UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/9 "2020-11-13T07:50:51Z")

</div>

No no that is not my question here…I say which way is better to extract name like duckling extract time and others…what I mean is just like duckling for extracting such entities what other extraction method is there for name…am not saying how to use duckling for name .am saying other way of extracting name that is what I meant here

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 13, 2020, 7:52am UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/10 "2020-11-13T07:52:32Z")

</div>

And I tried spacy but still I have to put all possible names for spacy to extract

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [November 16, 2020, 1:26pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/11 "2020-11-16T13:26:23Z")

</div>

Please see my reply on the other post linked to above.

---

<div class="post-metadata">

**Author:** ![faiza\_conte](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@faiza\_conte](https://forum.rasa.com/u/faiza_conte)\
**Post date:** [November 16, 2020, 1:43pm UTC](https://forum.rasa.com/t/can-we-extract-two-different-name-within-one-user-utternace/36873/12 "2020-11-16T13:43:28Z")

</div>

yes i did i replayed u am waiting for ur answer
