2024-06-03 10:03:28 +02:00
#! /bin/bash
pushd zad/24/2
2024-06-03 11:12:29 +02:00
IFS = $'\n'
echo "Naprawianie błędnych plików:"
for d in $( wc -l */out.tsv | grep -v $( cat ~/sport-text-classification-ball-dont-peek/test-A/expected.tsv | wc -l) | grep -v $( cat ~/sport-text-classification-ball-dont-peek/dev-0/expected.tsv | wc -l) | grep -v total | sed 's/^[0-9 ]\+//' | sed 's|/[a-z]\+.tsv$||' | sort -u)
do
mv $d /out.tsv $d /out.tsv.bak
tail -n $( cat ~/sport-text-classification-ball-dont-peek/test-A/expected.tsv | wc -l) $d /out.tsv.bak >$d /out.tsv
2024-06-03 11:27:27 +02:00
# cat $d/out.tsv.bak <(echo 0) <(echo 0) >$d/out.tsv
2024-06-03 11:12:29 +02:00
wc -l $d /out.tsv
done
echo
2024-06-03 10:03:28 +02:00
echo "Wyniki dla test-A:"
2024-06-03 11:12:29 +02:00
for d in $( wc -l */out.tsv | grep $( cat ~/sport-text-classification-ball-dont-peek/test-A/expected.tsv | wc -l) | sed 's/^[0-9 ]\+//' | sed 's|/[a-z]\+.tsv$||' | sort -u)
2024-06-03 10:03:28 +02:00
do
2024-06-03 11:12:29 +02:00
cp ~/sport-text-classification-ball-dont-peek/test-A/expected.tsv $d /
2024-06-03 11:27:27 +02:00
geval -t $d | python3 -c "import sys, math; x=sys.stdin.read().strip(); print('test-A accuracy:', x, '\t', math.ceil(float(x) * 7.0), end='\t')"
2024-06-03 10:03:28 +02:00
echo $d | sed 's/_[0-9]\+_assignsubmission_file_$/\t/'
done
echo
echo "Wyniki dla dev-0:"
2024-06-03 11:12:29 +02:00
for d in $( wc -l */out.tsv | grep $( cat ~/sport-text-classification-ball-dont-peek/dev-0/expected.tsv | wc -l) | sed 's/^[0-9 ]\+//' | sed 's|/[a-z]\+.tsv$||' | sort -u)
2024-06-03 10:03:28 +02:00
do
2024-06-03 11:12:29 +02:00
cp ~/sport-text-classification-ball-dont-peek/dev-0/expected.tsv $d /
2024-06-03 11:27:27 +02:00
geval -t $d | python3 -c "import sys, math; x=sys.stdin.read().strip(); print('dev-0 accuracy:', x, '\t', math.ceil(float(x) * 7.0), end='\t')"
2024-06-03 10:03:28 +02:00
echo $d | sed 's/_[0-9]\+_assignsubmission_file_$/\t/'
done
popd