1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "request_id": "123e4567-e89b-42d3-a456-426614174000",
12 "public_non_sensitive_confirmed": true,
13 "source": {
14 "document_id": "public-demo-document-1",
15 "provenance": "public_source"
16 },
17 "pages": [
18 {
19 "page": 1,
20 "text": "Unit price: $100. Total price: $500. Quantity 5. Phase 1 Total Project Amount: $6,113,575."
21 }
22 ],
23 "claims": [
24 {
25 "claim_id": "c1",
26 "field": "unit_price_right",
27 "semantic_field": "unit_price",
28 "page": 1,
29 "evidence": "Unit price: $100",
30 "value": "$100"
31 },
32 {
33 "claim_id": "c2",
34 "field": "total_price_right",
35 "semantic_field": "total_price",
36 "page": 1,
37 "evidence": "Total price: $500",
38 "value": "$500"
39 },
40 {
41 "claim_id": "c3",
42 "field": "false_field_association",
43 "semantic_field": "total_price",
44 "page": 1,
45 "evidence": "Unit price: $100",
46 "value": "$100"
47 },
48 {
49 "claim_id": "c4",
50 "field": "fake_numeric_value",
51 "semantic_field": "total_price",
52 "page": 1,
53 "evidence": "Total price: $500",
54 "value": "$900"
55 },
56 {
57 "claim_id": "c5",
58 "field": "phase_number_as_money",
59 "semantic_field": "phase_total",
60 "page": 1,
61 "evidence": "Phase 1 Total Project Amount: $6,113,575",
62 "value": "1"
63 }
64 ]
65};
66
67
68const run = await client.actor("vad_tot_i86/nexus-v06-private-cloud-test").call(input);
69
70
71console.log('Results from dataset');
72console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
73const { items } = await client.dataset(run.defaultDatasetId).listItems();
74items.forEach((item) => {
75 console.dir(item);
76});
77
78