File size: 887 Bytes
5db2259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Isolated test — just claim_client.attribute() against the live clAIm endpoint.
Uses the exact winner sentence/label confirmed by test_analyze_live.py.

Run from the veriscite/ root:
    python -m tests.test_attribute_live
"""

import asyncio
from app.tools import claim_client


async def main():
    claim = "Aspirin inhibits the production of thromboxane A2."
    winner_sentence = ("Aspirin irreversibly inhibits cyclooxygenase, thereby "
                        "reducing thromboxane A2 synthesis in platelets.")
    label_id = claim_client.LABEL2ID["SUPPORT"]  # confirmed winner label from Step 1

    result = await claim_client.attribute(claim, winner_sentence, label_id)

    print("RAW RESPONSE (list of {token, score}):")
    for item in result:
        print(item)

    print()
    print("token count:", len(result))


if __name__ == "__main__":
    asyncio.run(main())