Skip to content

Commit

Permalink
Added command-line interface + batch script
Browse files Browse the repository at this point in the history
  • Loading branch information
job13011 committed Mar 16, 2016
1 parent 5deb398 commit 3e2c889
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions review_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def make_bag(text, ref_bag):
if (not USE_PRESENCE) and bag_of_words.has_key(index):
bag_of_words[index] += 1
count += 1
#print n_gram, "=>", bag_of_words[index]
print n_gram, "=>", bag_of_words[index]
else:
bag_of_words[index] = 1
count += 1
#print n_gram, "=>", bag_of_words[index]
print n_gram, "=>", bag_of_words[index]

# Add it to the reference bag
if ref_bag.has_key(index):
Expand Down
13 changes: 13 additions & 0 deletions svm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:: Replicates configurations tested by Pang and Lee (2002) (Figure 3)
echo (1) Unigrams (Frequency)
python review_svm.py --gram-length 1 --frequency
echo (2) Unigrams (Presence)
python review_svm.py --gram-length 1 --presence
echo (4) Bigrams
python review_svm.py --gram-length 2 --presence

echo (5) Unigrams + POS tags
python review_svm.py --gram-length 1 --presence --use-pos-tags

echo (6) Adjectives
python review_svm.py --gram-length 1 --presence --use-pos-tags --use-adj-only

0 comments on commit 3e2c889

Please sign in to comment.