> For the complete documentation index, see [llms.txt](https://docs.raga.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.raga.ai/ragaai-catalyst/ragaai-metric-library/additional-metrics/evaluation/pos.md).

# POS

**Objective**: This test evaluates whether the parts of speech (PoS) of all words in a model-generated response match those specified in the concept set. It aims to assess the model's ability to correctly apply the designated parts of speech for given words within a contextually appropriate sentence.

**Required Parameters**:

* **Response**: The sentence generated by the model using the words in concept\_set.
* **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).

**Interpretation**: A higher score indicates that the model's response correctly applies the parts of speech as specified in the concept set. The evaluation focuses on the accurate use of designated parts of speech in context.

* **Example with Higher Score**:
  * Concept set: \["balloon\_N", "soar\_V", "red\_A"]
  * Response: "The red balloon soared into the sky." (All concepts are used correctly according to their designated parts of speech.)
* **Example with Lower Score**:
  * Concept set: \["balloon\_N", "soar\_V", "red\_N", "sky\_A"]
  * Response: "The red balloon soared into the sky." (The parts of speech for "red" and "sky" do not match the concept set, leading to a lower score.)

**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 with Higher Score

evaluator.add_test(
    test_names=["pos_test"],
    data={
        "concept_set" : ["balloon_N", "soar_V", "red_A"],
        "response": "The red balloon soared into the sky."
    },
).run()

evaluator.print_results()
```

```python
# Example with Lower Score

evaluator.add_test(
    test_names=["pos_test"],
    data={
        "concept_set" : ["balloon_N", "soar_V", "red_N", "sky_A"],
        "response": "The red balloon soared into the sky."
    },
).run()

evaluator.print_results()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
