Commit ·
2642eea
1
Parent(s): 8fa3434
add examples of parsing annotations (#2)
Browse files- add examples of parsing annotations (ab1c6a7bf1dbac4a61291ed85a4ba71367e85a0d)
Co-authored-by: Daniel van Strien <davanstrien@users.noreply.huggingface.co>
167 unmodified lines168169170171172173167 unmodified lines## Considerations for Using the Data### Social Impact of DatasetThis dataset can be used to see how words change in meaning over time167 unmodified lines168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216167 unmodified lines## Considerations for Using the Data## Accessing the annotationsEach example text has multiple annotations. These annotations may not always agree. There are various approaches one could take to calculate agreement, including a majority vote, rating some annotators more highly, or calculating a score based on the 'votes' of annotators. Since there are many ways of doing this, we have not implemented this as part of the dataset loading script.An example of how one could generate an "OCR quality rating" based on the number of times an annotator labelled an example with `Illegible OCR`:```pythonfrom collections import Counterdef calculate_ocr_score(example):annotator_responses = [response['response'] for response in example['annotator_responses_english']]counts = Counter(annotator_responses)bad_ocr_ratings = counts.get("Illegible OCR")if bad_ocr_ratings is None:bad_ocr_ratings = 0return round(1 - bad_ocr_ratings/len(annotator_responses),3)dataset = dataset.map(lambda example: {"ocr_score":calculate_ocr_score(example)})```To take the majority vote (or return a tie) based on whether a example is labelled contentious or not:```pythondef most_common_vote(example):annotator_responses = [response['response'] for response in example['annotator_responses_english']]counts = Counter(annotator_responses)contentious_count = counts.get("Contentious according to current standards")if not contentious_count:contentious_count = 0not_contentious_count = counts.get("Not contentious")if not not_contentious_count:not_contentious_count = 0if contentious_count > not_contentious_count:return "contentious"if contentious_count < not_contentious_count:return "not_contentious"if contentious_count == not_contentious_count:return "tied"```### Social Impact of DatasetThis dataset can be used to see how words change in meaning over time
README.md+43