Sampling algorithms for PCFGs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
examples
.gitignore
LICENSE
README.md
agenda.py
binarizable.py
cfgply.py
discodopfmt.py
earley.py
generalisedSampling.py
get_stats.py
inference.py
item.py
itg-parse.py
mcmcparse.py
nederhof.py
parse.py
reader.py
rule.py
sentence.py
slice_variable.py
sliced_earley.py
sliced_nederhof.py
symbol.py
topsort.py
unknownmodel.py
utils.py
wcfg.py
wfsa.py

README.md

pcfg-sampling

Sampling algorithms for PCFGs

PCFG parser

echo 'I was given a million dollars .' | python parse.py examples/wsj00 --grammarfmt discodop --unkmodel stfd6 -v --samples 100 --intersection nederhof --start TOP --log > nederhof.mc

Or

echo 'I was given a million dollars .' | python parse.py examples/wsj00 --grammarfmt discodop --unkmodel stfd6 -v --samples 100 --intersection earley --start TOP --log > examples/earley.mc

ITG parser

echo '1 2 3 4' | python itg-parse.py examples/itg

For small examples, we can list the permutations

echo '1 2 3 4' | python itg-parse.py examples/itg --show-permutations

Binarizable permutations

echo '1 2 3 4' | python binarizable.py