-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_pos.sh
executable file
·58 lines (39 loc) · 2.16 KB
/
get_pos.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
#!/bin/bash
PREPROCESSED_DATA_DIR="data/preprocessed"
CLEAN_TRAIN_DATA_PATH="$PREPROCESSED_DATA_DIR/train.csv"
TRAIN_LABELS_PATH="$PREPROCESSED_DATA_DIR/train_labels.csv"
CLEAN_DEV_DATA_PATH="$PREPROCESSED_DATA_DIR/dev.csv"
DEV_LABELS_PATH="$PREPROCESSED_DATA_DIR/dev_labels.csv"
CLEAN_TEST_DATA_PATH="$PREPROCESSED_DATA_DIR/test.csv"
TEST_LABELS_PATH="$PREPROCESSED_DATA_DIR/test_labels.csv"
#######################################################################
# TRAIN #
#######################################################################
echo "Getting POS tags for $CLEAN_TRAIN_DATA_PATH with TwiboParser"
# this script will generate the file $CLEAN_TRAIN_DATA_PATH.tagged.pre
./utils/run_postagger.sh $CLEAN_TRAIN_DATA_PATH
cat $CLEAN_TRAIN_DATA_PATH.tagged.pre | ./utils/postprocess_postag_file.py > $CLEAN_TRAIN_DATA_PATH.tagged
rm $CLEAN_TRAIN_DATA_PATH.tagged.pre
# this script will generate two files:
# - $CLEAN_TRAIN_DATA_PATH.tagged.tokens
# - $CLEAN_TRAIN_DATA_PATH.tagged.pos
./utils/parse_twibo_output.py $CLEAN_TRAIN_DATA_PATH.tagged
echo
#######################################################################
# DEV #
#######################################################################
echo "Getting POS tags for $CLEAN_DEV_DATA_PATH with TwiboParser"
./utils/run_postagger.sh $CLEAN_DEV_DATA_PATH
cat $CLEAN_DEV_DATA_PATH.tagged.pre | ./utils/postprocess_postag_file.py > $CLEAN_DEV_DATA_PATH.tagged
rm $CLEAN_DEV_DATA_PATH.tagged.pre
python ./utils/parse_twibo_output.py $CLEAN_DEV_DATA_PATH.tagged
echo
#######################################################################
# TEST #
#######################################################################
echo "Getting POS tags for $CLEAN_TEST_DATA_PATH with TwiboParser"
./utils/run_postagger.sh $CLEAN_TEST_DATA_PATH
cat $CLEAN_TEST_DATA_PATH.tagged.pre | ./utils/postprocess_postag_file.py > $CLEAN_TEST_DATA_PATH.tagged
rm $CLEAN_TEST_DATA_PATH.tagged.pre
./utils/parse_twibo_output.py $CLEAN_TEST_DATA_PATH.tagged
echo