Commit 8d1b5fe4 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

clean

parents 7100adee 27c89a9a
......@@ -84,8 +84,8 @@ def create_bottomline_clustering(model, model_cfg, show, current_diar, file_path
model_cfg,
"reference")
print(f"cluster_{cluster} with {len(diar_per_cluster)} segs changed to "
f"{len(diar_per_cluster.unique('cluster'))} clusters")
#print(f"cluster_{cluster} with {len(diar_per_cluster)} segs changed to "
# f"{len(diar_per_cluster.unique('cluster'))} clusters")
# Creat a diarization with bottom line clustering
for seg in diar_per_cluster:
bottomline_diar.append(show=seg["show"],
......@@ -1051,7 +1051,7 @@ def run_active_learning_tree(link,
stop_clustering_list = [] # a list of nodes that have gotten confirmation for clustering question
der, new_diar = check_der(init_diar, bottomline_cluster_list, temporary_link_list, ref, uem)
print("Initial DER based on bottomline_diar and linkage : ", der)
#print("Initial DER based on bottomline_diar and linkage : ", der)
der_track_show = {"der_log": [der], "correction": ["initial"]}
......@@ -1117,7 +1117,7 @@ def run_active_learning_tree(link,
link_tmp = copy.deepcopy(temporary_link_list)
diar_tmp = copy.deepcopy(init_diar)
der, new_diar = check_der(diar_tmp, bottomline_cluster_list, link_tmp, ref, uem)
print(f"not_separation:", der)
#print(f"not_separation:", der)
der_track_show["der_log"].append(der)
der_track_show["correction"].append("not_separation")
separation_confirm += 1
......@@ -1210,7 +1210,7 @@ def run_active_learning_tree(link,
link_tmp = copy.deepcopy(temporary_link_list)
diar_tmp = copy.deepcopy(init_diar)
der, new_diar = check_der(diar_tmp, bottomline_cluster_list, link_tmp, ref, uem)
print("not_clustering :", der)
#print("not_clustering :", der)
der_track_show["der_log"].append(der)
der_track_show["correction"].append("not_clustering")
clustering_confirm += 1
......@@ -1297,17 +1297,21 @@ def allies_within_show_hal(model_cfg,
# check does bottomline_diar plus sub cluster linkage make current_diar #
hyp = s4d_to_allies(init_diar)
der_init, fa_rate, miss_rate, conf_rate, error, time, newspkmap = compute_der([ref], [hyp], [uem], collar = 0.250)
#print("DER of init_diar: ", der_init)
print("Current DER (original) : ", der_init)
#print("Current DER (original) : ", der_init)
hyp = s4d_to_allies(bottomline_diar)
der, fa_rate, miss_rate, conf_rate, error, time, newspkmap = compute_der([ref], [hyp], [uem], collar = 0.250)
print("DER of bottomline_diar: ", der)
#print("DER of bottomline_diar: ", der)
# import pdb
# pdb.set_trace()
vec_per_seg.modelset = vec_per_seg.modelset.astype(object)
#for idx in range(len(bottomline_diar)):
# vec_per_seg.modelset[idx] = bottomline_diar[idx]['cluster']
for idx in range(len(bottomline_diar)):
vec_per_seg.modelset[idx] = bottomline_diar[idx]['cluster']
if c2s != 'ideal':
......
......@@ -35,7 +35,8 @@ import sklearn.mixture
import s4d
from ..user_simulation import Reference
from ..der_single import compute_der
# from ..der_single import compute_der
from ..der import der_cross as compute_der
def allies_write_diar(current_diar, filename):
"""
......@@ -233,9 +234,12 @@ def check_der(bottomline_diar, bottomline_cluster_list, full_link, ref, uem):
full_link_tmp = copy.deepcopy(full_link)
current_diar = apply_link_on_diar(diar_tmp, cluster_list, full_link_tmp)
hyp = s4d_to_allies(current_diar)
der, fa_rate, miss_rate, conf_rate, time, newspkmap = compute_der(ref, hyp, uem, {}, 0.250)
der, fa_rate, miss_rate, conf_rate, error, time, newspkmap = compute_der([ref], [hyp], [uem], collar = 0.250)
# hyp = s4d_to_allies(current_diar)
# der, fa_rate, miss_rate, conf_rate, time, newspkmap = compute_der(ref, hyp, uem, {}, 0.250)
return der, current_diar
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment