LelViLamp commited on
Commit
c456f18
1 Parent(s): 763fb6e

Upload 4 files

Browse files
Files changed (4) hide show
  1. README.md +85 -35
  2. merged_into_long_text.csv +0 -0
  3. merged_into_long_text.json +0 -0
  4. text.csv +0 -0
README.md CHANGED
@@ -1,37 +1,87 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: annotation_id
5
- dtype: string
6
- - name: line_id
7
- dtype: uint16
8
- - name: start
9
- dtype: uint16
10
- - name: end
11
- dtype: uint16
12
- - name: label
13
- dtype:
14
- class_label:
15
- names:
16
- '0': EVENT
17
- '1': LOC
18
- '2': MISC
19
- '3': ORG
20
- '4': PER
21
- '5': TIME
22
- - name: label_text
23
- dtype: string
24
- - name: merged
25
- dtype: bool
26
- splits:
27
- - name: train
28
- num_bytes: 702091
29
- num_examples: 15938
30
- download_size: 474444
31
- dataset_size: 702091
32
- configs:
33
- - config_name: default
34
- data_files:
35
- - split: train
36
- path: data/train-*
37
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ task_categories:
3
+ - token-classification
4
+ language:
5
+ - de
6
+ - la
7
+ - fr
8
+ - en
9
+ tags:
10
+ - historical
11
+ pretty_name: >-
12
+ Annotations and models for named entity recognition on Oberdeutsche Allgemeine Litteraturzeitung of the first quarter of 1788
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
+ # OALZ/1788/Q1/NER
15
+
16
+ A named entity recognition system (NER) was trained on text extracted from _Oberdeutsche Allgemeine Litteraturueitung_ (OALZ) of the first quarter (January, Febuary, March) of 1788. The scans from which text was extracted can be found at [Bayerische Staatsbibliothek](https://www.digitale-sammlungen.de/de/view/bsb10628753?page=,1) using the extraction strategy of the _KEDiff_ project, which can be found at [`cborgelt/KEDiff`](https://github.com/cborgelt/KEDiff).
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
+
33
+ | Tag | Label | Count | Total Length | Median Annotation Length | Mean Annotation Length | SD |
34
+ |:--------|:--------------|------:|-------------:|-------------------------:|-----------------------:|------:|
35
+ | `EVENT` | Event | 294 | 6,090 | 18 | 20.71 | 13.24 |
36
+ | `LOC` | Location | 2,449 | 24,417 | 9 | 9.97 | 6.21 |
37
+ | `MISC` | Miscellaneous | 2,585 | 50,654 | 14 | 19.60 | 19.63 |
38
+ | `ORG` | Organisation | 2,479 | 34,693 | 11 | 13.99 | 9.33 |
39
+ | `PER` | Person | 7,055 | 64,710 | 7 | 9.17 | 9.35 |
40
+ | `TIME` | Dates & Time | 1,076 | 13,154 | 8 | 12.22 | 10.98 |
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.
74
+
75
+ The models' performance measures are as follows:
76
+
77
+ | Model | Selected Epoch | Checkpoint | Validation Loss | Precision | Recall | F<sub>1</sub> | Accuracy |
78
+ |:-------------------------------------------------------------------|:--------------:|-----------:|----------------:|----------:|--------:|--------------:|---------:|
79
+ | [`EVENT`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-event) | 1 | `1393` | .021957 | .665233 | .343066 | .351528 | .995700 |
80
+ | [`LOC`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-loc) | 1 | `1393` | .033602 | .829535 | .803648 | .814146 | .990999 |
81
+ | [`MISC`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-misc) | 2 | `2786` | .123994 | .739221 | .503677 | .571298 | 968697 |
82
+ | [`ORG`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-org) | 1 | `1393` | .062769 | .744259 | .709738 | .726212 | .980288 |
83
+ | [`PER`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-per) | 2 | `2786` | .059186 | .914037 | .849048 | .879070 | .983253 |
84
+ | [`TIME`](https://huggingface.co/LelViLamp/oalz-1788-q1-ner-time) | 1 | `1393` | .016120 | .866866 | .724958 | .783099 | .994631 |
85
+
86
+ ## Acknowledgements
87
+ The data set and models were created in the project _Kooperative Erschließung diffusen Wissens_ ([KEDiff](https://uni-salzburg.elsevierpure.com/de/projects/kooperative-erschließung-diffusen-wissens-ein-literaturwissenscha)), funded by the [State of Salzburg](https://salzburg.gv.at), Austria 🇦🇹, and carried out at [Paris Lodron Universität Salzburg](https://plus.ac.at).
merged_into_long_text.csv ADDED
The diff for this file is too large to render. See raw diff
 
merged_into_long_text.json ADDED
The diff for this file is too large to render. See raw diff
 
text.csv ADDED
The diff for this file is too large to render. See raw diff