Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed model identifier in events #8914

Closed
2 tasks done
wochinge opened this issue Jun 18, 2021 · 7 comments · Fixed by #9917
Closed
2 tasks done

Embed model identifier in events #8914

wochinge opened this issue Jun 18, 2021 · 7 comments · Fixed by #9917
Assignees
Labels
area:rasa-oss/event-brokers Issues focused around the integration of rasa with different event brokers (such as RabbitMQ/Kafka) area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-x/models effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. feature:rasa-3.0/architecture type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@wochinge
Copy link
Contributor

wochinge commented Jun 18, 2021

Description of Problem:
Original issue: #8815 (comment)

We need a unique model identifier in each event caused by a model in order to tie model predictions to a model

Overview of the Solution:

  1. Create unique id for each trained model and embed it in the fingerprint.json (or a different file if the graph model is already underway)
  2. Attach this unique model ID to the metadata field of every event caused by this model

Definition of Done:

  • Models include a unique ID
  • Every event caused by predictions of a model includes this ID in its metadata
@wochinge wochinge added type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/event-brokers Issues focused around the integration of rasa with different event brokers (such as RabbitMQ/Kafka) area:rasa-x/models labels Jun 18, 2021
@wochinge wochinge added this to the 3.0 Rasa Open Source milestone Jun 21, 2021
@joejuzl joejuzl mentioned this issue Jun 21, 2021
3 tasks
@TyDunn
Copy link
Contributor

TyDunn commented Jun 30, 2021

@rudolfix and I were chatting about this. @wochinge will / could this unique model ID be a human readable model name?

@wochinge
Copy link
Contributor Author

What is a human readable model name and what purpose does it have? For me that's the name of the model archive. From my perspective the unique ID in the model is some arbitrary string.

@rudolfix
Copy link

hey @wochinge, we are looking how to analyze tracker data and it's easier for humans if they can name models and then for example compare the performance of old and new model in some kind of dashboard.

here I assume that model id is a cryptographic hash of various model files or even a random string. then having this string in event in tracker store I can somehow backtrack to actual model and read it configuration and name. in RASA X, API for model could be extended to get model by model id. correct?

@wochinge
Copy link
Contributor Author

wochinge commented Jun 30, 2021

then having this string in event in tracker store I can somehow backtrack to actual model and read it configuration and name. in RASA X, API for model could be extended to get model by model id. correct?

Exactly 👍🏻

I think the renaming whatever should be done in the dashboard then to avoid collisions.

@rudolfix
Copy link

in case of SDK I can then create the fingerprint file myself with a content I wish. In other words: this will also work without Rasa X? thanks for your time :)

@wochinge
Copy link
Contributor Author

wochinge commented Jul 2, 2021

Why do you want to create the fingerprint in the SDK yourself?

It will work as follows

  1. We assign each model a unique ID
  2. Whenever we update a tracker with new events we attach the unique model ID (this includes events created in the SDK, through the API, or internally)
  3. All persisted / published events will have this ID as part of their payload

How we handle it in Rasa X is up to the teams working on Rasa X. In theory they'd add a column to the model table which tracks the unique ID for each model in the database + have a column model_id on conversation_event. They then can tie each event to a specific model.

@rudolfix
Copy link

rudolfix commented Jul 2, 2021

ok got it! just looked what is already in model archive and now I understand it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss/event-brokers Issues focused around the integration of rasa with different event brokers (such as RabbitMQ/Kafka) area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-x/models effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. feature:rasa-3.0/architecture type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants