DrQA icon indicating copy to clipboard operation
DrQA copied to clipboard

Using DrQA on an Chinese dataset

Open kaihuchen opened this issue 7 years ago • 3 comments

Is it expected that this code can be applied to a Chinese language dataset with only minor changes?

I understand that I will need to provide the following:

  • Chinese train/dev data files in the SQuAD format
  • GloVe word vectors trained on the Chinese language
  • Spacy Chinese language models
  • Changes in prepro.py to take care of things such as tokenization, add encoding="utf8" to file read/write statements, etc.

Would very much appreciate any insights if there is any known reasons why this is not supposed to work.

kaihuchen avatar Oct 03 '18 16:10 kaihuchen

Yes, there should be only those modifications you mentioned. The most tricky part should be the Chinese SpaCy models, which are not officially supported.

hitvoice avatar Oct 03 '18 17:10 hitvoice

@hitvoice Much appreciated for the confirmation! One more question: given that the Chinese language does not have natural word boundaries, when using DrQA with a Chinese language dataset, does it make any difference for DrQA whether the dataset is tokenized first (i.e., 分词,using a tool such as Jieba)? Or can I assume that since SpaCy kind of does tokenization in its own way, so I actually don't have to anything specially in this respect?

kaihuchen avatar Oct 23 '18 21:10 kaihuchen

You should tokenize your Chinese data first. Prepare your data as "这是 一个 分词 后 的 样例" (separate tokens by spaces) and provide corresponding POS and NER tags. This not an easy copy-and-paste. A lot of work and modifications should be done for Chinese support.

hitvoice avatar Oct 24 '18 04:10 hitvoice