1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "content": [
10 {
11 "id": "demo1",
12 "text": "The quick brown fox jumps over the lazy dog",
13 },
14 {
15 "id": "demo2",
16 "text": "A quick brown fox jumps over a lazy dog",
17 },
18 {
19 "id": "demo3",
20 "text": "The fast brown fox leaps over the sleepy dog",
21 },
22 {
23 "id": "demo4",
24 "text": "Artificial intelligence is transforming modern technology",
25 },
26 {
27 "id": "demo5",
28 "text": "AI is revolutionizing contemporary tech solutions",
29 },
30 ],
31 "similarityThreshold": 0.8,
32 "algorithms": {
33 "cosine": True,
34 "levenshtein": True,
35 "fuzzy": True,
36 "jaccard": True,
37 },
38 "caseSensitive": False,
39 "ignoreWhitespace": True,
40 "minLength": 10,
41 "groupByDuplicate": True,
42}
43
44
45run = client.actor("fiery_dream/content-similarity-finder").call(run_input=run_input)
46
47
48print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
49for item in client.dataset(run["defaultDatasetId"]).iterate_items():
50 print(item)
51
52