cnupo23/korean-medicine-embedding-dataset

Dataset

Korean Medicine Embedding Dataset (한의학 임베딩 데이터셋)

0

5 commits

1 linked in READMEs

updated Sep 23, 2026

See the code

README

Korean Medicine Embedding Dataset (한의학 임베딩 데이터셋)

A contrastive-learning dataset for training and evaluating domain-adapted text embedding models for Korean Medicine (KM, 한의학). Each example is a query–positive–negatives triplet built from KM terminology resources and a curated KM ontology, capturing semantic relations such as disease–symptom, disease–prescription, prescription–indication, prescription–herb, and herb–indication.

This dataset accompanies the study "A Domain-Adapted Embedding Model for Semantic Retrieval of Korean Medicine Knowledge", where it was used to domain-adapt BGE-M3 with LoRA and ontology-guided negative sampling. To our knowledge, it is the first publicly released embedding dataset specifically targeting Korean traditional medicine.

Why this dataset

General-purpose and biomedical embedding models do not capture the conceptual and linguistic structure of KM. KM interprets disease states in functional and relational terms and relies on symbolic concepts (e.g., 음양 yin–yang, 한열 cold–heat). It shares historical roots with Traditional Chinese Medicine but developed an independent theoretical system (e.g., Donguibogam, Sasang constitutional medicine). KM texts also mix Hangeul (한글), Hanja (한자), and Hangeul–Hanja parallel notation, where homophonous Sino-Korean terms can differ in meaning depending on the underlying characters. This dataset was constructed to inject that domain knowledge and these orthographic characteristics into embedding training.

Dataset structure

Data fields

Each line is a JSON object:

FieldTypeDescription
querystringA KM term or concept (term, disease, pattern identification, prescription, herb).
poslist[string]Semantically related positive text(s).
neglist[string]10 negatives per query: 3 similarity-based hard negatives + 7 random negatives.

Example (Hangeul–Hanja format):

{
  "query": "사군산(使君散)",
  "pos": ["사군자(使君子), 빈랑자(檳榔子), 웅황(雄黃)"],
  "neg": ["목통(木通), 청피(靑皮), 내복자(萊菔子), 회향(茴香), ...", "..."]
}

Text representation formats

Every underlying semantic instance is provided in three text representations, applied identically to the query, pos, and neg fields:

FormatFile suffixExample
Hangeul (한글 전용)korean풍한해수
Hanja (한자 전용)chinese風寒咳嗽
Hangeul–Hanja (병기)both풍한해수(風寒咳嗽)

The three representation-specific datasets share identical instance IDs, so a given ID denotes the same query–positive relationship across all three.

Splits

The dataset contains 113,299 underlying semantic instances. To prevent different representations of the same instance from being distributed across partitions, synchronized splitting was performed at the instance level: the 113,299 instances were randomly divided 8:1:1 into train / validation / test, and the same partition assignment was applied to all three representation-specific datasets.

This yields 90,639 train / 11,330 validation / 11,330 test instances per representation. The three training subsets were combined into a multi-representation training set of 271,917 instances.

FileSplitRepresentationInstances
split_val/unified_train.jsonltrainall three combined271,917
split_val/val_both.jsonlvalidationHangeul–Hanja11,330
split_val/val_chinese.jsonlvalidationHanja11,330
split_val/val_korean.jsonlvalidationHangeul11,330
split_val/test_both.jsonltestHangeul–Hanja11,330
split_val/test_chinese.jsonltestHanja11,330
split_val/test_korean.jsonltestHangeul11,330

The validation set was used for hyperparameter selection; the test set was held out for final evaluation.

Per-representation, unsplit versions of the full data are also provided under transformed/:

FileRepresentationInstances
transformed/train_data_both.jsonlHangeul–Hanja113,299
transformed/train_data_chinese.jsonlHanja113,299
transformed/train_data_korean.jsonlHangeul113,299

Naming note: both = Hangeul–Hanja, korean = Hangeul, chinese = Hanja.

Dataset composition

Positive pairs span 16 relation types drawn from two source types:

