Skip to content

Instantly share code, notes, and snippets.

@alvations
alvations / voices.txt
Created May 20, 2023 05:08 — forked from mculp/voices.txt
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.
@alvations
alvations / dispatch_openai_requests.py
Created April 21, 2023 18:19 — forked from neubig/dispatch_openai_requests.py
A simple script to get results from the OpenAI Asynchronous API
import openai
import asyncio
from typing import Any
async def dispatch_openai_requests(
messages_list: list[list[dict[str,Any]]],
model: str,
temperature: float,
max_tokens: int,
top_p: float,
This file has been truncated, but you can view the full file.
https://www.coop.ch/de/navigation/meganav/get?categoryCode=m_0475&_=1629798238733
https://www.amazon.com/dp/B0009R5B3U?th=1
https://play.google.com/_/PlayStoreUi/data/batchexecute?rpcids=qnKhOb&bl=boq_playuiserver_20191117.08_p1&gl=my&hl=ms&authuser&soc-app=121&soc-platform=1&soc-device=1&rt=c
https://www.coop.ch/de/lebensmittel/vorraete/pastasaucen-warme-saucen/saucen-gemischt/c/m_0166
https://www.amazon.com.au/gp/aod/ajax/ref=aod_f_freeShipping?asin=B08CXNTJ89&pageno=1&pc=dp
https://losangeles.craigslist.org/lac/ofc/d/san-diego-market-research-project/7369959933.html
https://www.bestbuy.ca/api/offers/v1/products/10434538/offers
https://www.zillow.com/homes/5266-S-Umatilla-Ave-Boise-ID-83709_rb
https://www.yelp.com/not_recommended_reviews/dannys-rv-repair-williams?not_recommended_start=40
https://www.nytimes.com/1910/05/06/archives/foot-caught-train-hit-her-girls-shoe-fast-in-track-frog-as-an.html
@alvations
alvations / mean_target_encoding.py
Created September 29, 2017 11:49 — forked from ogrisel/mean_target_encoding.py
Mean target value encoding for categorical variable using dask
import os
import os.path as op
from time import time
import dask.dataframe as ddf
import dask.array as da
from dask import delayed, compute
from distributed import Client
def make_categorical_data(n_samples=int(1e7), n_features=10):
@alvations
alvations / dynet-tagger.py
Created August 27, 2017 00:28 — forked from neubig/dynet-tagger.py
A small sequence labeler in DyNet
"""
DyNet implementation of a sequence labeler (POS taggger).
This is a translation of this tagger in PyTorch: https://gist.github.com/hal3/8c170c4400576eb8d0a8bd94ab231232
Basic architecture:
- take words
- run though bidirectional GRU
- predict labels one word at a time (left to right), using a recurrent neural network "decoder"
The decoder updates hidden state based on:
- most recent word
@alvations
alvations / mini_sequence_labeler.py
Created August 22, 2017 00:06 — forked from hal3/mini_sequence_labeler.py
PyTorch implementation of a sequence labeler (POS taggger).
"""
PyTorch implementation of a sequence labeler (POS taggger).
Basic architecture:
- take words
- run though bidirectional GRU
- predict labels one word at a time (left to right), using a recurrent neural network "decoder"
The decoder updates hidden state based on:
- most recent word
@alvations
alvations / colors.py
Created July 13, 2017 01:10 — forked from sheljohn/colours-old.py
Print with colors in most shells (Python, standalone)
class ColorPrinter:
"""
Usage:
cprint = ColorPrinter()
cprint.cfg('c','m','bux').out('Hello','World!')
cprint.rst().out('Bye now...')
See: http://stackoverflow.com/a/21786287/472610
See: https://en.wikipedia.org/wiki/ANSI_escape_code
"""
@alvations
alvations / colors.py
Created July 13, 2017 01:10 — forked from sheljohn/colours-old.py
Print with colors in most shells (Python, standalone)
class ColorPrinter:
"""
Usage:
cprint = ColorPrinter()
cprint.cfg('c','m','bux').out('Hello','World!')
cprint.rst().out('Bye now...')
See: http://stackoverflow.com/a/21786287/472610
See: https://en.wikipedia.org/wiki/ANSI_escape_code
"""
@alvations
alvations / docx2md.md
Created May 4, 2017 09:07 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in Two Moves

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

The Solution

As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.