yzhihao/MCSCSet

A Specialist-annotated Dataset for Medical-domain Chinese Spelling Correction

38

stars

7

commits

Jun 6, 2022

updated

README

MCSCSet: A Specialist-annotated Dataset for Medical-domain Chinese Spelling Correction

Introduction

We introduce MCSCSet, a large-scale specialist-annotated dataset dedicated for the task of Medical-domain Chinese Spelling Correction (MCSC). In contrast to existing open-domain CSC datasets, MCSCSet involves: i) extensive real-world medical queries collected from Tencent Yidian, ii) corresponding misspelled sentences manually annotated by medical specialists. Our resource further offers a medical-domain confusion set consisting of the common errorprone characters in medicine and their corresponding misspellings.

The dataset paper is submitted to CIKM 2022 (Short and Resource Track). See paper for more details.

Data

The data is stored in ./data.

  • ./data/original_query_log.txt: 901,766 queries collected from real-world query logs.
  • ./data/annotated_data.txt: 199,763 samples with specialist annotation.
  • ./data/med_confusionset.txt : Medical-domain confusion set consisting of 2623 error-prone characters and their corresponding misspellings.
  • ./data/mcsc_benchmark_dataset/ : Benchmark dataset for MCSC task.
    • ./data/mcsc_benchmark_dataset/filtered_data.txt: 196,496 filtered samples focusing on spelling errors.
    • ./data/mcsc_benchmark_dataset/(train, valid, test).txt: Benchmark dataset consisting of train set (157,194 samples), valid set (19,652 samples) and test set (19,650 samples).

Statistics

Several aspects of statistics of the dataset are shown as follows:

AspectValue
Number of samples196,496
Number of train/ valid/ test sets157,194 / 19,652 / 19,650
Avg. query length10.90
Avg. number of misspelled characters per query1.86
Avg. number of medical entities per query1.46
Number of unique medical entities81,020

Data Format

This section explains the key files data format (annotated_data.txt, filtered_data.txt and med_confusionset.txt).

The format of each piece of data in annotated_data.txt is:

Wrong query \t Correct query \t Error type(s) \n

The format of each piece of data in filtered_data.txt is:

Wrong query \t Correct query \n

The format of each piece of data in med_confusionset.txt is:

Key character \t Value characters \n

  • Wrong query: Query that contains misspelled characters.
  • Correct query: Corresponding query that are definitely correct.
  • Error type(s): Corresponding error type(s) of misspelled character(s) in the wrong query.
  • Key character: An error-prone character in the medical domain.
  • Value characters: Corresponding misspelled characters of a given key character, split with single space.

Data Loading

The data can be loaded with simple python scripts like:

train_wrong_queries = []
train_correct_queries = []
with open('.\data\mcsc_benchmark_dataset\train.txt', 'r', encoding='utf-8) as f:
    train_samples = f.readlines()
    for sample in train_samples:
        pair = sample.strip().split('\t')
        train_wrong_queries.append(pair[0])
        train_correct_queries.append(pair[1])

Benchmark Experiments

The source code of several representative baseline methods is in ./src/.

The benchmark experimental results are shown as follows:

MethodDetectionCorrection
    P (%)        R (%)        F1 (%)        P (%)        R (%)        F1 (%)    
N-gram LM38.4320.3826.6430.3216.0821.02
BERT-Corrector87.0586.0886.5580.9380.0580.49
MedBERT-Corrector87.0186.2586.6380.9880.2480.61
Soft-Masked BERT80.0386.2986.6681.2280.5480.88

License

This repository is liciensed under Apache-2.0 License.

The MCSCSet dataset is licensed under CC BY-NC 2.0.

FAQ

Contributors

ThuJiang

4 commits

yzhihao

3 commits

yzhihao/MCSCSet

A Specialist-annotated Dataset for Medical-domain Chinese Spelling Correction

38

stars

7

commits

Jun 6, 2022

updated

README

MCSCSet: A Specialist-annotated Dataset for Medical-domain Chinese Spelling Correction

Introduction

We introduce MCSCSet, a large-scale specialist-annotated dataset dedicated for the task of Medical-domain Chinese Spelling Correction (MCSC). In contrast to existing open-domain CSC datasets, MCSCSet involves: i) extensive real-world medical queries collected from Tencent Yidian, ii) corresponding misspelled sentences manually annotated by medical specialists. Our resource further offers a medical-domain confusion set consisting of the common errorprone characters in medicine and their corresponding misspellings.

The dataset paper is submitted to CIKM 2022 (Short and Resource Track). See paper for more details.

Data

The data is stored in ./data.

  • ./data/original_query_log.txt: 901,766 queries collected from real-world query logs.
  • ./data/annotated_data.txt: 199,763 samples with specialist annotation.
  • ./data/med_confusionset.txt : Medical-domain confusion set consisting of 2623 error-prone characters and their corresponding misspellings.
  • ./data/mcsc_benchmark_dataset/ : Benchmark dataset for MCSC task.
    • ./data/mcsc_benchmark_dataset/filtered_data.txt: 196,496 filtered samples focusing on spelling errors.
    • ./data/mcsc_benchmark_dataset/(train, valid, test).txt: Benchmark dataset consisting of train set (157,194 samples), valid set (19,652 samples) and test set (19,650 samples).

Statistics

Several aspects of statistics of the dataset are shown as follows:

AspectValue
Number of samples196,496
Number of train/ valid/ test sets157,194 / 19,652 / 19,650
Avg. query length10.90
Avg. number of misspelled characters per query1.86
Avg. number of medical entities per query1.46
Number of unique medical entities81,020

Data Format

This section explains the key files data format (annotated_data.txt, filtered_data.txt and med_confusionset.txt).

The format of each piece of data in annotated_data.txt is:

Wrong query \t Correct query \t Error type(s) \n

The format of each piece of data in filtered_data.txt is:

Wrong query \t Correct query \n

The format of each piece of data in med_confusionset.txt is:

Key character \t Value characters \n

  • Wrong query: Query that contains misspelled characters.
  • Correct query: Corresponding query that are definitely correct.
  • Error type(s): Corresponding error type(s) of misspelled character(s) in the wrong query.
  • Key character: An error-prone character in the medical domain.
  • Value characters: Corresponding misspelled characters of a given key character, split with single space.

Data Loading

The data can be loaded with simple python scripts like:

train_wrong_queries = []
train_correct_queries = []
with open('.\data\mcsc_benchmark_dataset\train.txt', 'r', encoding='utf-8) as f:
    train_samples = f.readlines()
    for sample in train_samples:
        pair = sample.strip().split('\t')
        train_wrong_queries.append(pair[0])
        train_correct_queries.append(pair[1])

Benchmark Experiments

The source code of several representative baseline methods is in ./src/.

The benchmark experimental results are shown as follows:

MethodDetectionCorrection
    P (%)        R (%)        F1 (%)        P (%)        R (%)        F1 (%)    
N-gram LM38.4320.3826.6430.3216.0821.02
BERT-Corrector87.0586.0886.5580.9380.0580.49
MedBERT-Corrector87.0186.2586.6380.9880.2480.61
Soft-Masked BERT80.0386.2986.6681.2280.5480.88

License

This repository is liciensed under Apache-2.0 License.

The MCSCSet dataset is licensed under CC BY-NC 2.0.

FAQ

Contributors

ThuJiang

4 commits

yzhihao

3 commits