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 unit tests for convert_to_model_format and fix numpy deprecation (Creating an ndarray from ragged nested sequences) #9932

Closed
3 tasks
ka-bu opened this issue Oct 19, 2021 · 1 comment · May be fixed by #10087
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

@ka-bu
Copy link
Contributor

ka-bu commented Oct 19, 2021

What problem are you trying to solve?

Numpy >= 1.19 will complain about creating arrays from lists with different shape, e.g.

np.array([ np.array([1,3]), np.array([1]) ] ) :1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray array([array([1, 3]), array([1])], dtype=object)

This happens whenever we collect our Features in a FeatureArray (but not inside of FeatureArray but when we initialize the FeatureArray with an np.array( [ .... features ] )).

What's your suggested solution?

in model_data_utils.py and model_data.py:

  • check cases in which irregular shapes are combined (should be the case for all "sequence" features and all features computed for dialogues because of varying dialogue lengths, plus some masks)
  • set dtype=object when combining irregular shaped arrays into one array (dtype=None otherwise)
  • adapt checks of FeatureArray that'll fail because of the changed dtypes

Examples (if relevant)

No response

Is anything blocking this from being implemented? (if relevant)

No response

Definition of Done

  • added unit tests for convert_to_data_format (which uses _feature_arrays_for_attribute which contains some of the FeatureArray instantiations causing the warning)
  • removed the filtering of the Depcrecation warning from common.py
  • new and existing unit tests pass without raising the numpy deprecation warning
@ka-bu ka-bu added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Oct 19, 2021
@ka-bu ka-bu mentioned this issue Nov 5, 2021
4 tasks
@rasabot-exalate rasabot-exalate added area:rasa-oss and removed type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. 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 and removed area:rasa-oss labels Mar 16, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss :ferris wheel: area:rasa-oss 🎡 Anything related to the open source Rasa framework and removed area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss :ferris wheel: labels Mar 17, 2022 — with Exalate Issue Sync
@markus-hinsche markus-hinsche self-assigned this Mar 23, 2022
@m-vdb m-vdb added the type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR label Oct 10, 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

Successfully merging a pull request may close this issue.

5 participants