Skip to content

Misleading documentation for "LLM Based Context Precision without reference" #1981

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

Open
muhammadyaseen opened this issue Mar 26, 2025 · 1 comment
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@muhammadyaseen
Copy link

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

Describe the bug
A clear and concise description of what the bug is.

I think the documentation for LLM Based Context Precision without reference is wrong. The doc is available at: https://docs.ragas.io/en/latest/concepts/metrics/available_metrics/context_precision/#context-precision-without-reference

It says:

LLMContextPrecisionWithoutReference metric can be used when you have both retrieved contexts and also reference contexts associated with a user_input.

I believe the emphasized part is wrong, since this evaluation works without reference context, as the name and heading suggests.

Looking at the code also confirms this:

@dataclass
class LLMContextPrecisionWithoutReference(LLMContextPrecisionWithReference):
    name: str = "llm_context_precision_without_reference"
    _required_columns: t.Dict[MetricType, t.Set[str]] = field(
        default_factory=lambda: {
            MetricType.SINGLE_TURN: {"user_input", "response", "retrieved_contexts"}
        }
    )

    def _get_row_attributes(self, row: t.Dict) -> t.Tuple[str, t.List[str], t.Any]:
        return row["user_input"], row["retrieved_contexts"], row["response"]

... it only requires: user_input, response retrieved_contexts.

Ragas version:
Python version:

Code to Reproduce
Share code to reproduce the issue

Error trace

Expected behavior
A clear and concise description of what you expected to happen.

Updated documentation, for ex:

LLMContextPrecisionWithoutReference metric can be used when you have retrieved contexts (retrieved_contexts) associated with a user_input.

Additional context
Add any other context about the problem here.

@muhammadyaseen muhammadyaseen added the bug Something isn't working label Mar 26, 2025
@dosubot dosubot bot added the documentation Improvements or additions to documentation label Mar 26, 2025
@muhammadyaseen
Copy link
Author

Hi, I'll be happy to update the doc if someone could confirm that my understanding is indeed accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant