-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript-experiments.sh
executable file
·125 lines (103 loc) · 3.68 KB
/
script-experiments.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env bash
set -e
BASE_DIR=$([ "$1" = "" ] && echo "$HOME/data" || echo "$1" )
DATA_DIR=${BASE_DIR}/toxicity/semeval2019
TRAIN_DIR=${DATA_DIR}/training
TEST_DIR=${DATA_DIR}/test
OUTPUT_DIR=${DATA_DIR}/results
mkdir -p $OUTPUT_DIR
# classification models evaluation for TASK A
python -m toxicitydetector.task \
--train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
--test-path=${TEST_DIR}/testset-taska.tsv \
--embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
--output-file=${OUTPUT_DIR}/predictions_taska.csv \
--labels=subtask_a \
--text-field=tweet \
--field-sep="\t" \
--kfolds=10 \
--model=lr,fasttext,cnn,lstm,bilstm
# TODO: evaluate additional tasks: TASK B,C
#python -m toxicitydetector.task \
# --train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
# --test-path=${TEST_DIR}/testset-taskb.tsv \
# --embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
# --output-file=../results/task_b_validation.csv \
# --labels=subtask_b \
# --text-field=tweet \
# --model=cnn \
# --kfolds=10
#python -m toxicitydetector.task \
# --train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
# --test-path=${TEST_DIR}/testset-taskc.tsv \
# --embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
# --output-file=../results/task_c_validation.csv \
# --labels=subtask_c \
# --text-field=tweet \
# --model=cnn \
# --kfolds=10
# embeddings evaluation
python -m toxicitydetector.task \
--train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
--test-path=${TEST_DIR}/testset-taska.tsv \
--output-file=${OUTPUT_DIR}/predictions_embeddings_random.csv \
--labels=subtask_a \
--text-field=tweet \
--field-sep="\t" \
--kfolds=10 \
--model=cnn
python -m toxicitydetector.task \
--train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
--test-path=${TEST_DIR}/testset-taska.tsv \
--embeddings-path=${TRAIN_DIR}/w2v.vec \
--output-file=${OUTPUT_DIR}/predictions_embeddings_word2vec.csv \
--labels=subtask_a \
--text-field=tweet \
--field-sep="\t" \
--kfolds=10 \
--model=cnn
python -m toxicitydetector.task \
--train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
--test-path=${TEST_DIR}/testset-taska.tsv \
--embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
--output-file=${OUTPUT_DIR}/predictions_embeddings_fasttext.csv \
--labels=subtask_a \
--text-field=tweet \
--field-sep="\t" \
--kfolds=10 \
--model=cnn
# TODO: evalute Glove embeddings
#python -m toxicitydetector.task \
# --train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
# --test-path=${TEST_DIR}/testset-taska.tsv \
# --embeddings-path=${TRAIN_DIR}/glove.twitter.27B.200d.txt \
# --embeddings-size=200 \
# --no-embeddings-header \
# --output-file=${OUTPUT_DIR}/predictions_embeddings.csv \
# --labels=subtask_a \
# --text-field=tweet \
# --kfolds=10 \
# --model=cnn
#-----------------------------------------------------------
# TODO: evaluate with preprocessing of the tweets
#python -m toxicitydetector.task \
# --train-path=${TRAIN_DIR}/offenseval_preprocessed.tsv \
# --test-path=${TEST_DIR}/testset_taska_preprocessed.tsv \
# --embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
# --labels=subtask_a \
# --text-field=tweet \
# --kfolds=10 \
# --model=cnn
#
## prediction with best preprocessing / model
#
#python -m toxicitydetector.task \
# --train-path=${TRAIN_DIR}/offenseval-training-v1.tsv \
# --test-path=${TEST_DIR}/testset-taska.tsv \
# --embeddings-path=${TRAIN_DIR}/crawl-300d-2M.vec \
# --output-file=../results/predictions_cnn.csv \
# --labels=subtask_a \
# --text-field=tweet \
# --model=cnn \
# --kfolds=10 \
# --predict