/
topicrank.sh
93 lines (86 loc) · 2.97 KB
/
topicrank.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
#!/usr/bin/env sh
# -*- encoding: utf-8 -*-
ROOT_DIR=$(dirname $0)
options=""
corpus=""
language=""
if [ $# -gt 1 ]
then
while [ $# -gt 2 ]
do
key="$1"
case $key in
-n|--run-name)
options="${options} -n $2 "
shift
shift
;;
-r|--reference)
options="${options} -r $2 "
shift
shift
;;
-o|--output-dir)
options="${options} -o $2 "
shift
shift
;;
-p|--processus-number)
options="${options} -p $2 "
shift
shift
;;
*)
shift
;;
esac
done
if [ $# -eq 2 ]
then
corpus="$1"
language="$2"
python ${ROOT_DIR}/KeyBench/src/launcher.py ${options% } TopicRank ${corpus} ${language}
else
echo "missing positional argument..."
echo ""
echo "usage: sh $0 [options] corpus language"
echo ""
echo "positional arguments:"
echo " corpus path to the .txt files to process"
echo " language language of the corpus files (french or english)"
echo ""
echo "optional arguments:"
echo " -h, --help show this help message and exit"
echo " -n RUN_NAME, --run-name RUN_NAME"
echo " name of the run (for identification within the output"
echo " directory)"
echo " -r REFERENCE_FILEPATH, --reference REFERENCE_FILEPATH"
echo " path to the file containing the references (for"
echo " evaluation only)"
echo " -o OUTPUT_DIR, --output-dir OUTPUT_DIR"
echo " path to the directory where processings must be stored"
echo " (default=results)"
echo " -p PROCESSUS_NUMBER, --processus-number PROCESSUS_NUMBER"
echo " number of documents to process simultaneously"
fi
else
echo "usage: sh $0 [options] corpus language"
echo ""
echo "positional arguments:"
echo " corpus path to the .txt files to process"
echo " language language of the corpus files (french or english)"
echo ""
echo "optional arguments:"
echo " -h, --help show this help message and exit"
echo " -n RUN_NAME, --run-name RUN_NAME"
echo " name of the run (for identification within the output"
echo " directory)"
echo " -r REFERENCE_FILEPATH, --reference REFERENCE_FILEPATH"
echo " path to the file containing the references (for"
echo " evaluation only)"
echo " -o OUTPUT_DIR, --output-dir OUTPUT_DIR"
echo " path to the directory where processings must be stored"
echo " (default=results)"
echo " -p PROCESSUS_NUMBER, --processus-number PROCESSUS_NUMBER"
echo " number of documents to process simultaneously"
fi