Download example.py from CobuildX-AI/cbx-rag-response-relevance-68M: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/CobuildX-AI/cbx-rag-response-relevance-68M/resolve/main/example.py
- Command line
-
hf download hf://CobuildX-AI/cbx-rag-response-relevance-68M/example.py
-
curl -L -o example.py https://huggingface.co/CobuildX-AI/cbx-rag-response-relevance-68M/resolve/main/example.py
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}") | |