@@ -30,7 +30,7 @@ Any parameter available in the documentation_ can be passed as an argument optio
30
30
31
31
The following endpoints for tasks are available:
32
32
33
- Create categorization task
33
+ Create Categorization Task
34
34
==========================
35
35
36
36
Check `this `__ for further information.
@@ -47,45 +47,7 @@ __ https://scale.com/docs/#create-categorization-task
47
47
categories = [' public' , ' private' ]
48
48
)
49
49
50
- Create transcription task
51
- =========================
52
-
53
- Check `this `__ for further information.
54
-
55
- __ https://scale.com/docs/#create-ocr-transcription-task
56
-
57
- .. code-block :: python
58
-
59
- task = client.create_transcription_task(
60
- callback_url = ' http://www.example.com/callback' ,
61
- instruction = ' Transcribe the given fields. Then for each news item on the page, transcribe the information for the row.' ,
62
- attachment_type = ' website' ,
63
- attachment = ' http://www.google.com/' ,
64
- fields = { ' title' : ' Title of Webpage' , ' top_result' : ' Title of the top result' },
65
- row_fields = { ' username' : ' Username of submitter' , ' comment_count' : ' Number of comments' }
66
- )
67
-
68
- Create comparison task
69
- ======================
70
-
71
- Check `this `__ for further information.
72
-
73
- __ https://scale.com/docs/#create-comparison-task
74
-
75
- .. code-block :: python
76
-
77
- client.create_comparison_task(
78
- callback_url = ' http://www.example.com/callback' ,
79
- instruction = ' Do the objects in these images have the same pattern?' ,
80
- attachment_type = ' image' ,
81
- choices = [' yes' , ' no' ],
82
- attachments = [
83
- ' http://i.ebayimg.com/00/$T2eC16dHJGwFFZKjy5ZjBRfNyMC4Ig~~_32.JPG' ,
84
- ' http://images.wisegeek.com/checkered-tablecloth.jpg'
85
- ]
86
- )
87
-
88
- Create annotation task
50
+ Create Annotation Task
89
51
======================
90
52
91
53
Check `this `__ for further information.
@@ -102,45 +64,12 @@ __ https://scale.com/docs/#2d-box-annotation
102
64
objects_to_annotate = [" baby cow" , " big cow" ]
103
65
)
104
66
105
- Create datacollection task
106
- =========================
107
-
108
- Check `this `__ for further information.
109
-
110
- __ https://scale.com/docs/#create-data-collection-task
111
-
112
- .. code-block :: python
113
-
114
- task = client.create_datacollection_task(
115
- callback_url = ' http://www.example.com/callback' ,
116
- instruction = ' Find the URL for the hiring page for the company with attached website.' ,
117
- attachment_type = ' website' ,
118
- attachment = ' http://www.google.com/' ,
119
- fields = { ' hiring_page' : ' Hiring Page URL' },
120
- )
121
-
122
- Create audiotranscription task
123
- ==============================
124
-
125
- Check `this `__ for further information.
126
-
127
- __ https://scale.com/docs/#create-audio-transcription-task
128
-
129
- .. code-block :: python
130
-
131
- task = client.create_audiotranscription_task(
132
- callback_url = ' http://www.example.com/callback' ,
133
- attachment_type = ' audio' ,
134
- attachment = ' https://storage.googleapis.com/deepmind-media/pixie/knowing-what-to-say/second-list/speaker-3.wav' ,
135
- verbatim = False
136
- )
137
-
138
67
Retrieve task
139
68
=============
140
69
141
70
Check `this `__ for further information.
142
71
143
- __ https://scale.com/docs/ #retrieve-a-task
72
+ __ https://docs. scale.com/reference #retrieve-tasks
144
73
145
74
Retrieve a task given its id.
146
75
@@ -154,7 +83,7 @@ Cancel task
154
83
155
84
Check `this `__ for further information.
156
85
157
- __ https://scale.com/docs/ #cancel-a -task
86
+ __ https://docs. scale.com/reference #cancel-task
158
87
159
88
Cancel a task given its id, only if it's not completed.
160
89
@@ -167,25 +96,32 @@ List tasks
167
96
168
97
Check `this `__ for further information.
169
98
170
- __ https://scale.com/docs/ #list-all -tasks
99
+ __ https://docs. scale.com/reference #list-multiple -tasks
171
100
172
101
Retrieve a list of tasks, with optional filter by date/type. Paginated with limit/offset.
173
102
The return value is a ``scaleapi.Tasklist ``, which acts as a list, but also has fields
174
103
for the total number of tasks, the limit and offset, and whether or not there's more.
175
104
176
105
.. code-block :: python
177
106
178
- tasks = client.tasks(
179
- start_time='2015-10-13T22:38:42Z',
180
- end_time='2016-10-13T22:38:42Z',
181
- type='categorization',
182
- limit=100,
183
- offset=200)
184
-
185
- print(tasks.total) # 1000
186
- print(tasks.limit) # 100
187
- print(tasks.offset) # 200
188
- print(tasks.has_more) # True
107
+ next_token = None;
108
+ counter = 0
109
+ all_tasks =[]
110
+ while True:
111
+ tasks = client.tasks(
112
+ start_time = "2020-09-08",
113
+ end_time = "2021-01-01",
114
+ customer_review_status = "accepted",
115
+ next_token = next_token,
116
+ )
117
+ for task in tasks:
118
+ counter += 1
119
+ print(f'Downloading Task {counter} | {task.task_id}')
120
+ all_tasks.append(task.__dict__['param_dict'])
121
+ next_token = tasks.next_token
122
+ if next_token is None:
123
+ break
124
+ print(all_tasks)
189
125
190
126
Error handling
191
127
==============
@@ -204,4 +140,4 @@ as a ``scaleapi.ScaleException`` or ``scaleapi.ScaleInvalidRequest`` runtime er
204
140
Troubleshooting
205
141
===============
206
142
207
- If you notice any problems, please email us at support@scaleapi .com.
143
+ If you notice any problems, please email us at support@scale .com.
0 commit comments