Commit 27c89a9a authored by Meysam Shamsi's avatar Meysam Shamsi
Browse files

match compute der version

parent 6a0211ff
......@@ -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,6 +1051,8 @@ 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("DER after merging bottomline and linkage matrix: ", der)
der_track_show = {"der_log": [der], "correction": ["initial"]}
for node in links_to_check:
......@@ -1295,14 +1297,18 @@ 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)
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)
# 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