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

Add __repr__ to Token object #7250

Closed
koaning opened this issue Nov 12, 2020 · 6 comments
Closed

Add __repr__ to Token object #7250

koaning opened this issue Nov 12, 2020 · 6 comments
Assignees
Labels
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

Comments

@koaning
Copy link
Contributor

koaning commented Nov 12, 2020

When I'm debugging what is happening in a pipeline I usually have a look and print the Message.

It might look something like;

> message.as_dict_nlu()
 {'entities': [],
 'intent': 

 {'confidence': 0.8422146439552307, 'id': 5464168520135895892, 'name': 'are_you_real'} 

,
 'intent_ranking': [

 {'confidence': 0.8422146439552307, 'id': 5464168520135895892, 'name': 'are_you_real'} 

,

 {'confidence': 0.04479081928730011, 'id': -5724794541682903534, 'name': 'how_made'} 

,

 {'confidence': 0.021328529343008995, 'id': -6505008832162321521, 'name': 'how_are_you'} 

,

 {'confidence': 0.019935669377446175, 'id': 522343063256866795, 'name': 'what_can_you_do'} 

,

 {'confidence': 0.013976013287901878, 'id': 7022544970669495622, 'name': 'languages'} 

,

 {'confidence': 0.013974795117974281, 'id': -279316034893973609, 'name': 'weather'} 

,

 {'confidence': 0.013861254788935184, 'id': -3284643768121576930, 'name': 'what_time'} 

,

 {'confidence': 0.013021928258240223, 'id': -938916847167484283, 'name': 'who_made_you'} 

,

 {'confidence': 0.011181396432220936, 'id': 2425092467132022535, 'name': 'birthday'} 

,

 {'confidence': 0.005714914295822382, 'id': 4373745406320874474, 'name': 'restaurant'} 

],
 'intent_tokens': [
 ],
 'text': 'are you a real person',
 'text_tokens': [
 
 ,

 
 ,

 
 ,

 
 ,

 
 ]}
 
 
 
 
 
 

Would anybody be opposed if I add a __repr__ to the Token such that you can see the actual text of the token? It should make it easier to inspect/debug.

@tabergma any objections?

@koaning koaning 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 Nov 12, 2020
@koaning koaning self-assigned this Nov 12, 2020
@koaning
Copy link
Contributor Author

koaning commented Nov 12, 2020

Exalate commented:

koaning commented:

I might want to do something similar to rasa.shared.nlu.training_data.features.Features. It might make sense to share the information on the shape of the underlying numpy arrays.

@tabergma
Copy link
Contributor

tabergma commented Nov 12, 2020

Exalate commented:

tabergma commented:

Good idea

💯

@tmbo tmbo added area:rasa-oss/ml 👁 All issues related to machine learning and removed area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Nov 17, 2020
@alwx alwx added type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. area:rasa-oss 🎡 Anything related to the open source Rasa framework and removed area:rasa-oss/ml 👁 All issues related to machine learning labels Jan 29, 2021
@pedro-prp
Copy link

pedro-prp commented Aug 5, 2021

Exalate commented:

pedro-prp commented:

I saw that a problem still exists, @koaning are you still working on it? If no, I would try to solve it

@koaning
Copy link
Contributor Author

koaning commented Aug 5, 2021

Exalate commented:

koaning commented:

There's a PR for it but unfortunately it cannot get merged due to a style check. You can see the reference above in the conversation.

ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 8, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 9, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 9, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 9, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 9, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 9, 2021
ErickGiffoni added a commit to FGA-GCES/rasa that referenced this issue Sep 14, 2021
aeshky added a commit that referenced this issue Sep 30, 2021
* represents a Token object as a string using python __repr__ method

* adds the change log related to issue #7250

* split return string - code quality failed because the line was too long

* add docstring for the Tokenizer class

Co-authored-by: Aciel Eshky <[email protected]>

* delete blank line after docstring

* Update changelog/7250.improvement.md

Co-authored-by: Aciel Eshky <[email protected]>

Co-authored-by: Aciel Eshky <[email protected]>
@ErickGiffoni
Copy link
Contributor

ErickGiffoni commented Oct 7, 2021

Exalate commented:

ErickGiffoni commented:

I think we can close this issue, since it was solved in #9631

@rasabot-exalate rasabot-exalate removed the type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR label Mar 17, 2022 — with Exalate Issue Sync
@rasabot-exalate rasabot-exalate added area:rasa-oss 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 type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. and removed type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. 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 removed the type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. label 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:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

No branches or pull requests

8 participants