partially ports skip-gram to python