Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello Folks,

I am using a Provenance V0 validator to validate output generated by an LLM. I wanted to check if there is a way I can get the status or raw value of the cosine similarity value?

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Hi Nauyan! That's a great question. there's 2 parts to this question

  1. can the cosine similarity value be isolated and logged
  2. Is there a good way to pass additional information back out of completed validator checks - in this specific instance, we want to pass teh cosine similarity value back out of the validator

my thoughts:

  1. absolutely. If you have guardrails installed locally, you can add a print statement before this line - print(most_similar_chunk[1])
  2. kind of but it's ugly. There is a metadata field as part of the ValidationResult class (from which PassResult and FailResult inherit). This does make its way through to the validation object in the guard's history. The access pattern is a little deep though, I left a snippet below, take a look at the very last line (you can run it as well). Provenance doesn't currently keep those values in metadata, but I think it's a good idea to add that! I'll open an issue here - [feat] Provenance - Add metadata with underlying numbers to the PassResult and FailResult #575
You must be logged in to vote
1 reply
@nauyan
Comment options

@zsimjee I think you forgot to add the snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.