This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Make sure to first run: | |
$ pip install click pandas lhotse kaldialign | |
""" | |
import click | |
import pandas as pd | |
from lhotse.serialization import load_jsonl | |
from kaldialign import align, bootstrap_wer_ci | |
EPS = '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: after downloading ~250 citations further connections might be blocked by Google Scholar. | |
import time | |
import shelve | |
# Make sure to run: pip install scholarly tqdm | |
from scholarly import scholarly | |
from tqdm.auto import tqdm | |
search_query = scholarly.search_author('Piotr Żelasko') # replace the author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import warnings | |
from collections import deque, defaultdict | |
from functools import partial | |
from pathlib import Path | |
from typing import Optional | |
from lhotse import CutSet, load_manifest | |
from lhotse.utils import Seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://stackoverflow.com/questions/569754/how-to-tell-for-which-object-attribute-pickle-fails | |
""" | |
Show which fields cannot be pickled | |
""" | |
import pickle | |
def get_pickling_errors(obj,seen=None): | |
if seen is None: | |
seen = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Common steps | |
conda create -n k2 python=3.8 | |
conda activate k2 | |
conda install -c nvidia cudnn=7.6.5 cudatoolkit=10.2 | |
conda install -c pytorch pytorch torchaudio | |
pip install cmake | |
mkdir build | |
pushd build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import panel as pn | |
pn.extension() | |
import holoviews as hv | |
hv.notebook_extension("bokeh") | |
# hv.extension('matplotlib') | |
from holoviews.streams import Stream, Params | |
from scipy.io import wavfile | |
from scipy.signal import spectrogram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed "/[[:punct:]]*/{ s/[^[:alnum:][:space:]'-]//g}" | tr '[:upper:]' '[:lower:]' | grep -v '[0-9]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from sys import stdout | |
def fancy_logging(level=logging.DEBUG, stream=stdout): | |
logging.basicConfig( | |
level=level, | |
format="[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s", | |
datefmt="%H:%M:%S", | |
stream=stream | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="$1" | |
source_dir="$2" | |
target_dir="$3" | |
ssh "$host" ls "$source_dir" | parallel -j8 -v --sshdelay 0.2 rsync -raz --progress "$host":"$source_dir"/{} "$target_dir"/{} | |
NewerOlder