| from phoenix.evals import create_evaluator | |
| def conciseness_evaluator(output: str, expected: str): | |
| ratio = (len(output) / len(expected)) | |
| if ratio < 0.5: | |
| return "too short" | |
| elif ratio > 3.0: | |
| return "too long" | |
| else: | |
| return "concise" |
| from phoenix.evals import create_evaluator | |
| def conciseness_evaluator(output: str, expected: str): | |
| ratio = (len(output) / len(expected)) | |
| if ratio < 0.5: | |
| return "too short" | |
| elif ratio > 3.0: | |
| return "too long" | |
| else: | |
| return "concise" |