transformers pytorch bert question-answering zh endpoints_compatible region:us
---
language:
- zh
---
# Question Answering
This is a assignment of Applied Deep Learning which is a course of National Taiwan University(NTU).
### Task Description：Chinese Extractive Question Answering (QA)
Determine the start and end position of the answer span.

input(question)：
```
在關西鎮以什麼方言為主？
```
input(text)
```
新竹縣是中華民國臺灣省的縣，位於臺灣本島西北部，北臨桃園市，南接苗栗縣，東南以雪山山脈與宜蘭縣、臺中市相連，西部面向台灣海峽，西接與新竹市交界。全縣總面積約1,427平方公里，除鳳山溪、頭前溪中下游沖積平原外，其餘大多為丘陵、台地及山地。早期新竹縣郊區多務農，1970年代工業技術研究院創設於新竹市，1980年代新竹科學工業園區設立於新竹市東區及新竹縣寶山鄉，1990年代位於湖口鄉的新竹工業區也逐漸從傳統產業聚落轉型為新興高科技產業聚落，使得新竹縣成為北台灣的高科技產業重鎮，而人口也在近幾年急速增加。本縣方言於絕大部分地區使用海陸客家話，竹北市及新豐鄉沿海地區部分使用泉州腔閩南話較多，關西鎮及峨眉鄉部分使用四縣腔客家話為主。
```
output(answer)：
```
四縣腔客家話
```
### Objective
- Fine-tune some pre-trained model：[bert-base-chinese](https://huggingface.co/bert-base-chinese), [hfl/chinese-roberta-wwm-ext](https://huggingface.co/hfl/chinese-roberta-wwm-ext) to pass the baseline.

  ```
  Baseline：accuracy score > 0.79
  ```
### Experiments
Compare between BERT-base and RoBERTa.  
The models bert-base-chinese and hf1/Chinese-roberta-wwm-ext are built on the BERT and RoBERTa architectures, respectively.  
Notably, hf1/Chinese-roberta-wwm-ext is based on the RoBERTa framework and boasts a larger model size, with 355 million parameters, in contrast to the 110 million parameters of bert-base-chinese.  
During training, hf1/Chinese-roberta-wwm-ext-large utilized a more extensive and diverse set of articles, including web pages, news articles, and social media content.  