-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_truePIE.sh
56 lines (49 loc) · 1.25 KB
/
run_truePIE.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#step0 word2vec
#step0 metaPAD
#step1 pattern embedding
#step2 self-training
#step2.1 truth discovery
#step2.2 train and predict
#step2.3 new positive patterns
#step2.4 go to step2.2
#step1 get pattern embedding
METAPAD='/input/pattern.txt'
EMBEDDING='/input/word_embedding.pickle' # or '/input/word_embedding.txt'
OUTPUT_PE='/input/feature/'
echo ===get pattern embedding===
if [ -d ${OUTPUT_PE} ];
then
echo ===pattern embedding done===
else
mkdir ${OUTPUT_PE}
echo ===running===
python gen_feature_vec.py ${METAPAD} ${EMBEDDING} ${OUTPUT_PE}
echo ===pattern embedding done===
fi
#step2 self-training
OUTPUT_IT='/output/initial_training'
OUTPUT_STEP='/output/intermediate'
OUTPUT_TEST='/output/result'
if [ -d ${OUTPUT_IT} ];
then
echo ===output directories exists===
else
echo ===create output directories===
mkdir ${OUTPUT_IT}
fi
if [ -d ${OUTPUT_STEP} ];
then
echo ===output directories exists===
else
echo ===create output directories===
mkdir ${OUTPUT_STEP}
fi
if [ -d ${OUTPUT_TEST} ];
then
echo ===output directories exists===
else
echo ===create output directories===
mkdir ${OUTPUT_TEST}
fi
python run_for_task.py ${METAPAD} ${OUTPUT_PE} ${OUTPUT_IT} ${OUTPUT_STEP} ${OUTPUT_TEST}