File size: 6,341 Bytes
cc387b5
 
 
 
 
 
 
 
 
 
 
 
 
 
8b6fe34
cc387b5
a7c6008
 
 
 
 
cc387b5
8b6fe34
 
cc387b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a7c6008
cc387b5
 
 
8b6fe34
 
cc387b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
license: apache-2.0
task_categories:
- token-classification
language:
- el
tags:
- greek
- ner
- medical
- symptoms
size_categories:
- 100K<n<1M
---
# Greek NER dataset

## Acknowledgement

This dataset had been created as part of joint research of HUMADEX research group (https://www.linkedin.com/company/101563689/) and has received funding by the European Union Horizon Europe Research and Innovation Program project SMILE (grant number 101080923) and Marie Skłodowska-Curie Actions (MSCA) Doctoral Networks, project BosomShield ((rant number 101073222). Responsibility for the information and views expressed herein lies entirely with the authors.
Authors:
dr. Izidor Mlakar, Rigon Sallauka, dr. Umut Arioz, dr. Matej Rojc

## Dataset Building

## Data Integration and Preprocessing

We begin by merging two distinct datasets of English medical texts. This step ensures a robust and diverse corpus, combining the strengths of both datasets. Following the integration, we preprocess the texts to clean the data, which includes removal of strings that do not contain relevant information. This preprocessing step is crucial to ensure the texts are in an optimal format for subsequent annotation.

- **Dataset 1**: [Kabatubare/autotrain-data-1w6s-u4vt-i7yo](https://huggingface.co/datasets/Kabatubare/autotrain-data-1w6s-u4vt-i7yo)
- **Dataset 2**: [s200862/medical_qa_meds](https://huggingface.co/datasets/s200862/medical_qa_meds)

The data underwent a preprocessing process.

1. **Data Cleaning**: Since our dataset consisted of question-answer pairs between a user and an assistant, some extraneous text could be removed without losing relevant information.
   - In the **Kabatubare/autotrain-data-1w6s-u4vt-i7yo** dataset, we removed the following strings:
     - `Human:`
     - `Assistant:`

     - `\n` (newline characters)
     - `\t` (tab characters)
     - Hyphens between words (`-`) were replaced with a single space.
   - In the **s200862/medical_qa_meds** dataset, we removed:
     - `[INST]`
     - `[/INST]`
     - `<s>`
     - `</s>`
     - `\n` (newline characters)
     - `\t` (tab characters)

2. **Punctuation Removal**: All punctuation marks were removed from the text to ensure consistency.

3. **Lowercasing**: Finally, the entire dataset was converted to lowercase to standardize the text.


## Annotation with Stanza's i2b2 Clinical Model


The preprocessed English texts are then annotated using [Stanza's i2b2 Clinical Model](https://stanfordnlp.github.io/stanza/available_biomed_models.html). This model is specifically designed for clinical text processing, and it annotates each text with three labels:
   - **PROBLEM**: Includes diseases, symptoms, and medical conditions.
   - **TEST**: Represents diagnostic procedures and laboratory tests.
   -
 **TREATMENT**: Covers medications, therapies, and other medical interventions.

This annotation step is essential for creating a labeled dataset that serves as the foundation for training and evaluating Named Entity Recognition (NER) models.

We used Stanza's clinical-domain NER system, which contains a general-purpose NER model trained on the **2010 i2b2/VA dataset**. This model efficiently extracts entities related to problems, tests, and treatments from various types of clinical notes.


## Tag encodings:
  - "O": 0
  - "B-PROBLEM": 1
  - "I-PROBLEM": 2
  - "E-PROBLEM": 3
  - "S-PROBLEM": 4
  - "B-TREATMENT": 5
  - "I-TREATMENT": 6
  - "E-TREATMENT": 7
  - "S-TREATMENT": 8
  - "B-TEST": 9
  - "I-TEST": 10
  - "E-TEST": 11
  - "S-TEST": 12

## Translation into Greek

The annotated English dataset is translated into Greek: 
Model name: [Helsinki-NLP/opus-mt-en-el](https://huggingface.co/Helsinki-NLP/opus-mt-en-el) 
Model was developed by Language Technology Research Group at the University of Helsinki. Model Type is Translation.

## Word Alignment

Model: [aneuraz/awesome-align-with-co](https://huggingface.co/aneuraz/awesome-align-with-co)

This method is for extracting alignments between words in parallel sentences using contextual word embeddings from models like BERT . Main processing steps:

1.	**Contextual Word Embeddings:** Powerful models like BERT capture the meaning of words based on their context in a sentence. These models can be used to generate numerical representations (embeddings) for each word in a sentence.

2.	**Alignment Scores:** The method calculates alignment scores between words in two parallel sentences (sentences in different languages that mean the same thing). Two approaches are used:
	- **Probability Thresholding:** This method uses a similarity matrix based on the dot product of word embeddings. It then applies a function (like softmax) to turn similarities into probabilities and identifies high-probability pairs as aligned.
	- **Optimal Transport:** This approach views alignment as a transportation problem, where the goal is to move "probability mass" between words in a way that minimizes cost (distance between word embeddings). The resulting matrix shows likely alignments.

3.	**Bidirectional Alignments:** The method considers alignments in both directions (source to target and target to source). The final alignment is obtained by finding the intersection of alignments in both directions.

4.	**Subword Handling:** Since some models work with subwords (parts of words), the method considers two words aligned if any of their subwords are aligned.

Overall, this approach leverages contextual word embeddings and different techniques to find corresponding words between sentences in different languages.


## Data Augmentation

We performed data augmentation to enhance the diversity and robustness of the training data. The augmentation process involved two main strategies:

 - **Sentence Reordering:** Words within each sentence were reordered to create new variations of the same sentence structure. This method increases the variability of the dataset, enabling the model to generalize better to different sentence formations.
 - **Entity Extraction:** All words within each sentence that were annotated with non-"O" labels (i.e., labeled as PROBLEM, TEST, or TREATMENT) were extracted and used to generate new sentences. These sentences were then added back into the dataset, ensuring that the model would encounter more examples of key medical entities during training.