phone.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:tensorflow_end2end_speech_recognition 作者: hirofumi0810 项目源码 文件源码
def __call__(self, index_list, padded_value=-1):
        """
        Args:
            index_list (list): phone indices
            padded_value (int): the value used for padding
        Returns:
            str_phone (string): a sequence of phones
        """
        # Remove padded values
        assert type(index_list) == np.ndarray, 'index_list should be np.ndarray.'
        index_list = np.delete(index_list, np.where(index_list == -1), axis=0)

        # Convert from indices to the corresponding phones
        phone_list = list(map(lambda x: self.map_dict[x], index_list))
        str_phone = ' '.join(phone_list)

        return str_phone
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号