Skip to main content
Let’s say you ran the following code:
ruling = await client.judge(
    claim="I live in San Francisco. My cat, Sally, lives with me.",
    sources=[
        TextSource(id="sally-name", text="I have a cat called Sally"),
        TextSource(id="living", text="Sally and I live in a small apartment"),
    ],
)
As you can tell, the claim isn’t entirely true. Let’s see what the ruling object looks like.

Top-level verdict

assert ruling.verdict == Verdict.NOT_ENOUGH_INFO
Unsurprisingly enough, the verdict on the entire claim is Verdict.NOT_ENOUGH_INFO. This reflects the fact that none of the sources said anything about San Francisco. Had the claim been true, the verdict would have been Verdict.SUPPORTS. Had the claim been false, i.e. contradictory to the sources, the verdict would have been Verdict.REFUTES.

Individual statements

Each claim is broken down into individual statements, which are judged separately. These usually (but not always!) correspond to sentences. For example, if you run:
for statement in ruling.statements:
    print(f"{statement.text} {statement.verdict}")
You will see something like:
I live in San Francisco. Verdict.NOT_ENOUGH_INFO
My cat, Sally, lives with me. Verdict.SUPPORTS

Influences

Each statement’s verdict is influenced by specific pieces of evidence from the sources. These are represented as Influence objects. For example, if you run:
for influence in ruling.statements[1].influences:
    print(f"{influence.text} came from {influence.source.id}")
You should see the text of the influencing evidence and the source it came from - something like:
I have a cat called Sally came from sally-name
Sally and I live in a small apartment came from living
The span attribute of TextInfluence objects can be used to locate the exact substring in the source text that corresponds to the influence.
from truthsys import TextInfluence

for influence in statement.influences:
    if isinstance(influence, TextInfluence):
        print(f"{influence.source.text[influence.span[0]:influence.span[1]]}")
This provides a precise mapping between the claim and the evidence in the sources.