I hereby claim:
- I am nsaphra on github.
- I am nsaphra (https://keybase.io/nsaphra) on keybase.
- I have a public key ASCpyzsqtJYqR6IjSCnoPwSjrInpOg35MPypGR9l_pvTcQo
To claim this, I am signing this object:
#!/usr/bin/python | |
import argparse | |
from collections import defaultdict | |
parser = argparse.ArgumentParser(description='Generate GIZA++ input files from ' | |
'segmented parallel text files.') | |
parser.add_argument('-s', '--src_in', help='Source input file') | |
parser.add_argument('-t', '--tgt_in', help='Target input file') | |
parser.add_argument('-p', '--prev_out', default=None, help='Previous output files prefix') | |
parser.add_argument('-o', '--out', help='Prefix for output files') |
find(path::String, exec, filterfcn) = [name => exec(name) for name in filter(filterfcn, readdir(path))] |
#!/usr/bin/python | |
from collections import defaultdict | |
import json | |
import os | |
import argparse | |
import gzip | |
import sys | |
import codecs | |
from time import asctime |
type SyntaxNode | |
label::AbstractString | |
parent::SyntaxNode | |
children::Array{SyntaxNode} | |
# TODO No error handling when going up a level with undefined parent. | |
SyntaxNode() = ( | |
x = new(); | |
x.label = ""; | |
x.children = []; |
def zipf(size, exponent): | |
x = np.arange(size, dtype='float') | |
pmf = (x ** exponent).reciprocal() | |
pmf /= pmf.sum() | |
return stats.rv_discrete(values=range(size), pmf) |
class NoughtsAndCrosses: | |
NOUGHT = "O" | |
CROSS = "X" | |
EMPTY = " " | |
STALEMATE = "Nobody" | |
def __init__(self): | |
self.board = [[self.EMPTY] * 3, [self.EMPTY] * 3, [self.EMPTY] * 3] |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
if [ "$TERM" != "screen" ] | |
then | |
if type tmux >/dev/null 2>&1 | |
then | |
tmux att || tmux \ | |
new -s tensorflow -n shell \; \ | |
neww -n notebook "source activate tensorflow; cd Documents/dynamic_curriculum; jupyter notebook" \; \ | |
neww -n dir "cd Documents/dynamic_curriculum" |
# -*- coding: utf-8 -*- | |
import os | |
from random import shuffle | |
import argparse | |
parser = argparse.ArgumentParser(description='shuffle a corpus such that the tags and the original tokenized text still align') | |
parser.add_argument('--unshuffled_dir', type=str) | |
parser.add_argument('--shuffled_dir', type=str) | |
parser.add_argument('--tag_suffix', type=str, default='.tag') | |
args = parser.parse_args() |
import sys | |
types = set() | |
token_count = 0 | |
for i, line in enumerate(sys.stdin): | |
if i % 1000 == 0: | |
print('.') | |
line = line.strip().split() | |
types.update(line) |