# Rasa slot\_mappings FormAction doesn't as intended with SpaCy pretrained NER

**URL:** <https://forum.rasa.com/t/rasa-slot-mappings-formaction-doesnt-as-intended-with-spacy-pretrained-ner/21506>\
**Category:** Rasa Open Source\
**Created:** [November 20, 2019, 5:32pm UTC](https://forum.rasa.com/t/rasa-slot-mappings-formaction-doesnt-as-intended-with-spacy-pretrained-ner/21506 "2019-11-20T17:32:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![checker20](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/checker20/32/6000_2.png) [@checker20](https://forum.rasa.com/u/checker20)\
**Post date:** [November 20, 2019, 5:32pm UTC](https://forum.rasa.com/t/rasa-slot-mappings-formaction-doesnt-as-intended-with-spacy-pretrained-ner/21506/1 "2019-11-20T17:32:18Z")

</div>

Hi, I’m writing a simple chatbot where it requests the user’s data and fills some slots, similar to the restaurant formbot. The problem is that when I declare a custom slot “firstname” and try to map the extracted PERSON entity from spacy, it only works when firstname is expected (SEE EXAMPLE BELLOW) !

My setup

intents:

- greet: use\_entities: []
- goodbye: use\_entities: []
- request\_data: use\_entities: []

entities:

- PERSON
- ORG
- GPE

slots:

firstname:

```
type: unfeaturized

auto_fill: false

```

utter\_ask\_firstname:

- text: “What’s the person’s first name? firstname: {firstname}” utter\_slots\_values:
- text: “Registered employed with the following parameters firstname: {firstname}”

and story

## data input

- request\_data
  - employee\_form
  - form{“name”: “employee\_form”}
  - form{“name”: null}
  - utter\_slots\_values

## intent:request\_data

- I wanna register a person
- Register
- John
- first name John
- Firstname is John
- register John

actions.py

```
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
    """A dictionary to map required slots to
        - an extracted entity
        - intent: value pairs
        - a whole message
        or a list of them, where a first match will be picked"""
    slot_map = {
        "firstname": self.from_entity(entity="PERSON"))
    }
    return slot_map

```

If I type:

Me: Register

Bot: What’s the person’s first name?

Me: John

Bot: “Registered employed with the following parameters firstname: John”

but if I type

Me: Register John

Bot: “Registered employed with the following parameters firstname: none”

**BUT**

When I declare the slotname as PERSON, the bot works as expected! It seems that the line slot\_map = { “firstname”: self.from\_entity(entity=“PERSON”)) }

in order to work as expected, the key in slot\_map dict should be an entity already (in our case PERSON)! But this is not practical at all since I want to have one PERSON entity and fill many slots with this value.

This seems like a bug to me! Has anyone run into this?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [November 22, 2019, 2:32pm UTC](https://forum.rasa.com/t/rasa-slot-mappings-formaction-doesnt-as-intended-with-spacy-pretrained-ner/21506/2 "2019-11-22T14:32:35Z")

</div>

Hi there, can you post the logs from `--debug` mode of your rasa server and your action server?

---

<div class="post-metadata">

**Author:** ![npattarone](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/npattarone/32/12924_2.png) [@npattarone](https://forum.rasa.com/u/npattarone)\
**Post date:** [January 18, 2021, 4:12pm UTC](https://forum.rasa.com/t/rasa-slot-mappings-formaction-doesnt-as-intended-with-spacy-pretrained-ner/21506/3 "2021-01-18T16:12:37Z")

</div>

I have the same problem 😔 if I change my slot\_name to the same name as the entity PERSON it works… any help? Thanks a lot 🥰
