forked from BIDData/BIDMach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetdigits.sh
executable file
·35 lines (28 loc) · 1.01 KB
/
getdigits.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
#!/bin/bash
BIDMACH_SCRIPTS="${BASH_SOURCE[0]}"
if [ ! `uname` = "Darwin" ]; then
BIDMACH_SCRIPTS=`readlink -f "${BIDMACH_SCRIPTS}"`
export WGET='wget --no-check-certificate'
else
while [ -L "${BIDMACH_SCRIPTS}" ]; do
BIDMACH_SCRIPTS=`readlink "${BIDMACH_SCRIPTS}"`
done
export WGET='curl --retry 2 -O'
fi
export BIDMACH_SCRIPTS=`dirname "$BIDMACH_SCRIPTS"`
cd ${BIDMACH_SCRIPTS}
BIDMACH_SCRIPTS=`pwd`
BIDMACH_SCRIPTS="$( echo ${BIDMACH_SCRIPTS} | sed 's+/cygdrive/\([a-z]\)+\1:+' )"
echo "Loading arabic digits data"
UCI=${BIDMACH_SCRIPTS}/../data/uci
cd $UCI
if [ ! -e Train_Arabic_Digit.txt ]; then
${WGET} http://archive.ics.uci.edu/ml/machine-learning-databases/00195/Train_Arabic_Digit.txt
fi
sed -e 's/^[[:space:]]*$/0 0 0 0 0 0 0 0 0 0 0 0 0/g' Train_Arabic_Digit.txt > arabic.txt
cd ${UCI}
#${BIDMACH_SCRIPTS}/../bidmach "-e" "BIDMach.Experiments.DIGITS.preprocess(\"${UCI}/\",\"arabic\")"
${BIDMACH_SCRIPTS}/../bidmach ${BIDMACH_SCRIPTS}/getdigits.ssc
if [ -e "arabic.txt" ]; then
rm arabic.txt
fi