(self)
| 81 | return self.spk_map[self.item2spk[item_name]] |
| 82 | |
| 83 | def _phone_encoder(self): |
| 84 | ph_set_fn = f"{hparams['binary_data_dir']}/phone_set.json" |
| 85 | ph_set = [] |
| 86 | if hparams['reset_phone_dict'] or not os.path.exists(ph_set_fn): |
| 87 | for processed_data_dir in self.processed_data_dirs: |
| 88 | ph_set += [x.split(' ')[0] for x in open(f'{processed_data_dir}/dict.txt').readlines()] |
| 89 | ph_set = sorted(set(ph_set)) |
| 90 | json.dump(ph_set, open(ph_set_fn, 'w')) |
| 91 | else: |
| 92 | ph_set = json.load(open(ph_set_fn, 'r')) |
| 93 | print("| phone set: ", ph_set) |
| 94 | return build_phone_encoder(hparams['binary_data_dir']) |
| 95 | |
| 96 | def meta_data(self, prefix): |
| 97 | if prefix == 'valid': |
no test coverage detected