# How to access DIET embedding vectors?

**URL:** <https://forum.rasa.com/t/how-to-access-diet-embedding-vectors/38386>\
**Category:** Rasa Open Source\
**Created:** [December 24, 2020, 3:05pm UTC](https://forum.rasa.com/t/how-to-access-diet-embedding-vectors/38386 "2020-12-24T15:05:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bayesianwannabe](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@bayesianwannabe](https://forum.rasa.com/u/bayesianwannabe)\
**Post date:** [December 24, 2020, 3:05pm UTC](https://forum.rasa.com/t/how-to-access-diet-embedding-vectors/38386/1 "2020-12-24T15:05:20Z")

</div>

Hey all,

I want to access the dense vector obtained after convergence from the part marked with a red circle (this architecture picture without this mark is from the Rasa Whiteboard video: [Rasa Algorithm Whiteboard - Diet Architecture 1: How it Works - YouTube](https://www.youtube.com/watch?v=vWStcJDuOUk)).

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/8/8c7651a02bb3d4448040bae4cef513934049a8a4.jpeg)

I want to use the message vectors to analyze through some data mining or ML algorithms and obtain some general insights.

Now, I do understand that from a Message object applied to an NLU interpreter like presented on [this blog post](https://blog.rasa.com/evaluating-rasa-nlu-models-in-jupyter/) might offer me some sparse and dense features, probably the ones constructed before the DIETClassifier call.

Below is what I tried:

```
featurized_msg = nlu_interpreter.featurize_message(train_data.intent_examples[0])
featurized_msg.get_dense_features('text')[0].features # Seems to offer me the embedding for each token
featurized_msg.get_dense_features('text')[1].features # Seems to offer me the average of the vectors from the previous element as an embedding of the phrase

```

But then again, I think those are the vectors I obtain from my pre-trained word embedding from spaCy. Does anyone knows how can I access the word embeddings obtained from the DIET model?

Any help on this would be very appreciated!

Cheers

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [January 6, 2021, 3:21pm UTC](https://forum.rasa.com/t/how-to-access-diet-embedding-vectors/38386/2 "2021-01-06T15:21:03Z")

</div>

That’s a great question and we’re actually working on a feature that does this. You can find the PR [here](https://github.com/RasaHQ/rasa/pull/5673).

Once the feature is ready I’ll likely also add it as an easy to use the component in [whatlies](https://rasahq.github.io/whatlies/) so that you may inspect the “DIET”-embeddings from Jupyter.

---

<div class="post-metadata">

**Author:** ![bayesianwannabe](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@bayesianwannabe](https://forum.rasa.com/u/bayesianwannabe)\
**Post date:** [January 20, 2021, 12:07pm UTC](https://forum.rasa.com/t/how-to-access-diet-embedding-vectors/38386/3 "2021-01-20T12:07:33Z")

</div>

That’s nice! Thank you, Vincent. I really enjoy your Rasa Whiteboard videos.

It’s good to know that this is going to be addressed as I barely have experience using TensorFlow directly.

I also didn’t know about the whatlies lib, going to keep an eye on it.