Data sourceQuery–Positive pairTrainValidationTestTotal
KM TerminologyTerm–Definition23,3792,9742,92529,278 (25.8%)
KM TerminologyTerm–Synonym26,6373,3803,22633,243 (29.3%)
KM OntologyDisease–Disease2,6373043253,266 (2.9%)
KM OntologyDisease–Etiology4985564617 (0.5%)
KM OntologyDisease–Symptom5,1556066136,374 (5.6%)
KM OntologyDisease–Treatment Principle9061071241,137 (1.0%)
KM OntologyDisease–Prescription2,0532342612,548 (2.2%)
KM OntologyDisease–Pattern Identification5406560665 (0.6%)
KM OntologyDisease–Prognosis961614126 (0.1%)
KM OntologyPrescription–Indication12,5541,5471,66915,770 (13.9%)
KM OntologyPrescription–Herb12,9601,6621,64916,271 (14.4%)
KM OntologyPrescription–Efficacy7628395940 (0.8%)
KM OntologyHerb–Alias1,0971211401,358 (1.2%)
KM OntologyHerb–Property4506154565 (0.5%)
KM OntologyHerb–Efficacy4645253569 (0.5%)
KM OntologyHerb–Indication4516358572 (0.5%)
Total90,63911,33011,330113,299

Construction pipeline

  1. Source curation. Query–positive pairs were derived from KM terminology resources (term–definition, term–synonym) and a verified KM ontology covering diseases, pattern identifications, prescriptions, and herbs.
  2. Negative sampling (graph-based exclusion → similarity + random). All elements of query–positive pairs were placed on a graph with bidirectional edges. Concept nodes (diseases, prescriptions, herbs) connect to other nodes; textual nodes (definitions, efficacies, indications) have no additional connections. Nodes within 2 hops of a query were excluded from the negative candidate pool because of potential semantic relatedness. From the remaining candidates, 10 negatives were selected per query: 3 similarity-based hard negatives (cosine similarity 0.4–0.6 under BGE-M3) and 7 random negatives.
  3. Multi-representation generation. Each instance was rendered in Hangeul, Hanja, and Hangeul–Hanja, with the transformation applied consistently to query, positive, and negative texts.
  4. Synchronized splitting. Instances were split 8:1:1 with partition assignments shared across all three representations; the training subsets were then unified.

Reference results

The dataset was used to domain-adapt BGE-M3 (568M params) with LoRA (r=16, α=32, dropout=0.1) and MultipleNegativesRankingLoss. Selected configuration: batch size 32, learning rate 5×10⁻⁴, 20 epochs, max sequence length 256, BF16.

Two evaluation settings were used on the same held-out test partition:

  • Candidate-pool — each query ranked against 11 candidates (1 positive + its 10 negatives).
  • Full-corpus — each query searched against all unique candidate texts: 74,828 (Hangeul–Hanja), 74,134 (Hanja), 73,100 (Hangeul). Corpus sizes differ because distinct source texts can convert to identical representations. Self-matching queries were excluded.

Hangeul–Hanja representation:

SettingMetricBGE-M3 (base)BGE-M3 + LoRA
Candidate-poolRecall@10.55830.8378
Candidate-poolMRR@100.66070.8953
Candidate-poolNDCG@100.73150.9206
Full-corpusRecall@10.04580.0829
Full-corpusRecall@100.15450.3286
Full-corpusRecall@1000.31040.6385
Full-corpusMRR@100.07600.1483
Full-corpusNDCG@100.09450.1906
Full-corpusMedian rank1,17430

Full-corpus performance across representations (fine-tuned model): Hangeul–Hanja MRR@10 0.1483 > Hanja 0.1376 > Hangeul 0.1184.

Performance varied substantially by relation type — Herb–Alias was highest (MRR@10 0.4209, median rank 3), followed by Term–Synonym (0.2755) and Term–Definition (0.1852).

SimGap (mean cosine similarity of positive pairs minus that of negative pairs, computed over the 10 predefined negatives) rose from 0.1245 to 0.5134 for the Hangeul–Hanja representation after domain adaptation.

