We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d5660d commit ea14c52Copy full SHA for ea14c52
1 file changed
src/sdialog/evaluation/dialog2flow/extract_trajectories.py
@@ -9,6 +9,7 @@
9
10
@author: Sergio Burdisso (sergio.burdisso@idiap.ch)
11
"""
12
+import re
13
import os
14
import json
15
import torch
@@ -368,7 +369,7 @@ def dialog2trajectories(
368
369
cluster_name = cluster_topk_utts[tid]["utterances"][0]
370
else:
371
cluster_name = cluster_topk_utts[tid]["name"]
- normalized_turn_names[speaker][tid] = {"name": f"{tid}_" + cluster_name,
372
+ normalized_turn_names[speaker][tid] = {"name": f"{tid}_" + re.sub(r"\s+", " ", cluster_name).strip(),
373
"info": cluster_topk_utts[tid],
374
"id": f"{speaker[0].lower()}{tid}"}
375
0 commit comments