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

Py36 drop: implement rasa telemetry improvement #9212

Closed
3 tasks
twerkmeister opened this issue Jul 27, 2021 · 1 comment
Closed
3 tasks

Py36 drop: implement rasa telemetry improvement #9212

twerkmeister opened this issue Jul 27, 2021 · 1 comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.

Comments

@twerkmeister
Copy link
Contributor

twerkmeister commented Jul 27, 2021

Description of Problem: With the python 3.6 drop, it seems possible to simplify the telemetry code according to this warning comment:

rasa/rasa/telemetry.py

Lines 680 to 749 in 3ac9530

@async_generator.asynccontextmanager
async def track_model_training(
training_data: "TrainingDataImporter", model_type: Text, is_finetuning: bool = False
) -> typing.AsyncGenerator[None, None]:
"""Track a model training started.
WARNING: since this is a generator, it can't use the ensure telemetry
decorator. We need to manually add these checks here. This can be
fixed as soon as we drop python 3.6 support.
Args:
training_data: Training data used for the training.
model_type: Specifies the type of training, should be either "rasa", "core"
or "nlu".
is_finetuning: `True` if the model is trained by finetuning another model.
"""
if not initialize_telemetry():
# telemetry reporting is disabled. we won't do any reporting
yield # runs the training
return # closes the async context
config = await training_data.get_config()
stories = await training_data.get_stories()
nlu_data = await training_data.get_nlu_data()
domain = await training_data.get_domain()
count_conditional_responses = domain.count_conditional_response_variations()
training_id = uuid.uuid4().hex
# Make sure to update the example in docs/docs/telemetry/telemetry.mdx
# if you change / add any properties
_track(
TRAINING_STARTED_EVENT,
{
"language": config.get("language"),
"training_id": training_id,
"type": model_type,
"pipeline": config.get("pipeline"),
"policies": config.get("policies"),
"num_intent_examples": len(nlu_data.intent_examples),
"num_entity_examples": len(nlu_data.entity_examples),
"num_actions": len(domain.action_names_or_texts),
# Old nomenclature from when 'responses' were still called
# 'templates' in the domain
"num_templates": len(domain.responses),
"num_conditional_response_variations": count_conditional_responses,
"num_slots": len(domain.slots),
"num_forms": len(domain.forms),
"num_intents": len(domain.intents),
"num_entities": len(domain.entities),
"num_story_steps": len(stories.story_steps),
"num_lookup_tables": len(nlu_data.lookup_tables),
"num_synonyms": len(nlu_data.entity_synonyms),
"num_regexes": len(nlu_data.regex_features),
"is_finetuning": is_finetuning,
},
)
start = datetime.now()
yield
runtime = datetime.now() - start
_track(
TRAINING_COMPLETED_EVENT,
{
"training_id": training_id,
"type": model_type,
"runtime": int(runtime.total_seconds()),
},
)

Definition of Done:

  • figure out what needs to be done - is it that the decorator can be used with python 3.7 or does something else needs changing?
  • change is implemented
  • change is tested
@twerkmeister twerkmeister 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 labels Jul 27, 2021
@rasabot-exalate rasabot-exalate added area:rasa-oss and removed 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 labels Mar 15, 2022 — with Exalate Issue Sync
@rasabot rasabot added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR and removed area:rasa-oss labels Mar 16, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss 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 and removed 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 labels Mar 17, 2022 — with Exalate Issue Sync
@m-vdb m-vdb added type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. and removed type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR labels Dec 8, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Dec 19, 2022

➤ Maxime Verger commented:

💡 Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

➡️ More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

@m-vdb m-vdb closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.
Projects
None yet
Development

No branches or pull requests

4 participants