Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change batch assignment #220

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions factgenie/crowdsourcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ def select_batch(db, seed, annotator_id):
)
return assigned_batch["batch_idx"], assigned_batch["annotator_group"]

# Choose from the batches with the most available annotators
# Choose from the batches with the lowest annotator group
free_batches = db[db["status"] == ExampleStatus.FREE]
annotator_groups_per_batch = free_batches.groupby("batch_idx")["annotator_group"].nunique()
eligible_batches = annotator_groups_per_batch[annotator_groups_per_batch == annotator_groups_per_batch.max()]
eligible_batches = free_batches.groupby("batch_idx")["annotator_group"].min()
eligible_batches = eligible_batches[eligible_batches == eligible_batches.min()]

eligible_examples = free_batches[free_batches["batch_idx"].isin(eligible_batches.index)]

Expand Down
2 changes: 1 addition & 1 deletion factgenie/static/js/campaigns.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function clearCampaign(campaignId) {

function clearOutput(campaignId, mode, idx, annotatorGroup) {
// ask for confirmation
if (!confirm(`Are you sure you want to free the row id ${idx}? Any collected outputs will be deleted.`)) {
if (!confirm(`Are you sure you want to free the batch id ${idx} (annotator group ${annotatorGroup})? All related outputs will be deleted.`)) {
return;
}
$.post({
Expand Down
3 changes: 3 additions & 0 deletions factgenie/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ def save_record(mode, campaign, row, result):
"metadata": campaign.metadata["config"].copy(),
}

record["metadata"].pop("annotator_instructions", None)
record["metadata"].pop("final_message", None)

if mode == CampaignMode.LLM_EVAL or mode == CampaignMode.CROWDSOURCING:
setup_id = str(row["setup_id"])
record["setup_id"] = setup_id
Expand Down