Skip to content

Instantly share code, notes, and snippets.

View brendano's full-sized avatar

Brendan O'Connor brendano

View GitHub Profile
@ @ciaranyree @ @
O it O O
V was V V
P on P P
N football N N
N wives N N
, , , ,
IMPROVE $ one O $
P of P P
D the D D
@ @ciaranyree @ @
O it O O
V was V V
P on P P
N football N N
N wives N N
, , , ,
IMPROVE $ one O $
P of P P
D the D D
~/ark/blitz2011/blitz2011/analysis % ./eval.sh ../data/newsplit/dev.goldtags.tab final.dev.tab.crf_2.23 | gist
584 wrong out of 4768 0.122483
Left is GOLD, right is PREDICTED
C @ciaranyree @ @
C it O O
C was V V
C on P P
C football N N
@brendano
brendano / e8.reg
Created February 8, 2011 20:56
syntactic rules from Abney's CASS finite-state parser
phrase h; ## immediate head
phrase s; ## subject
phrase o; ## object
phrase f; ## function word
phrase k; ## `kind' -- potential partitive complement
### Level 0: tags;
### Level 1: date cdqlx cdx doll ci-st mx;
According/N to/P some/D estimates/N ,/, the/D rule/N changes/N would/M cut/V insider/N filings/N by/P more/A than/P a/D third/N ./.
===
N P D N , D N N M V N N P A P D N .
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
0 1
pruned 9808 -> 5173 (4635 fewer)
pruned 21033 -> 14400 (6633 fewer)
Elapsed 6.49 sec, 360 ms/tok
4534 span-tags (>1 length)
Best overall
Investors/N are/V appealing/N to/P the/D Securities/N and/& Exchange/N Commission/N not/R to/P limit/V their/D access/N to/P information/N about/P stock/N purchases/N and/& sales/N by/P corporate/A insiders/N ./.
===
N V N P D N & N N R P V D N P N P N N & N P A N .
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
0 1 2
pruned 18762 -> 10261 (8501 fewer)
pruned 40172 -> 28129 (12043 fewer)
Elapsed 19.75 sec, 789 ms/tok
9266 span-tags (>1 length)
Best overall
@brendano
brendano / gist:803239
Created January 30, 2011 20:53
~/sem/algo % head -100 easy | python cky.py | gist
We/O 're/V about/P to/P see/V if/P advertising/N works/V ./.
===
O V P P V P N V .
0 1 2 3 4 5 6 7 8 9
0
pruned 2513 -> 1233 (1280 fewer)
pruned 5389 -> 3521 (1868 fewer)
Elapsed 0.71 sec, 78 ms/tok
995 span-tags (>1 length)
Best overall
We/O 're/V about/P to/P see/V if/P advertising/N works/V ./.
===
O V P P V P N V .
0 1 2 3 4 5 6 7 8 9
0
pruned 2513 -> 1233 (1280 fewer)
pruned 5389 -> 3521 (1868 fewer)
Elapsed 0.80 sec, 89 ms/tok
995 span-tags (>1 length)
Best overall
@brendano
brendano / md5_float.py
Created January 19, 2011 22:53
md5_float
import sys,struct,hashlib
MaxInt = 2**32-1
def md5_float(s):
"Hash 's' to a number from 0 to 1"
i = struct.unpack('I',hashlib.md5(s).digest()[:4])[0]
return i*1.0 / MaxInt
@brendano
brendano / make_views.py
Created January 2, 2011 22:53
Publish Zotero papers as HTML and symlinks
#!/usr/bin/env python
# From your Zotero database and file storage,
# creates a simple HTML table, and directory full of symlinks,
# for quick-and-dirty web or Dropbox viewing.
# Installation: place in your Zotero folder
# e.g. ~/Documents/zotero/
# And run it
# e.g. python ~/Documents/zotero/make_views.py