Skip to content

Instantly share code, notes, and snippets.

Jordan Frank jwf-zz

Block or report user

Report or block jwf-zz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jwf-zz
jwf-zz / imdb-sentiment-vw.sh
Last active Mar 5, 2019
Sentiment analysis on an IMDB dataset using Vowpal Wabbit
View imdb-sentiment-vw.sh
#!/bin/bash
# Requires vw (https://github.com/JohnLangford/vowpal_wabbit/wiki/),
# the IMDB dataset (http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz),
# and the perf utility from http://osmot.cs.cornell.edu/kddcup/software.html.
cat aclImdb/train/labeledBow.feat | \
sed -n 's/^\([7-9]\|10\)\s/&/p' | \
sed -e "s/^\([7-9]\|10\)\s//" | \
awk '{ print "1 '"'"'pos_" (NR-1) " |features " $0}' > train.vw
@jwf-zz
jwf-zz / print_words.py
Created Jul 6, 2012
Print words with largest weights.
View print_words.py
#!/usr/bin/env python
import sys
Dict = []
with open('aclImdb/imdb.vocab','r') as f:
for line in f:
Dict.append(line.strip())
with open('audit.log','r') as f:
f.readline()
You can’t perform that action at this time.