-
Notifications
You must be signed in to change notification settings - Fork 6
/
preprocess.sh
39 lines (31 loc) · 1.34 KB
/
preprocess.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# golden paragraphs
WORK_DIR=./hotpot/data_processed
export INPUT_FILE=$1
export OUTPUT_DIR=$2
mkdir ${WORK_DIR}/${OUTPUT_DIR}
python paragraph_selection/select_paras_QG.py \
--input_path=${INPUT_FILE} \
--output_path=${WORK_DIR}/${OUTPUT_DIR}/selected_paras_QG.json \
--ckpt_path=work_dir/para_select_model.bin \
--split=${OUTPUT_DIR}
python bert_ner/predict_QG.py \
--ckpt_path=work_dir/bert_ner.pt \
--input_path=${WORK_DIR}/${OUTPUT_DIR}/selected_paras_QG.json \
--output_path=${WORK_DIR}/${OUTPUT_DIR}/entities.json
python bert_ner/predict_QG.py \
--use_answer \
--ckpt_path=work_dir/bert_ner.pt \
--input_path=${INPUT_FILE} \
--output_path=${WORK_DIR}/${OUTPUT_DIR}/answer_entities.json
python -m GPG.data.feature \
--full_data=${INPUT_FILE} \
--entity_path=${WORK_DIR}/${OUTPUT_DIR}/entities.json \
--para_path=${WORK_DIR}/${OUTPUT_DIR}/selected_paras_QG.json \
--example_output=${WORK_DIR}/${OUTPUT_DIR}/examples.pkl.gz \
--feature_output=${WORK_DIR}/${OUTPUT_DIR}/features.pkl.gz
python -m GPG.data.create_graph \
--example_path=${WORK_DIR}/${OUTPUT_DIR}/examples.pkl.gz \
--feature_path=${WORK_DIR}/${OUTPUT_DIR}/features.pkl.gz \
--graph_path=${WORK_DIR}/${OUTPUT_DIR}/graph.pkl.gz \
--query_entity_path=${WORK_DIR}/${OUTPUT_DIR}/answer_entities.json