> ## Documentation Index
> Fetch the complete documentation index at: https://futureagi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Factual Accuracy

> Verifies if the provided output is factually correct based on the given information or the absence thereof. It ensures that the output maintains factual integrity and does not introduce inaccuracies.

<Warning>
  `factual_accuracy` is being deprecated. Avoid using it for new integrations.
  Use `groundedness` for new implementations.
</Warning>

<CodeGroup>
  ```python Python theme={null}
  result = evaluator.evaluate(
      eval_templates="groundedness",
      inputs={
          "input": "The capital of France is Paris.",
          "output": "The capital of France is Paris.",
          "context": "The capital of France is Paris.",
      },
      model_name="turing_flash",
  )

  print(result.eval_results[0].output)
  print(result.eval_results[0].reason)
  ```

  ```typescript JS/TS theme={null}
  import { Evaluator, Templates } from "@future-agi/ai-evaluation";

  const evaluator = new Evaluator();

  const result = await evaluator.evaluate(
    "groundedness",
    {
      input: "The capital of France is Paris.",
      output: "The capital of France is Paris.",
      context: "The capital of France is Paris.",
    },
    {
      modelName: "turing_flash",
    }
  );

  console.log(result);
  ```
</CodeGroup>

| **Input** |                    |          |                                   |
| --------- | ------------------ | -------- | --------------------------------- |
|           | **Required Input** | **Type** | **Description**                   |
|           | `output`           | `string` | The output generated by the model |
|           | `context`          | `string` | The context provided to the model |
|           | **Optional Input** |          |                                   |
|           | `input`            | `string` | The input provided to the model   |

| **Output** |            |                                                                       |
| ---------- | ---------- | --------------------------------------------------------------------- |
|            | **Field**  | **Description**                                                       |
|            | **Result** | Returns a score, where higher values indicate better factual accuracy |
|            | **Reason** | Provides a detailed explanation of the factual accuracy assessment    |

***

### What to Do When Factual Accuracy Evaluation Gives a Low Score

When factual accuracy evaluation gives a low score, it is essential to reassess the evaluation criteria to ensure they are clearly defined and aligned with the evaluation's goals. If necessary, adjustments should be made to enhance the criteria's comprehensiveness and relevance. Additionally, the output should be thoroughly examined for factual inaccuracies, identifying any discrepancies and refining the content to improve factual correctness.

***

### Differentiating Factual Accuracy with [Groundedness](/future-agi/get-started/evaluation/builtin-evals/groundedness)

Factual accuracy focuses on verifying the correctness of the output based on the given input and context, ensuring that the information presented is factually sound. In contrast, groundedness ensures that the response strictly adheres to the provided context, preventing the inclusion of unsupported or external information.

While factual accuracy requires input, output, and context for evaluation, groundedness only requires a response and its context.
