File size: 599 Bytes
111f4d3
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""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}")