Commit ·
88911af
1
Parent(s): d6a13a2
Upload readme.md
Browse files
readme.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**Reproduce my result**
|
| 2 |
+
##**Environment**
|
| 3 |
+
```
|
| 4 |
+
pip install -r requirements.txt
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
##**Download**
|
| 8 |
+
Download training, validation, testing data, as well as multiple choice model and question answering model.
|
| 9 |
+
```
|
| 10 |
+
bash ./download.sh
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
##**Multiple Choice**
|
| 14 |
+
```
|
| 15 |
+
python run_multiple_choice.py \
|
| 16 |
+
--context_data <context.json> \
|
| 17 |
+
--train_data <train.json> \
|
| 18 |
+
--valid_data <valid.json> \
|
| 19 |
+
--test_data <test.json> \
|
| 20 |
+
--max_seq_length 512 \
|
| 21 |
+
--gradient_accumulation_steps 8 \
|
| 22 |
+
--model_name_or_path bert-base-chinese \
|
| 23 |
+
--learning_rate 2e-5 \
|
| 24 |
+
--output_dir <output directory> \
|
| 25 |
+
--per_device_train_batch_size 8
|
| 26 |
+
```
|
| 27 |
+
-**model_name_or_path**: Path to pretrained model.
|
| 28 |
+
|
| 29 |
+
-**output_dir**: Path to directory which saves the model outputs.
|
| 30 |
+
|
| 31 |
+
-**context_data**: Path to context.json.
|
| 32 |
+
|
| 33 |
+
-**train_data**: Path to train.json.
|
| 34 |
+
|
| 35 |
+
-**valid_data**: Path to valid.json.
|
| 36 |
+
|
| 37 |
+
-**test_data**: Path to test.json.
|
| 38 |
+
|
| 39 |
+
##**Question Answering**
|
| 40 |
+
```
|
| 41 |
+
python run_question_answering.py \
|
| 42 |
+
--context_data <context.json> \
|
| 43 |
+
--train_data <train.json> \
|
| 44 |
+
--valid_data <valid.json> \
|
| 45 |
+
--test_data <test.json> \
|
| 46 |
+
--max_seq_length 512 \
|
| 47 |
+
--gradient_accumulation_steps 8 \
|
| 48 |
+
--model_name_or_path hfl/chinese-roberta-wwm-ext-large \
|
| 49 |
+
--learning_rate 2e-5 \
|
| 50 |
+
--output_dir <output directory> \
|
| 51 |
+
--per_device_train_batch_size 8
|
| 52 |
+
```
|
| 53 |
+
-**model_name_or_path**: Path to pretrained model.
|
| 54 |
+
|
| 55 |
+
-**output_dir**: Path to directory which saves the model outputs.
|
| 56 |
+
|
| 57 |
+
-**context_data**: Path to context.json.
|
| 58 |
+
|
| 59 |
+
-**train_data**: Path to train.json.
|
| 60 |
+
|
| 61 |
+
-**valid_data**: Path to valid.json.
|
| 62 |
+
|
| 63 |
+
-**test_data**: Path to test.json.
|
| 64 |
+
|
| 65 |
+
##**Reproduce my result**
|
| 66 |
+
```
|
| 67 |
+
bash ./download.sh
|
| 68 |
+
bash ./run.sh /path/to/context.json /path/to/test.json /path/to/pred/prediction.csv
|
| 69 |
+
```
|