Skip to content

cannot import name 'context_precision' from 'ragas.metrics'Β #1207

@dividor

Description

@dividor

[X ] I have checked the documentation and related resources and couldn't resolve my bug.

Describe the bug
I am trying to follow this documentation, but it doesn't work because context_precision seems to be missing.

Ragas version: ragas-0.1.14
Python version: 3.11.4

Code to Reproduce
The code from Ragas' documentation ...

from ragas.metrics import (
    answer_relevancy,
    faithfulness,
    context_recall,
    context_precision,
)

Error trace

Cell In[52], [line 1](vscode-notebook-cell:?execution_count=52&line=1)
----> [1](vscode-notebook-cell:?execution_count=52&line=1) from ragas.metrics import (
      [2](vscode-notebook-cell:?execution_count=52&line=2)     faithfulness,
      [3](vscode-notebook-cell:?execution_count=52&line=3)     answer_relevancy,
      [4](vscode-notebook-cell:?execution_count=52&line=4)     context_precision,
      [5](vscode-notebook-cell:?execution_count=52&line=5)     context_recall,
      [6](vscode-notebook-cell:?execution_count=52&line=6) )

ImportError: cannot import name 'context_precision' from 'ragas.metrics' (/Users/ME/opt/miniconda3/envs/eval_demo/lib/python3.11/site-packages/ragas/metrics/__init__.py)

Expected behavior
The documented code should work.

Additional context
RAGAs is great, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    answeredπŸ€– The question has been answered. Will be closed automatically if no new commentsbugSomething isn't workingmodule-metricsthis is part of metrics module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions