SRK-CobuildX's picture
Release v0.1
111f4d3 verified
Raw History Blame Contribute Delete
599 Bytes
"""Does an answer address its question? Run from this folder: python example.py"""
from cbx_rag_eval import ResponseRelevance
judge = ResponseRelevance(".")
question = "Can the licensee assign the agreement to a third party?"
for answer in [
"No. The licensee may not assign the agreement without the licensor's prior written consent.",
"The agreement covers software licensing and also includes a confidentiality clause.",
"The agreement is governed by the laws of the State of New York.",
]:
out = judge(question, answer)
print(f"{out['label']:10} {out['probs']} {answer}")