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

faithfullness checks for ragas assumes a match #545

Closed
jjimenez opened this issue Mar 25, 2024 · 3 comments
Closed

faithfullness checks for ragas assumes a match #545

jjimenez opened this issue Mar 25, 2024 · 3 comments

Comments

@jjimenez
Copy link

https://github.com/andreibondarev/langchainrb/blob/86b7faf9c21f5402ad1a12ba02978c1716abb6a6/lib/langchain/evals/ragas/faithfulness.rb#L45

this line of code assumes that there is a match.

 def count_verified_statements(verifications)
          match = verifications.match(/Final verdict for each statement in order:\s*(.*)/)
          verdicts = match.captures.first
          verdicts
            .split(".")
            .count { |value| value.strip.to_boolean }
        end

consider changing to

 def count_verified_statements(verifications)
          match = verifications.match(/Final verdict for each statement in order:\s*(.*)/)
          verdicts = match&.captures&.first
          verdicts
            &.split(".")
            &.count { |value| value.strip.to_boolean } || 0
        end
@andreibondarev
Copy link
Collaborator

@jjimenez Could you please help me understand when this happens? Does the LLM hallucinate and not return the correct output? Could you please share what that output is?

@andreibondarev
Copy link
Collaborator

Closing due to inactivity. Feel free to reopen.

@jjimenez
Copy link
Author

I apologize for dropping this. I really appreciate the tool, but got busy on other projects. If and when I return to this I will reopen or create a test scenario and provide additional details.

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

2 participants