Skip to content

Instantly share code, notes, and snippets.

@acetylSv
acetylSv / preprocess.py
Created April 21, 2019 07:12
Script for preprocessing, take spk p251 vs p299 for example.
import os, sys
import numpy as np
import h5py
from collections import defaultdict
from hyperparams import Hyperparams as hp
from utils import *
h5py_path = sys.argv[1]
dataset_path = sys.argv[2]
@acetylSv
acetylSv / auto_seg_by_sil.sh
Created April 4, 2019 13:48
silence segmentation using auditok
for var in $@
do
# for auditok to process a file
# -e : energy threshlod
# -d : discard silence period
# -s : min-length of a continuos silence
# -n : min-length of a segment
# -m : max-length of a segment
# -M : only process the first M seconds of the file
echo "processing file : $var"
@acetylSv
acetylSv / location_aware_attn.py
Created March 18, 2019 11:25
Location aware attention (pytorch implementation of https://arxiv.org/pdf/1506.07503.pdf)
import torch
import torch.nn as nn
class LocAwareAttnLayer(nn.Module):
'''
implementation of: https://arxiv.org/pdf/1506.07503.pdf
'''
def __init__(self, dec_hidden_dim, enc_feat_dim, conv_dim, attn_dim, smoothing=False):
super(LocAwareAttnLayer, self).__init__()
self.attn_dim = attn_dim
@acetylSv
acetylSv / CMU_lexicon.sh
Last active February 25, 2019 16:24
a script to call CMU_lexicon API
#/bin/sh
DIR='./txt_parts'
for filename in $DIR/*
do
echo ${filename}
curl -X POST -F "wordfile=@${filename}" \
-H "ContentType=multipart/form-data" http://www.speech.cs.cmu.edu/cgi-bin/tools/logios/lextool.pl \
-o ${filename}_res.txt
@acetylSv
acetylSv / download.sh
Created May 8, 2018 08:22
a script to download Blizzard2013 datasets
# For downloading The English audiobook data for the Blizzard Challenge 2013
# Step1. Read and Accept License at http://www.cstr.ed.ac.uk/projects/blizzard/2013/lessac_blizzard2013/license.html
# Step2. Get Username and Password through email.
# Step3. Insert Username and Password below and run this script.
name=''
pass=''
dl="wget --user ${name} --password ${pass}"
baseurl='http://data.cstr.ed.ac.uk/blizzard2013/lessac'
parts='BlackBeauty.zip
Lessac_Blizzard2013_CatherineByers_train.tar.bz2