You can get factuality scores (or rather factual consistency scores) from the /factuality
endpoint or Factuality
class in the Python client. This endpoint/Class takes two parameters:
reference
- A reference text with which you want to compare another text for factual consistency.text
- The candidate text that will be scored for factual consistency.
The output will include a score
that ranges from 0.0 to 1.0. The higher the score, the more factuality consistency between the text
and the reference
.
Generate a factuality score
To generate a factuality score, you can use the following code examples. Depending on your preference or requirements, select the appropriate method for your application.
The output will look something like: