From 47343b5c2f4e1256f60f46d8da0aa2e5de39b6c7 Mon Sep 17 00:00:00 2001
From: 嘉渊 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期六, 05 八月 2023 17:53:08 +0800
Subject: [PATCH] init repo
---
egs/callhome/eend_ola/local/split.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/egs/callhome/eend_ola/local/split.py b/egs/callhome/eend_ola/local/split.py
index 6f313cc..7ad1bad 100644
--- a/egs/callhome/eend_ola/local/split.py
+++ b/egs/callhome/eend_ola/local/split.py
@@ -11,14 +11,14 @@
scp_files = os.listdir(work_path)
reco2dur_dict = {}
- with open(root_path + 'reco2dur') as f:
+ with open(os.path.join(root_path, 'reco2dur')) as f:
lines = f.readlines()
for line in lines:
parts = line.strip().split()
reco2dur_dict[parts[0]] = parts[1]
spk2utt_dict = {}
- with open(root_path + 'spk2utt') as f:
+ with open(os.path.join(root_path, 'spk2utt')) as f:
lines = f.readlines()
for line in lines:
parts = line.strip().split()
@@ -34,7 +34,7 @@
spk2utt_dict[rec].append((spk, utt))
segment_dict = {}
- with open(root_path + 'segments') as f:
+ with open(os.path.join(root_path, 'segments')) as f:
lines = f.readlines()
for line in lines:
parts = line.strip().split()
@@ -45,7 +45,7 @@
segment_dict[parts[1]].append((parts[0], parts[2], parts[3]))
utt2spk_dict = {}
- with open(root_path + 'utt2spk') as f:
+ with open(os.path.join(root_path, 'utt2spk')) as f:
lines = f.readlines()
for line in lines:
parts = line.strip().split()
@@ -59,12 +59,12 @@
utt2spk_dict[rec].append((parts[0], parts[1]))
for file in scp_files:
- scp_file = work_path + file
- idx = scp_file.split('.')[-2]
- reco2dur_file = work_path + 'reco2dur.' + idx
- spk2utt_file = work_path + 'spk2utt.' + idx
- segment_file = work_path + 'segments.' + idx
- utt2spk_file = work_path + 'utt2spk.' + idx
+ scp_file = os.path.join(work_path, file)
+ idx = scp_file.split('.')[-1]
+ reco2dur_file = os.path.join(work_path, 'reco2dur.{}'.format(str(idx)))
+ spk2utt_file = os.path.join(work_path, 'spk2utt.{}'.format(str(idx)))
+ segment_file = os.path.join(work_path, 'segments.{}'.format(str(idx)))
+ utt2spk_file = os.path.join(work_path, 'utt2spk.{}'.format(str(idx)))
fpp = open(scp_file)
scp_lines = fpp.readlines()
--
Gitblit v1.9.1