5
5
from .projects import Project
6
6
7
7
TASK_TYPES = [
8
- 'annotation' ,
8
+ 'annotation' ,
9
9
'audiotranscription' ,
10
10
'categorization' ,
11
11
'comparison' ,
18
18
'polygonannotation' ,
19
19
'segmentannotation' ,
20
20
'transcription' ,
21
+ 'textcollection' ,
21
22
'documenttranscription' ,
22
23
'videoannotation' ,
23
24
'videoboxannotation' ,
@@ -161,7 +162,7 @@ def create_batch(self, project, batch_name, callback):
161
162
payload = dict (project = project , name = batch_name , callback = callback )
162
163
batchdata = self ._postrequest ('batches' , payload )
163
164
return Batch (batchdata , self )
164
-
165
+
165
166
def finalize_batch (self , batch_name ):
166
167
batchdata = self ._postrequest ('batches/%s/finalize' % batch_name )
167
168
return Batch (batchdata , self )
@@ -184,7 +185,8 @@ def list_batches(self, **kwargs):
184
185
response = self ._getrequest ('batches' , params = kwargs )
185
186
docs = [Batch (doc , self ) for doc in response ['docs' ]]
186
187
return Batchlist (
187
- docs , response ['totalDocs' ], response ['limit' ],response ['has_more' ], response .get ('next_token' ),
188
+ docs , response ['totalDocs' ], response ['limit' ], response ['has_more' ], response .get (
189
+ 'next_token' ),
188
190
)
189
191
190
192
def create_project (self , project_name , type , params ):
@@ -195,12 +197,12 @@ def create_project(self, project_name, type, params):
195
197
def get_projet (self , project_name ):
196
198
projectdata = self ._getrequest ('projects/%s' % project_name )
197
199
return Project (projectdata , self )
198
-
200
+
199
201
def projects (self ):
200
202
response = self ._getrequest ('projects' )
201
203
return response
202
204
203
- def update_project (self ,project_name ,** kwargs ):
205
+ def update_project (self , project_name , ** kwargs ):
204
206
allowed_kwargs = {'patch' , 'instruction' }
205
207
for key in kwargs :
206
208
if key not in allowed_kwargs :
@@ -210,9 +212,6 @@ def update_project(self,project_name,**kwargs):
210
212
return projectdata
211
213
212
214
213
-
214
-
215
-
216
215
def _AddTaskTypeCreator (task_type ):
217
216
def create_task_wrapper (self , ** kwargs ):
218
217
return self .create_task (task_type , ** kwargs )
0 commit comments