Skip to content

Commit

Permalink
fixed bugs in processing of closed tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ancadumitrache committed Jun 12, 2018
1 parent f62f3cd commit 33a6d0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions crowdtruth/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
class OrderedCounter(Counter, OrderedDict):
pass

def createOrderedCounter(orderedCounter, annotation_vector):
for relation in annotation_vector:
if relation not in orderedCounter:
orderedCounter.update({relation: 0})
return orderedCounter


class Found(Exception): pass

Expand Down
2 changes: 1 addition & 1 deletion crowdtruth/models/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def relation_quality_score(relations, work_sent_rel_dict, sqs, wqs):
rqs = dict()
for relation in relations:
if rqs_denominator[relation] > 0:
rqs[relation] = rqs_numerator[relation] / rqs_denominator[relation]
rqs[relation] = rqs_nominator[relation] / rqs_denominator[relation]

# prevent division by zero by storing very small value instead
if rqs[relation] < 0.0001:
Expand Down

0 comments on commit 33a6d0e

Please sign in to comment.