1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "reviews": [
10 {
11 "title": "Great service",
12 "text": "Fast delivery and very helpful support. I love it, highly recommend!",
13 "rating": 5,
14 "author": "Anna",
15 },
16 {
17 "title": "Never again",
18 "text": "Terrible experience, parcel arrived damaged and nobody answered my refund request.",
19 "rating": 1,
20 "author": "Tom",
21 },
22 {
23 "title": "Okay",
24 "text": "Product is fine, the price is not cheap but it works.",
25 "rating": 3,
26 },
27 ],
28 "neutralThreshold": 0.1,
29 "maxItems": 3,
30}
31
32
33run = client.actor("bonpleincapital/review-sentiment-scorer").call(run_input=run_input)
34
35
36print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
37for item in client.dataset(run.default_dataset_id).iterate_items():
38 print(item)
39
40