Browse Source

[DATALAD] Recorded changes

Martin Frébourg 2 năm trước cách đây
mục cha
commit
a07ba0ebe9
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      code/compare.py

+ 3 - 3
code/compare.py

@@ -8,9 +8,9 @@ from pathlib import Path
 def compare_vandam(set1: str, set2: str) :
 
     speakers = ['CHI', 'OCH', 'FEM', 'MAL']
-    project = ChildProject('vandam-data')
+    project = ChildProject('inputs/vandam-data')
     am = AnnotationManager(project)
-    #am.read()
+    am.read()
 
     #get segments that intercept between two annotations
     intersection = AnnotationManager.intersection(am.annotations, [set1, set2])
@@ -55,7 +55,7 @@ def compare_vandam(set1: str, set2: str) :
     set1_segm = segments_to_grid(segments[segments['set'] == set1], 0, segments['segment_offset'].max(), 100, 'speaker_type', speakers)
     set2_segm = segments_to_grid(segments[segments['set'] == set2], 0, segments['segment_offset'].max(), 100, 'speaker_type', speakers)
     matrix_df = pd.DataFrame(conf_matrix(set1_segm, set2_segm))
-    matrix_df.to_csv("{0}/{1}-{2}-confusion-matrix.csv".format(dirName, set1.replace("/",""), set2.replace("/","")), mode = "x", index=False)
+    matrix_df.to_csv("{0}/{1}-{2}-confusion-matrix.csv".format(dirName, set1.replace("/",""), set2.replace("/","")), mode = "w", index=False)
     print("Confusion matrix saved for {0} and {1}!".format(set1, set2))
 
 compare_vandam('eaf', 'cha')