1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "texts": [
10 "Hi, I've been trying to connect my Stripe account for 3 days and the integration keeps failing. I'm losing sales. Please help ASAP.",
11 "Just wanted to say the new dashboard looks great. No issues here!",
12 "How much does the Team plan cost if we add 12 seats?",
13 ],
14 "questions": [
15 {
16 "key": "department",
17 "type": "choice",
18 "instructions": "Which team should handle this message?",
19 "criteria": {
20 "billing": "Payment or subscription issues",
21 "technical": "Bugs or integration problems",
22 "sales": "Pricing or account questions",
23 },
24 },
25 {
26 "key": "frustration",
27 "type": "score",
28 "instructions": "How frustrated the customer appears",
29 "criteria": [
30 "Calm, just stating facts",
31 "Frustrated but civil",
32 "Very angry, strong language",
33 ],
34 },
35 {
36 "key": "is_urgent",
37 "type": "noul",
38 "instructions": "The message conveys urgency or time-sensitivity",
39 },
40 ],
41}
42
43
44run = client.actor("seemuapps/bulk-text-classifier").call(run_input=run_input)
45
46
47print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
48for item in client.dataset(run.default_dataset_id).iterate_items():
49 print(item)
50
51