Skip to content

Commit

Permalink
updated simple classifier results after rerun
Browse files Browse the repository at this point in the history
  • Loading branch information
gicraveiro committed Feb 8, 2022
1 parent 1fa79ea commit 08f962f
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 33 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 24 additions & 24 deletions output/Simple Classifier/1labelPredictionsStats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ Performance measures

Train set:

Precision macro: 0.48
Precision Individually: [0.563 0.381 0.876 0.28 0.301]
Recall macro: 0.527
Recall Individually: [0.542 0.571 0.591 0.271 0.658]
F1 Score micro: 0.541
F1 Score macro: 0.481
F1 Score weighted: 0.565
F1 Score Individually: [0.552 0.457 0.706 0.275 0.413]
Precision macro: 0.477
Precision Individually: [0.563 0.381 0.857 0.28 0.301]
Recall macro: 0.518
Recall Individually: [0.542 0.571 0.55 0.271 0.658]
F1 Score micro: 0.52
F1 Score macro: 0.474
F1 Score weighted: 0.541
F1 Score Individually: [0.552 0.457 0.67 0.275 0.413]


Dev set:

Precision macro: 0.399
Precision Individually: [0.533 0. 0.88 0.25 0.333]
Recall macro: 0.441
Recall Individually: [0.615 0. 0.629 0.182 0.778]
F1 Score micro: 0.557
F1 Score macro: 0.396
F1 Score weighted: 0.566
F1 Score Individually: [0.571 0. 0.733 0.211 0.467]
Precision macro: 0.398
Precision Individually: [0.533 0. 0.875 0.25 0.333]
Recall macro: 0.439
Recall Individually: [0.615 0. 0.618 0.182 0.778]
F1 Score micro: 0.551
F1 Score macro: 0.395
F1 Score weighted: 0.559
F1 Score Individually: [0.571 0. 0.724 0.211 0.467]


Test set:

Precision macro: 0.424
Precision Individually: [0.6 0. 0.885 0.333 0.3 ]
Recall macro: 0.438
Recall Individually: [0.643 0. 0.676 0.273 0.6 ]
F1 Score micro: 0.586
F1 Score macro: 0.417
F1 Score weighted: 0.601
F1 Score Individually: [0.621 0. 0.767 0.3 0.4 ]
Precision macro: 0.421
Precision Individually: [0.6 0. 0.87 0.333 0.3 ]
Recall macro: 0.432
Recall Individually: [0.643 0. 0.645 0.273 0.6 ]
F1 Score micro: 0.567
F1 Score macro: 0.412
F1 Score weighted: 0.581
F1 Score Individually: [0.621 0. 0.741 0.3 0.4 ]


19 changes: 10 additions & 9 deletions simpleclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,28 @@ def simple_classifier(sents_ref_json):
test_pred_array = [sent['label'] for sent in test_pred_dict]
test_pred_first_label = [label[0] for label in test_pred_array]

labels=['Commit to privacy', 'Declare opinion about privacy','Not applicable','Related to privacy','Violate privacy']
# Confusion Matrixes

path='output/Simple Classifier/1Label_confusion_matrix_TrainNormTrue.png'
create_confusion_matrix(train_ref_primary_label, train_pred_first_label, "true", path, None, None)
create_confusion_matrix(train_ref_primary_label, train_pred_first_label, "true", path, labels, labels)
path='output/Simple Classifier/1Label_confusion_matrix_DevNormTrue.png'
create_confusion_matrix(dev_ref_primary_label, dev_pred_first_label, "true", path, None, None)
create_confusion_matrix(dev_ref_primary_label, dev_pred_first_label, "true", path, labels, labels)
path='output/Simple Classifier/1Label_confusion_matrix_TestNormTrue.png'
create_confusion_matrix(test_ref_primary_label, test_pred_first_label, "true", path, None, None)
create_confusion_matrix(test_ref_primary_label, test_pred_first_label, "true", path, labels, labels)
path='output/Simple Classifier/1Label_confusion_matrix_TrainNonNorm.png'
create_confusion_matrix(train_ref_primary_label, train_pred_first_label, None, path, None, None)
create_confusion_matrix(train_ref_primary_label, train_pred_first_label, None, path, labels, labels)
path='output/Simple Classifier/1Label_confusion_matrix_DevNonNorm.png'
create_confusion_matrix(dev_ref_primary_label, dev_pred_first_label, None, path, None, None)
create_confusion_matrix(dev_ref_primary_label, dev_pred_first_label, None, path, labels, labels)
path='output/Simple Classifier/1Label_confusion_matrix_TestNonNorm.png'
create_confusion_matrix(test_ref_primary_label, test_pred_first_label, None, path, None, None)
create_confusion_matrix(test_ref_primary_label, test_pred_first_label, None, path, labels, labels)

# Performance Measures

path='output/Simple Classifier/1labelPredictionsStats.txt'
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'w') as file:
print("Performance measures\n", file=file)
write_output_stats_file(path, "Train", train_ref_primary_label, train_pred_first_label)
write_output_stats_file(path, "Dev", dev_ref_primary_label, dev_pred_first_label)
write_output_stats_file(path, "Test", test_ref_primary_label, test_pred_first_label)
write_output_stats_file(path, "Train", train_ref_primary_label, train_pred_first_label, labels)
write_output_stats_file(path, "Dev", dev_ref_primary_label, dev_pred_first_label, labels)
write_output_stats_file(path, "Test", test_ref_primary_label, test_pred_first_label, labels)

0 comments on commit 08f962f

Please sign in to comment.