-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable3-5.sh
More file actions
144 lines (121 loc) · 4.8 KB
/
Copy pathtable3-5.sh
File metadata and controls
144 lines (121 loc) · 4.8 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Human annotation tables: metric-vs-human agreement (Round I/II)
# Display human annotation files and evaluation results
set -e
echo "=========================================="
echo "Table 2: Human Annotation Study results "
echo "=========================================="
echo ""
# Switch to scripts directory
cd scripts
# Sample data file list (questions)
SAMPLE_FILES=(
"sample_50_aed_unomal.json"
"sample_50_ccr_unomal.json"
"sample_50_atct_unomal.json"
"sample_50_atcl_unomal.json"
"sample_50_aed.json"
"sample_50_ccr.json"
"sample_50_atct.json"
"sample_50_atcl.json"
)
# Human annotation file list
LABEL_FILES=(
"sample_50_labels_aed_annotator2.json"
"sample_50_labels_aed_annotator1.json"
"sample_50_labels_aed_origin.json"
"sample_50_labels_aed_unormal_annotator2.json"
"sample_50_labels_aed_unormal_annotator1.json"
"sample_50_labels_aed_unormal_origin.json"
"sample_50_labels_ccr_origin.json"
"sample_50_labels_ccr_annotator2.json"
"sample_50_labels_ccr_annotator1.json"
"sample_50_labels_ccr_unormal_annotator2.json"
"sample_50_labels_ccr_unormal_annotator1.json"
"sample_50_labels_ccr_unormal_origin.json"
"sample_50_labels_atcl_annotator2.json"
"sample_50_labels_atcl_annotator1.json"
"sample_50_labels_atcl_origin.json"
"sample_50_labels_atcl_unormal_annotator2.json"
"sample_50_labels_atcl_unormal_annotator1.json"
"sample_50_labels_atcl_unormal_origin.json"
"sample_50_labels_atct_annotator2.json"
"sample_50_labels_atct_annotator1.json"
"sample_50_labels_atct_origin.json"
"sample_50_labels_atct_unormal_annotator2.json"
"sample_50_labels_atct_unormal_annotator1.json"
"sample_50_labels_atct_unormal_origin.json"
)
# Evaluation result file list
EVAL_FILES=(
"sample_50_labels_aed_annotator2.json.eval.json"
"sample_50_labels_aed_annotator1.json.eval.json"
"sample_50_labels_aed_origin.json.eval.json"
"sample_50_labels_aed_unormal_annotator2.json.eval.json"
"sample_50_labels_aed_unormal_annotator1.json.eval.json"
"sample_50_labels_aed_unormal_origin.json.eval.json"
"sample_50_labels_ccr_annotator2.json.eval.json"
"sample_50_labels_ccr_annotator1.json.eval.json"
"sample_50_labels_ccr_origin.json.eval.json"
"sample_50_labels_ccr_unormal_annotator2.json.eval.json"
"sample_50_labels_ccr_unormal_annotator1.json.eval.json"
"sample_50_labels_ccr_unormal_origin.json.eval.json"
"sample_50_labels_atcl_annotator2.json.eval.json"
"sample_50_labels_atcl_annotator1.json.eval.json"
"sample_50_labels_atcl_origin.json.eval.json"
"sample_50_labels_atcl_unormal_annotator2.json.eval.json"
"sample_50_labels_atcl_unormal_annotator1.json.eval.json"
"sample_50_labels_atcl_unormal_origin.json.eval.json"
"sample_50_labels_atct_annotator2.json.eval.json"
"sample_50_labels_atct_annotator1.json.eval.json"
"sample_50_labels_atct_origin.json.eval.json
"sample_50_labels_atct_unormal_annotator2.json.eval.json"
"sample_50_labels_atct_unormal_annotator1.json.eval.json"
"sample_50_labels_atct_unormal_origin.json.eval.json"
)
# Display sample data statistics (questions)
echo "----------------------------------------"
echo "Sample Data Statistics (Questions)"
echo "----------------------------------------"
for FILE in "${SAMPLE_FILES[@]}"; do
if [ -f "$FILE" ]; then
COUNT=$(python -c "import json; print(len(json.load(open('$FILE', 'r', encoding='utf-8'))))" 2>/dev/null || echo "0")
echo "$FILE: $COUNT samples"
fi
done
echo ""
# Display human annotation statistics
echo "----------------------------------------"
echo "Human Annotation Statistics"
echo "----------------------------------------"
echo ""
# Display evaluation results
echo "----------------------------------------"
echo "Evaluation Results (Human vs Automatic Annotation Consistency)"
echo "----------------------------------------"
for FILE in "${EVAL_FILES[@]}"; do
if [ -f "$FILE" ]; then
echo ""
echo "File: $FILE"
python -c "
import json
import sys
try:
with open('$FILE', 'r', encoding='utf-8') as f:
data = json.load(f)
print(f\" Metric: {data.get('metric_field', 'N/A')}\")
print(f\" Used samples: {data.get('used', 0)}\")
print(f\" TP: {data.get('tp', 0)}, FP: {data.get('fp', 0)}, TN: {data.get('tn', 0)}, FN: {data.get('fn', 0)}\")
print(f\" Accuracy: {data.get('accuracy', 0):.4f}\")
print(f\" Precision: {data.get('precision', 0):.4f}\")
print(f\" Recall: {data.get('recall', 0):.4f}\")
print(f\" F1: {data.get('f1', 0):.4f}\")
except Exception as e:
print(f\" Error reading $FILE: {e}\")
"
fi
done
echo ""
echo "=========================================="
echo "✅ Human annotation results displayed!"
echo "=========================================="