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

Update utils.py #148

Merged
merged 1 commit into from
Jan 27, 2025
Merged
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
13 changes: 8 additions & 5 deletions backend/projects/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,14 @@ def add_extra_task_data(t, project):
inter_annotator_difference = {
key: max(values) - min(values) for key, values in key_values.items()
}
curr_rating = {key: '1' for key in total_rating.keys()}

t.data["total_rating"] = total_rating
t.data["inter_annotator_difference"] = inter_annotator_difference
t.data["curr_rating"] = curr_rating
curr_rating = {key: 1 for key in total_rating.keys()}

def dict_to_string(d):
return "{" + ", ".join(f"{key}: {value}" for key, value in d.items()) + "}"

t.data["total_rating"] = dict_to_string(total_rating)
t.data["inter_annotator_difference"] = dict_to_string(inter_annotator_difference)
t.data["curr_rating"] = dict_to_string(curr_rating)
t.save()


Expand Down
Loading