# Winner

**Objective**: The test is intended to check which of the two responses are better according to the concept\_set provided. It can be used to test two model outputs or model output in comaparison to human output.

**Required Parameters**:

* **Response**: The sentence generated by the model using the words in concept\_set.
* **Expected\_Response**: The sentence generated by the model you want to compare or the ground truth.
* **Concept\_set**: A list of words in their root form, each tagged with its corresponding part of speech (e.g., "\_V" for verb, "\_N" for noun, "\_A" for adjective).

**Optional Parameters**:

* **model** (str, optional): The name of the language model to be used for task of evaluating responses. Defaults to "gpt-3.5-turbo".
* **temperature** (float,optional): This parameter allows you to adjust the randomness of the response generated by the specified model.
* **max\_tokens** (int,optional): This parameter allows you to specify the maximum length of the generated response.

**Interpretation**: 1 indicates model response is better than ground truth/other model response.

\
**Note**: Always use words in their root form in the concept set to focus on parts of speech application rather than word conjugation or inflection.

```python
# Example where model response is better than ground truth.
# Make sure you pass all words in concept_set in their root form.

evaluator.add_test(
    test_names=["winner_test"],
    data={
        "response" : "The family sits at the table with delicious food placed in front of them.",
        "expected_response" : "I sit at the front of the table and enjoy my food.",
        "concept_set" : ["food_N", "front_N", "sit_V", "table_N"]
    },
    arguments={"model": "gpt-4"},
).run()

evaluator.print_results()
```

```python
# Example where ground truth is better than model response.
# Make sure you pass all words in concept_set in their root form.

evaluator.add_test(
    test_names=["winner_test"],
    data={
        "response" : "A brown fox quickly jumps over a sleeping dog.",
        "expected_response" : "The quick brown fox jumps over the lazy dog.",
        "concept_set" : ["quick_V", "brown_A", "fox_N", "jump_V", "lazy_A", "dog_N"]
    },
    arguments={"model": "gpt-4"},
).run()

evaluator.print_results()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raga.ai/ragaai-catalyst/ragaai-metric-library/additional-metrics/evaluation/winner.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
