allenai / amti

A Mechanical Turk Interface (amti) 🤖
Apache License 2.0
55 stars 18 forks source link

Getting the results of an incomplete batch #31

Open danyaljj opened 3 years ago

danyaljj commented 3 years ago

Sometimes we are in rush to get the results; so we're willing to skip a couple of incomplete HITs. How can we save the results such that we don't get the following error?

2021-09-27 14:57:19,551:INFO:amti.actions.save:Finished saving HIT (ID: 3IHWR4LC7DBZ6PPKIOD7HQER66XI81).
Traceback (most recent call last):
  File "/Users/danielk/opt/anaconda3/bin/amti", line 68, in <module>
    amti()
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/amti/clis/save.py", line 40, in save_batch
    batch_dir=batch_dir)
  File "/Users/danielk/opt/anaconda3/lib/python3.7/site-packages/amti/actions/save.py", line 89, in save_batch
    f'HIT (ID: {hit_id}) has status "{hit_status}".'
ValueError: HIT (ID: 3QHITW7OYO7Q6B6ISU2UMJB8N4EAQ0) has status "Unassignable". In order to save a batch all HITs must have "Reviewable" status.

I suppose we can have a force flag which we bypass such errors: https://github.com/allenai/amti/blob/master/amti/actions/save.py#L87-L91