# Metadata in message in NLU pipeline component

**URL:** <https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767>\
**Category:** Rasa Open Source\
**Created:** [March 30, 2020, 9:27am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767 "2020-03-30T09:27:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristianmtr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/cristianmtr/32/4894_2.png) [@cristianmtr](https://forum.rasa.com/u/cristianmtr)\
**Post date:** [March 30, 2020, 9:27am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/1 "2020-03-30T09:27:49Z")

</div>

Hello,

I was wondering if there’s any way to extract a message’s metadata in a NLU pipeline component?

This metadata is inserted in our custom channel handler for Facebook Messenger, but it doesn’t show up in the `Message` object in the `process()` method of the `Component`. Is this intended? Is there an easy way to achieve this?

Adding @nbeuchat, as we work together.

---

<div class="post-metadata">

**Author:** ![nbeuchat](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nbeuchat/32/13688_2.png) [@nbeuchat](https://forum.rasa.com/u/nbeuchat)\
**Post date:** [March 30, 2020, 5:04pm UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/2 "2020-03-30T17:04:55Z")

</div>

Hi all! Just wanted to add some more context here as I work with @cristianmtr. One thing we want to do is passing some geographic context to the bot so that location entities can be properly disambiguated.

For example, if a user is looking for a place in NYC, we want to be able to differentiate between “Downtown” between NY or other cities so that we get the proper ID for this location. Up until now, we’ve done this mapping in actions so it was easy to use slots for the context. The problem is that we want to extend our location parsing using a custom pipeline component which uses Spacy’s pattern matcher. But we first need our disambiguation before applying the patterns.

That’s why we’re trying to pass some context to the NLU pipeline somehow.

Thanks for your help! Nico

---

<div class="post-metadata">

**Author:** ![cajoek](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@cajoek](https://forum.rasa.com/u/cajoek)\
**Post date:** [June 24, 2020, 12:25pm UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/3 "2020-06-24T12:25:23Z")

</div>

Hi @cristianmtr and @nbeuchat, I have the same problem, did you manage to solve it?

Thanks!

---

<div class="post-metadata">

**Author:** ![cristianmtr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/cristianmtr/32/4894_2.png) [@cristianmtr](https://forum.rasa.com/u/cristianmtr)\
**Post date:** [July 2, 2020, 10:22am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/4 "2020-07-02T10:22:13Z")

</div>

not as of yet unfortunately. we are doing that processing in an action now, where we have access to the metadata

---

<div class="post-metadata">

**Author:** ![cajoek](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@cajoek](https://forum.rasa.com/u/cajoek)\
**Post date:** [July 3, 2020, 10:31am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/5 "2020-07-03T10:31:57Z")

</div>

Okay, I created a Feature request based on my use case. @cristianmtr maybe you want to show your support by sharing yours? [Make metadata aviable in NLU pipline · Issue #6090 · RasaHQ/rasa · GitHub](https://github.com/RasaHQ/rasa/issues/6090)

---

<div class="post-metadata">

**Author:** ![cristianmtr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/cristianmtr/32/4894_2.png) [@cristianmtr](https://forum.rasa.com/u/cristianmtr)\
**Post date:** [July 3, 2020, 11:46am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/6 "2020-07-03T11:46:49Z")

</div>

Cool! Just did 🙂

---

<div class="post-metadata">

**Author:** ![dingusagar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dingusagar/32/11071_2.png) [@dingusagar](https://forum.rasa.com/u/dingusagar)\
**Post date:** [February 18, 2021, 2:29pm UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/7 "2021-02-18T14:29:34Z")

</div>

the default interpreter for Agent seems to be RasaNLUInterpreter. But RasaNLUInterpreter does not pass on the metadata in its parse method. How can I get my metadata inside the process method of my custom components.

---

<div class="post-metadata">

**Author:** ![samvatsar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/samvatsar/32/6661_2.png) [@samvatsar](https://forum.rasa.com/u/samvatsar)\
**Post date:** [April 6, 2021, 10:53am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/8 "2021-04-06T10:53:00Z")

</div>

@cristianmtr I can see that the issue is resolved. Can anyone please let me know how to access metadata in the custom NLU component?

---

<div class="post-metadata">

**Author:** ![samvatsar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/samvatsar/32/6661_2.png) [@samvatsar](https://forum.rasa.com/u/samvatsar)\
**Post date:** [April 6, 2021, 10:53am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/9 "2021-04-06T10:53:55Z")

</div>

Did you guys get to know how to access metadata in NLU component?

---

<div class="post-metadata">

**Author:** ![samvatsar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/samvatsar/32/6661_2.png) [@samvatsar](https://forum.rasa.com/u/samvatsar)\
**Post date:** [April 8, 2021, 6:32am UTC](https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767/10 "2021-04-08T06:32:08Z")

</div>

@rctatman , when I access metadata in nlu pipeline component by using message.get(‘metadata’), its always “None”. Please let me know if it is the correct way of accessing metadata in nlu component.
