forked from OpenNMT/OpenNMT-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_vocab.sh
102 lines (79 loc) · 4.41 KB
/
run_vocab.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env bash
dataset="small"
############################# Root envs ############################
RootPath=$(pwd)
ProjectPath=${RootPath}/examples/learning_fix
ConfigPath=${ProjectPath}/config/${dataset}; [ -d "$ConfigPath" ] || mkdir -p "$ConfigPath"
BinPath=${ProjectPath}/bin; [ -d "$BinPath" ] || mkdir -p "$BinPath"
LogPath=${ProjectPath}/logs; [ -d "$LogPath" ] || mkdir -p "$LogPath"
DataPath=${ProjectPath}/data; [ -d "$DataPath" ] || mkdir -p "$DataPath"
CurrentDate=$(date +%F)
prefix="vocabulary"
# Log file
LogFile=${LogPath}/${CurrentDate}-${prefix}.log
function logInfo() {
echo "[$(date +"%F %T,%3N") INFO] $1" | tee -a "${LogFile}"
}
export JAVA_OPTS="-Xmx32G -Xms1g -Xss512M -Dlog4j.configuration=file:///${ConfigPath}/log4j.properties"
logInfo "------------------------- small -----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/small/raw/buggy/" \
-fixed_path "examples/learning_fix/data/small/raw/fixed/" \
-top_k 10000 \
-is_abstract false | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- small new abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/small/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/small/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- small old abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/small_old/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/small_old/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n\n" | tee -a "${LogFile}"
logInfo "------------------------- median -----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/median/raw/buggy/" \
-fixed_path "examples/learning_fix/data/median/raw/fixed/" \
-top_k 10000 \
-is_abstract false | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- median new abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/median/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/median/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- median old abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/median_old/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/median_old/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n\n" | tee -a "${LogFile}"
logInfo "------------------------- big src -----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/big/raw/buggy-src-total.txt" \
-fixed_path "examples/learning_fix/data/big/raw/fixed-src-total.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- big new abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/big/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/big/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"
printf "\n" | tee -a "${LogFile}"
logInfo "------------------------- big old abstraction-----------------------------"
scala "${BinPath}"/code2abs-1.0-jar-with-dependencies.jar -run_type "vocabulary" \
-buggy_path "examples/learning_fix/data/big_old/total/buggy.txt" \
-fixed_path "examples/learning_fix/data/big_old/total/fixed.txt" \
-top_k 10000 \
-is_abstract true | tee -a "${LogFile}"