Ablation analyses reported in the paper found that the effects of similarity-based hard-negative sampling and graph-based filtering were small and not consistent across the three evaluation representations, and that the benefit of including the combined Hangeul–Hanja representation in training varied by evaluation format.

Intended uses

  • Training / fine-tuning Korean Medicine–specific embedding models for semantic retrieval.
  • Building RAG systems, clinical decision support, and knowledge-retrieval pipelines over KM literature, guidelines, and ontology-based knowledge bases.
  • Studying the effect of Hangeul / Hanja / Hangeul–Hanja representations on retrieval in Sino-Korean technical domains.

Limitations

  • Train, validation, and test partitions were derived from the same terminology and ontology resources via random splitting. Although splitting was synchronized at the instance level to prevent representation-level leakage, the same entity may still appear across partitions; generalization to fully unseen entities is not guaranteed.
  • The data reflects terminology and ontology relations, not real clinical notes or prescription records, which use non-standardized, abbreviated, and varied expressions.
  • Negatives were mined under BGE-M3 similarity, so their difficulty distribution is tied to that base model.
  • The candidate-pool setting (1 positive + 10 negatives) saturates Recall@10; the full-corpus setting is the more informative evaluation.

Citation

@article{kim2026km_embedding,
  title   = {A Domain-Adapted Embedding Model for Semantic Retrieval of Korean Medicine Knowledge},
  author  = {Kim, Young-Eun and Keum, Kimun and Kim, Sang-Kyun and Kim, Anna and Son, Mi Ju and Seo, SuMin and Jang, Yunji and Oh, Yongtaek and Yi, Mun Yong},
  year    = {2026},
  note    = {Dataset: https://huggingface.co/datasets/cnupo23/korean-medicine-embedding-dataset}
}

License

Released under the Apache License 2.0. The underlying terminology and ontology resources are subject to their original terms; please verify source-specific conditions before use.

bge-m3
contrastive-learning
embedding
hangeul-hanja
korean-medicine
ontology
retrieval
traditional-medicine

Contributors

cnupo23

5 commits

cnupo23/korean-medicine-embedding-dataset

Dataset

Korean Medicine Embedding Dataset (한의학 임베딩 데이터셋)

0

5 commits

1 linked in READMEs

updated Sep 23, 2026

See the code

README

Korean Medicine Embedding Dataset (한의학 임베딩 데이터셋)

A contrastive-learning dataset for training and evaluating domain-adapted text embedding models for Korean Medicine (KM, 한의학). Each example is a query–positive–negatives triplet built from KM terminology resources and a curated KM ontology, capturing semantic relations such as disease–symptom, disease–prescription, prescription–indication, prescription–herb, and herb–indication.

This dataset accompanies the study "A Domain-Adapted Embedding Model for Semantic Retrieval of Korean Medicine Knowledge", where it was used to domain-adapt BGE-M3 with LoRA and ontology-guided negative sampling. To our knowledge, it is the first publicly released embedding dataset specifically targeting Korean traditional medicine.

Why this dataset

General-purpose and biomedical embedding models do not capture the conceptual and linguistic structure of KM. KM interprets disease states in functional and relational terms and relies on symbolic concepts (e.g., 음양 yin–yang, 한열 cold–heat). It shares historical roots with Traditional Chinese Medicine but developed an independent theoretical system (e.g., Donguibogam, Sasang constitutional medicine). KM texts also mix Hangeul (한글), Hanja (한자), and Hangeul–Hanja parallel notation, where homophonous Sino-Korean terms can differ in meaning depending on the underlying characters. This dataset was constructed to inject that domain knowledge and these orthographic characteristics into embedding training.

Dataset structure

Data fields

Each line is a JSON object:

FieldTypeDescription
querystringA KM term or concept (term, disease, pattern identification, prescription, herb).
poslist[string]Semantically related positive text(s).
neglist[string]10 negatives per query: 3 similarity-based hard negatives + 7 random negatives.

Example (Hangeul–Hanja format):

{
  "query": "사군산(使君散)",
  "pos": ["사군자(使君子), 빈랑자(檳榔子), 웅황(雄黃)"],
  "neg": ["목통(木通), 청피(靑皮), 내복자(萊菔子), 회향(茴香), ...", "..."]
}

Text representation formats

Every underlying semantic instance is provided in three text representations, applied identically to the query, pos, and neg fields:

FormatFile suffixExample
Hangeul (한글 전용)korean풍한해수
Hanja (한자 전용)chinese風寒咳嗽
Hangeul–Hanja (병기)both풍한해수(風寒咳嗽)

The three representation-specific datasets share identical instance IDs, so a given ID denotes the same query–positive relationship across all three.

Splits

The dataset contains 113,299 underlying semantic instances. To prevent different representations of the same instance from being distributed across partitions, synchronized splitting was performed at the instance level: the 113,299 instances were randomly divided 8:1:1 into train / validation / test, and the same partition assignment was applied to all three representation-specific datasets.

This yields 90,639 train / 11,330 validation / 11,330 test instances per representation. The three training subsets were combined into a multi-representation training set of 271,917 instances.

FileSplitRepresentationInstances
split_val/unified_train.jsonltrainall three combined271,917
split_val/val_both.jsonlvalidationHangeul–Hanja11,330
split_val/val_chinese.jsonlvalidationHanja11,330
split_val/val_korean.jsonlvalidationHangeul11,330
split_val/test_both.jsonltestHangeul–Hanja11,330
split_val/test_chinese.jsonltestHanja11,330
split_val/test_korean.jsonltestHangeul11,330

The validation set was used for hyperparameter selection; the test set was held out for final evaluation.

Per-representation, unsplit versions of the full data are also provided under transformed/:

FileRepresentationInstances
transformed/train_data_both.jsonlHangeul–Hanja113,299
transformed/train_data_chinese.jsonlHanja113,299
transformed/train_data_korean.jsonlHangeul113,299

Naming note: both = Hangeul–Hanja, korean = Hangeul, chinese = Hanja.

Dataset composition

Positive pairs span 16 relation types drawn from two source types:

Data sourceQuery–Positive pairTrainValidationTestTotal
KM TerminologyTerm–Definition23,3792,9742,92529,278 (25.8%)
KM TerminologyTerm–Synonym26,6373,3803,22633,243 (29.3%)
KM OntologyDisease–Disease2,6373043253,266 (2.9%)
KM OntologyDisease–Etiology4985564617 (0.5%)
KM OntologyDisease–Symptom5,1556066136,374 (5.6%)
KM OntologyDisease–Treatment Principle9061071241,137 (1.0%)
KM OntologyDisease–Prescription2,0532342612,548 (2.2%)
KM OntologyDisease–Pattern Identification5406560665 (0.6%)
KM OntologyDisease–Prognosis961614126 (0.1%)
KM OntologyPrescription–Indication12,5541,5471,66915,770 (13.9%)
KM OntologyPrescription–Herb12,9601,6621,64916,271 (14.4%)
KM OntologyPrescription–Efficacy7628395940 (0.8%)
KM OntologyHerb–Alias1,0971211401,358 (1.2%)
KM OntologyHerb–Property4506154565 (0.5%)
KM OntologyHerb–Efficacy4645253569 (0.5%)
KM OntologyHerb–Indication4516358572 (0.5%)
Total90,63911,33011,330113,299

Construction pipeline

  1. Source curation. Query–positive pairs were derived from KM terminology resources (term–definition, term–synonym) and a verified KM ontology covering diseases, pattern identifications, prescriptions, and herbs.
  2. Negative sampling (graph-based exclusion → similarity + random). All elements of query–positive pairs were placed on a graph with bidirectional edges. Concept nodes (diseases, prescriptions, herbs) connect to other nodes; textual nodes (definitions, efficacies, indications) have no additional connections. Nodes within 2 hops of a query were excluded from the negative candidate pool because of potential semantic relatedness. From the remaining candidates, 10 negatives were selected per query: 3 similarity-based hard negatives (cosine similarity 0.4–0.6 under BGE-M3) and 7 random negatives.
  3. Multi-representation generation. Each instance was rendered in Hangeul, Hanja, and Hangeul–Hanja, with the transformation applied consistently to query, positive, and negative texts.
  4. Synchronized splitting. Instances were split 8:1:1 with partition assignments shared across all three representations; the training subsets were then unified.

Reference results

The dataset was used to domain-adapt BGE-M3 (568M params) with LoRA (r=16, α=32, dropout=0.1) and MultipleNegativesRankingLoss. Selected configuration: batch size 32, learning rate 5×10⁻⁴, 20 epochs, max sequence length 256, BF16.

Two evaluation settings were used on the same held-out test partition:

  • Candidate-pool — each query ranked against 11 candidates (1 positive + its 10 negatives).
  • Full-corpus — each query searched against all unique candidate texts: 74,828 (Hangeul–Hanja), 74,134 (Hanja), 73,100 (Hangeul). Corpus sizes differ because distinct source texts can convert to identical representations. Self-matching queries were excluded.

Hangeul–Hanja representation:

SettingMetricBGE-M3 (base)BGE-M3 + LoRA
Candidate-poolRecall@10.55830.8378
Candidate-poolMRR@100.66070.8953
Candidate-poolNDCG@100.73150.9206
Full-corpusRecall@10.04580.0829
Full-corpusRecall@100.15450.3286
Full-corpusRecall@1000.31040.6385
Full-corpusMRR@100.07600.1483
Full-corpusNDCG@100.09450.1906
Full-corpusMedian rank1,17430

Full-corpus performance across representations (fine-tuned model): Hangeul–Hanja MRR@10 0.1483 > Hanja 0.1376 > Hangeul 0.1184.

Performance varied substantially by relation type — Herb–Alias was highest (MRR@10 0.4209, median rank 3), followed by Term–Synonym (0.2755) and Term–Definition (0.1852).

SimGap (mean cosine similarity of positive pairs minus that of negative pairs, computed over the 10 predefined negatives) rose from 0.1245 to 0.5134 for the Hangeul–Hanja representation after domain adaptation.

Ablation analyses reported in the paper found that the effects of similarity-based hard-negative sampling and graph-based filtering were small and not consistent across the three evaluation representations, and that the benefit of including the combined Hangeul–Hanja representation in training varied by evaluation format.

Intended uses

  • Training / fine-tuning Korean Medicine–specific embedding models for semantic retrieval.
  • Building RAG systems, clinical decision support, and knowledge-retrieval pipelines over KM literature, guidelines, and ontology-based knowledge bases.
  • Studying the effect of Hangeul / Hanja / Hangeul–Hanja representations on retrieval in Sino-Korean technical domains.

Limitations

  • Train, validation, and test partitions were derived from the same terminology and ontology resources via random splitting. Although splitting was synchronized at the instance level to prevent representation-level leakage, the same entity may still appear across partitions; generalization to fully unseen entities is not guaranteed.
  • The data reflects terminology and ontology relations, not real clinical notes or prescription records, which use non-standardized, abbreviated, and varied expressions.
  • Negatives were mined under BGE-M3 similarity, so their difficulty distribution is tied to that base model.
  • The candidate-pool setting (1 positive + 10 negatives) saturates Recall@10; the full-corpus setting is the more informative evaluation.

Citation

@article{kim2026km_embedding,
  title   = {A Domain-Adapted Embedding Model for Semantic Retrieval of Korean Medicine Knowledge},
  author  = {Kim, Young-Eun and Keum, Kimun and Kim, Sang-Kyun and Kim, Anna and Son, Mi Ju and Seo, SuMin and Jang, Yunji and Oh, Yongtaek and Yi, Mun Yong},
  year    = {2026},
  note    = {Dataset: https://huggingface.co/datasets/cnupo23/korean-medicine-embedding-dataset}
}

License

Released under the Apache License 2.0. The underlying terminology and ontology resources are subject to their original terms; please verify source-specific conditions before use.

bge-m3
contrastive-learning
embedding
hangeul-hanja
korean-medicine
ontology
retrieval
traditional-medicine

Contributors

cnupo23

5 commits