add examples of parsing annotations
#2
by davanstrien HF Staff - opened
167 unmodified lines168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216167 unmodified lines
## Considerations for Using the Data
## Accessing the annotations
Each 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`:
```python from collections import Counter
def 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 = 0 return 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:
```python
def 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 = 0 not_contentious_count = counts.get("Not contentious") if not not_contentious_count: not_contentious_count = 0 if 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 Dataset
This dataset can be used to see how words change in meaning over timeREADME.md+43