LelViLamp commited on
Commit
6e0d788
1 Parent(s): 166021e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -9
README.md CHANGED
@@ -17,18 +17,16 @@ A named entity recognition system (NER) was trained on text extracted from _Ober
17
 
18
  ## Annotations
19
 
20
- Each text passage was annotated in [doccano](https://github.com/doccano/doccano) by two or three annotators and their annotations were cleaned and merged into one dataset. For details on how this was done, see [`LelViLamp/kediff-doccano-postprocessing`](https://github.com/LelViLamp/kediff-doccano-postprocessing). In total, the text consists of about 1.7m characters. The resulting annotation datasets were published on the Hugging Face Hub as [`oalz-1788-q1-ner-annotations`](https://huggingface.co/datasets/LelViLamp/oalz-1788-q1-ner-annotations).
21
-
22
- There are two versions of the dataset
23
- - [`5a-generate-union-dataset`](https://huggingface.co/datasets/LelViLamp/oalz-1788-q1-ner-annotations/tree/main/5a-generate-union-dataset) contains the texts split into chunks. This is how they were presented in the annotation application doccano
24
- - [`5b-merge-documents`](https://huggingface.co/datasets/LelViLamp/oalz-1788-q1-ner-annotations/tree/main/5b-merge-documents) does not retain this split. The text was merged into one long text and annotation indices were adapted.
25
 
26
  Note that both these directories contain three equivalent datasets each:
27
  - a Huggingface/Arrow dataset, <sup>*</sup>
28
  - a CSV, <sup>*</sup> and
29
  - a JSONL file.
30
 
31
- <sup>*</sup> The former two should be used together with `text.csv` to catch the context of the annotation. The latter JSONL file contains the full text.
32
 
33
  The following categories were included in the annotation process:
34
 
@@ -43,15 +41,33 @@ The following categories were included in the annotation process:
43
 
44
  ## NER models
45
 
46
- Based on the annotations above, six separate NER classifiers were trained, one for each label type. This was done in order to allow overlapping annotations. For example, you would want to categorise the whole passage "Universität Salzburg" as an organisation while also extracting "Salzburg" as a location. This would result in an annotation like this:
47
 
48
  ```json
49
  {
50
- "text": "Universität Salzburg",
51
- "label": [[0, 20, "ORG"], [12, 20, "LOC"]]
 
52
  }
53
  ```
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  To achieve this overlap, each text passage must be run through all the classifiers individually and each classifier's results need to be combined. For details on how the training was done, see [`LelViLamp/kediff-ner-training`](https://github.com/LelViLamp/kediff-ner-training).
56
 
57
  The [`dbmdz/bert-base-historic-multilingual-cased`](https://huggingface.co/dbmdz/bert-base-historic-multilingual-cased) tokeniser was used to create historical embeddings. Therefore, it is necessary to use that in order to use these NER models.
 
17
 
18
  ## Annotations
19
 
20
+ Each text passage was annotated in [doccano](https://github.com/doccano/doccano) by two or three annotators and their annotations were cleaned and merged into one dataset. For details on how this was done, see [`LelViLamp/kediff-doccano-postprocessing`](https://github.com/LelViLamp/kediff-doccano-postprocessing). In total, the text consists of about 1.7m characters. The resulting annotation datasets were published on the Hugging Face Hub. There are two versions of the dataset
21
+ - [`union-dataset`](https://huggingface.co/datasets/LelViLamp/oalz-1788-q1-ner-annotations-union-dataset) contains the texts split into chunks. This is how they were presented in the annotation application doccano and results from preprocessing step 5a.
22
+ - [`merged-union-dataset`](https://huggingface.co/datasets/LelViLamp/oalz-1788-q1-ner-annotations-merged-union-dataset) does not retain this split. The text was merged into one long text and annotation indices were adapted in preprocessing step 5b.
 
 
23
 
24
  Note that both these directories contain three equivalent datasets each:
25
  - a Huggingface/Arrow dataset, <sup>*</sup>
26
  - a CSV, <sup>*</sup> and
27
  - a JSONL file.
28
 
29
+ <sup>*</sup> The former two should be used together with the provided `text.csv` to catch the context of the annotation. The latter JSONL file contains the full text.
30
 
31
  The following categories were included in the annotation process:
32
 
 
41
 
42
  ## NER models
43
 
44
+ Based on the annotations above, six separate NER classifiers were trained, one for each label type. This was done in order to allow overlapping annotations. For example, in the passage "Dieses Projekt wurde an der Universität Salzburg durchgeführt", you would want to categorise "Universität Salzburg" as an organisation while also extracting "Salzburg" as a location. This would result in an annotation like this:
45
 
46
  ```json
47
  {
48
+ "id": "example-42",
49
+ "text": "Dieses Projekt wurde an der Universität Salzburg durchgeführt",
50
+ "label": [[28, 49, "ORG"], [40, 49, "LOC"]]
51
  }
52
  ```
53
 
54
+ Example entry in CSV and Huggingface dataset
55
+
56
+ | annotation_id | line_id | start | end | label | label_text | merged |
57
+ |:--------------|:-----------|------:|----:|:------|:---------------------|:------:|
58
+ | $n$ | example-42 | 28 | 49 | ORG | Universität Salzburg | ??? |
59
+ | $n+1$ | example-42 | 40 | 49 | LOC | Salzburg | ??? |
60
+
61
+ The columns mean:
62
+ - `annotation_id` was assigned internally by enumerating all annotations. This is not present in the JSONL format
63
+ - `line_id` is the fragment of the subdivided text, as shown in doccano. Called `id` in the JSONL dataset.
64
+ - `start` index of the first character that is annotated. Included, starts with 0.
65
+ - `end` index of the last character that is annotated. Excluded, maximum value is `len(respectiveText)`.
66
+ - `label` indicates what the passage indicated by $[start, end)$ was annotated as.
67
+ - `label_text` contains the text that is annotated by $[start, end)$. This is not present in the JSONL dataset as it can be inferred there.
68
+ - `merged` indicates whether this annotation is the result of overlapping annotations of the same label. In that case, `annotation_id` contains the IDs of the individual annotations it was constructed of. This is not present in the JSONL dataset.
69
+
70
+
71
  To achieve this overlap, each text passage must be run through all the classifiers individually and each classifier's results need to be combined. For details on how the training was done, see [`LelViLamp/kediff-ner-training`](https://github.com/LelViLamp/kediff-ner-training).
72
 
73
  The [`dbmdz/bert-base-historic-multilingual-cased`](https://huggingface.co/dbmdz/bert-base-historic-multilingual-cased) tokeniser was used to create historical embeddings. Therefore, it is necessary to use that in order to use these NER models.