-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_dblp_noise.sh
More file actions
71 lines (61 loc) · 1.96 KB
/
run_dblp_noise.sh
File metadata and controls
71 lines (61 loc) · 1.96 KB
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
if [[ -z "$INPUT" ]]; then
INPUT=/shared/data/tensor_embedding/data/dblp/frequent_year
fi
if [[ -z "$OUTPUT" ]]; then
OUTPUT=results/dblp_noise
fi
# SCORING_FUNCTION=2
if [[ "$SCORING_FUNCTION" -eq "1" ]]; then
BETA="0 0 0 0 0"
VALID=10111
else
BETA="0.05 0.05 0.05 0.05 0.05"
VALID=11111
fi
if [[ -z "$DIM" ]]; then
DIM=300
fi
ITER=1500
TENSOR_THREAD=5
WORD2VEC_THREAD=0
LOAD=00000
CHOOSE_TO_OUTPUT=00111
ALPHA=0.05
preprocess() {
make -s
if [ ! -e $INPUT/words_edges.txt ]; then
python preprocess/prepare_word2vec.py -input $INPUT
chmod a+rwx $INPUT/words_edges.txt
fi
mkdir -p $OUTPUT
}
evaluate () {
THREAD=5
python evaluation/transform_format.py -emb $OUTPUT/author_embedding.txt -label $1 -output $OUTPUT/data_tensor_norm.txt -norm 1
echo "logistic regression (normalization):"
evaluation/liblinear/train -q -s 0 -v 5 -n $THREAD $OUTPUT/data_tensor_norm.txt
echo "linear svm (normalization):"
evaluation/liblinear/train -q -s 2 -v 5 -n $THREAD $OUTPUT/data_tensor_norm.txt
python evaluation/ranking.py -input $OUTPUT/data_tensor_norm.txt
python evaluation/transform_format.py -emb $OUTPUT/author_embedding.txt -label $1 -output $OUTPUT/data_tensor.txt -norm 0
echo "logistic regression (no normalization):"
evaluation/liblinear/train -q -s 0 -v 5 -n $THREAD $OUTPUT/data_tensor.txt
echo "linear svm (no normalization):"
evaluation/liblinear/train -q -s 2 -v 5 -n $THREAD $OUTPUT/data_tensor.txt
python evaluation/ranking.py -input $OUTPUT/data_tensor.txt
}
run () {
preprocess
time ./tensor2vec -type 5 -name term paper author venue year \
-tthread $TENSOR_THREAD -wthread $WORD2VEC_THREAD \
-input $INPUT -output $OUTPUT \
-choose $CHOOSE_TO_OUTPUT -valid $VALID -iter $ITER -beta $BETA \
-scoring $SCORING_FUNCTION -load $LOAD -size $DIM -negative 5 -alpha $ALPHA
echo === evaluating 4 research group labels ===
evaluate $INPUT/label-group.txt
echo
echo === evaluating 4 research area labels ===
evaluate $INPUT/label-area.txt
echo
}
run