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

Question: How to get score of ranked document? #201

Open
BernhardSchlegel opened this issue Apr 16, 2024 · 1 comment
Open

Question: How to get score of ranked document? #201

BernhardSchlegel opened this issue Apr 16, 2024 · 1 comment

Comments

@BernhardSchlegel
Copy link

Hey all, I'm using RAGatouille as a retriever for langchain like so

RAG = RAGPretrainedModel.from_index(".ragatouille/colbert/indexes/clr-docs")
retriever = RAG.as_langchain_retriever(k=10)
retrieval = RunnableParallel({
    "context": retriever,
    "question": RunnablePassthrough(),
})
rag_chain = (
    retrieval
    | RunnableParallel({
        "answer": ANSWER_PROMPT | llm,
        "docs": itemgetter("context")
    })
)

I've traced down as_langchain_retriever but I could not find any helpful arguments.

How do I get the score for each retrieved doc so I can, i.e., calculate the auPRC score?

Thanks,
Bernhard.

@BernhardSchlegel
Copy link
Author

Answer: Using the ContextualCompressionRetriever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant