Skip to content

Instantly share code, notes, and snippets.

View noisychannel's full-sized avatar

Gaurav Kumar noisychannel

View GitHub Profile
@noisychannel
noisychannel / moses-built-ttable.sh
Created April 23, 2015 21:58
MOSES : Build phrase table
#!/usr/bin/env bash
# Change these variables
ROOT_DIR=/export/a04/gkumar/experiments/scale-2015/1
EXTERNAL_BIN_DIR=/export/a04/gkumar/code/mosesdecoder/tools
F_EXT=pa
E_EXT=en
MAX_PHRASE_LENGTH=10
CORPUS=/export/a04/gkumar/experiments/scale-2015/data/trans
@noisychannel
noisychannel / interleave.py
Created April 23, 2015 22:00
Interleave output
#!/usr/bin/env python
import sys
import codecs
sentenceId = 0
def readFiles(files, labels):
global sentenceId
sentenceId = sentenceId + 1
@noisychannel
noisychannel / qwatch
Created April 23, 2015 22:01
Monitor qsub jobs
#!/bin/bash
username="gkumar"
while true
do
clear
printf '%99s\n' | tr ' ' -
echo "My Jobs"
@noisychannel
noisychannel / monitor-process.sh
Last active August 29, 2015 14:19
Monitor a process
#!/usr/bin/env bash
if [ $# -lt 1 ]; then
echo "Please enter the process ID to monitor:"
exit 1;
fi
#TODO: Change email
EMAIL=gaurav.bison@gmail.com
@noisychannel
noisychannel / run_tuner_generic.py
Created June 8, 2015 18:41
Generic tuner for an arbitrary decoder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Runs the Z-MERT and PRO tuners.
"""
from __future__ import print_function
import argparse
from collections import namedtuple
import logging
import os
#!/usr/bin/env python
import sys
classMap = {}
classFile = open(sys.argv[1])
input = open(sys.argv[2])
output = open(sys.argv[3], 'w+')
@noisychannel
noisychannel / .dircolors
Created July 4, 2015 09:34
Dircolors config
# Exact Solarized Dark color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This simple theme was simultaneously designed for these terminal color schemes:
# - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
#
@noisychannel
noisychannel / .theanorc
Last active January 18, 2017 17:38
Theano config
[global]
mode = FAST_RUN
floatX = float32
int_division = floatX
exception_verbosity = high
warn_float64 = warn
on_unused_input = warn
allow_gc = False
compiledir_format=compiledir-%(platform)s-%(processor)s-%(python_version)s-%(python_bitwidth)s-%(hostname)s
linker = cvm
@noisychannel
noisychannel / new.Makefile
Last active February 24, 2016 16:54
Makefile to install stuff on new machines/clusters
DATADIR=/export/ws15-mt-data/gkumar
ROOT=/home/gkumar/.local
MAX_THREADS=6
BOOST_DL=http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.55.0%2F&ts=1389613041&use_mirror=kent
CMPH_DL=http://downloads.sourceforge.net/project/cmph/cmph/cmph-2.0.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcmph%2F&ts=1456331818&use_mirror=iweb
VIMCONFIG_DL=https://github.com/noisychannel/VIMconfig
all: new vim boost moses
@noisychannel
noisychannel / extractMonotonePhrasePairs.py
Last active February 3, 2016 21:25
Extracts monotone phrase pairs from aligned bitext
#!/usr/bin/env python
# NOTE : This script assumes that the aligments are in the src-tgt format
import optparse
import pprint
import sys
import numpy as np
optparser = optparse.OptionParser()