transformers pytorch mt5 text2text-generation zh question-answering autotrain_compatible endpoints_compatible region:us
---
language:
- zh
pipeline_tag: text2text-generation
tags:
- mt5
- zh
- question-answering
---
# mT5 Model for Chinese Question-Answering

<!-- Provide a quick summary of what the model is/does. -->

This model is a fine-tuned version of [google/mt5-base](https://huggingface.co/google/mt5-base) on [DRCD](https://github.com/DRCKnowledgeTeam/DRCD).
It is served as a Traditional Chinese QA model.


## Training Dataset
[Delta Reading Comprehension Dataset (DRCD)](https://github.com/DRCKnowledgeTeam/DRCD)  
The dataset's copyright belongs to 台達研究院(Delta Research Center)


## Model Information

<!-- Provide a longer summary of what this model is. -->

- **Developed by:** Chia-Wen Lu and [ckip lab](https://ckip.iis.sinica.edu.tw)
- **Model type:** mT5 (multilingual pre-trained text-to-text transformer)
- **Language (NLP):** Traditional Chinsese (zh)
- **Finetuned from model:** [google/mt5-base](https://huggingface.co/google/mt5-base)

## Usage
Here is the quick example to run inference.
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained('chiawen0104/mt5-drcd-qa')
model = AutoModelForSeq2SeqLM.from_pretrained('chiawen0104/mt5-drcd-qa')
input_text = "question: 新教的主教制度源自於哪一教?  context: 主教制源自天主教的主教制度"
input = tokenizer.encode(input_text, return_tensors="pt")
output = model.generate(input)
output_text = tokenizer.decode(output[0], skip_special_tokens=True)

print(output_text)
```
```
天主教
```