Skip to content

Commit 9616e62

Browse files
authored
Merge pull request #225 from ufal/modify-batch-group-relation
Critical fix: do not consider annotator_group when saving annotations
2 parents 55a24a5 + 2cf6c13 commit 9616e62

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

factgenie/crowdsourcing.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def get_annotator_batch(app, campaign, service_ids, batch_idx=None):
338338
with app.db["lock"]:
339339
annotator_id = service_ids["annotator_id"]
340340

341-
logging.info(f"Acquiring lock for {annotator_id}")
341+
logger.info(f"Acquiring lock for {annotator_id}")
342342
start = int(time.time())
343343
seed = random.seed(str(start) + str(service_ids.values()))
344344

@@ -347,7 +347,7 @@ def get_annotator_batch(app, campaign, service_ids, batch_idx=None):
347347
try:
348348
batch_idx = select_batch(db, seed, annotator_id)
349349
except ValueError as e:
350-
logging.info(str(e))
350+
logger.info(str(e))
351351
# no available batches
352352
return []
353353
else:
@@ -380,10 +380,9 @@ def save_annotations(app, campaign_id, annotation_set, annotator_id):
380380
with app.db["lock"]:
381381
db = campaign.db
382382
batch_idx = annotation_set[0]["batch_idx"]
383-
annotator_group = annotation_set[0]["annotator_group"]
384383

385384
# select the examples for this batch and annotator group
386-
mask = (db["batch_idx"] == batch_idx) & (db["annotator_group"] == annotator_group)
385+
mask = db["batch_idx"] == batch_idx
387386

388387
# if the batch is not assigned to this annotator, return an error
389388
batch_annotator_id = db.loc[mask].iloc[0]["annotator_id"]
@@ -434,9 +433,7 @@ def save_annotations(app, campaign_id, annotation_set, annotator_id):
434433
row=row,
435434
result=res,
436435
)
437-
logger.info(
438-
f"Annotations for {campaign_id} (batch {batch_idx}, annotator group {annotator_group}, annotator {annotator_id}) saved."
439-
)
436+
logger.info(f"Annotations for {campaign_id} (batch {batch_idx}, annotator {annotator_id}) saved.")
440437

441438
final_message_html = markdown.markdown(campaign.metadata["config"]["final_message"])
442439

0 commit comments

Comments
 (0)