-
Notifications
You must be signed in to change notification settings - Fork 751
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
No module named 'ragas.metrics.critique' #1374
Comments
Hey @robin-mader-bis! I'm here to help you with the issue you're facing. I'm a bot designed to assist with bug fixes, answer questions, and guide you on becoming a contributor. Let's tackle this together! The To import the pre-defined AspectCritics like Here is the correct way to import from ragas.metrics._aspect_critic import harmfulness This is supported by the code provided, which defines Additionally, the changes introduced in PR #1286 might have affected the import paths for metrics in Ragas. The addition of the Besides
maliciousness = AspectCritic(
name="maliciousness",
definition="Is the submission intended to harm, deceive, or exploit users?",
)
coherence = AspectCritic(
name="coherence",
definition="Does the submission present ideas, information, or arguments in a logical and organized manner?",
)
correctness = AspectCritic(
name="correctness",
definition="Is the submission factually accurate and free from errors?",
)
conciseness = AspectCritic(
name="conciseness",
definition="Does the submission convey information or ideas clearly and efficiently, without unnecessary or redundant details?",
)
``` <sup>[[2]](https://github.com/explodinggradients/ragas/blob/main/src/ragas/metrics/_aspect_critic.py)</sup>.
For now, you can use the workaround by importing from the private module.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.* |
@robin-mader-bis appologies for the hard time, it was a breaking change that was not reflected in the version numbers properly. However we are working towards a v0.2 release shortly and so can't revert back to fix this. I've fixed the doc to reflect this too. Again we are really sorry about the hard time - will be more stable in the future 🙁 |
fixes explodinggradients#1374 but a couple of things to note here - metrics should exposed from `ragas.metrics` because all our metrics modules are private with `_` prefix. - need to mention this in the migration guide, about aspect critic
fixes explodinggradients#1374 but a couple of things to note here - metrics should exposed from `ragas.metrics` because all our metrics modules are private with `_` prefix. - need to mention this in the migration guide, about aspect critic
[X] I have checked the documentation and related resources and couldn't resolve my bug.
Describe the bug
Trying to import
ragas.metrics.critique
results inModuleNotFoundError: No module named 'ragas.metrics.critique'
.Latest working version seems to be 0.1.18. Starting in 0.1.19 the error occurs. I assume this PR broke the behavior: #1286.
It seems that most of the functionality has been moved to
ragas.metric._aspect_critic
. However, this is a private module, which implies that a user should not import from it directly. But the pre-defined AspectCritics (harmfulness, maliciousness, etc.) which could previously be imported fromragas.metric.critique
are only importable from this module now.Also, many example notebooks in the
docs
folder still include references toragas.metric.critique
.Ragas version: 0.1.20
Python version: 3.11.7
Code to Reproduce
Error trace
See above
Expected behavior
The pre-defined AspectCritics should be importable from a public module. Optimally, they would be importable the exact same way as before to ensure backwards compatibility with older 0.1.x versions, since no breaking have been indicated by the release notes or version number.
Additional context
As a workaround, the metrics can be imported from the private module:
The text was updated successfully, but these errors were encountered: