OpenCCG / openccg

OpenCCG library for parsing and realization with CCG
http://openccg.sourceforge.net/
Other
205 stars 45 forks source link

CCG Parse and Derivations #34

Open jkallini opened 4 years ago

jkallini commented 4 years ago

Is there a way to see the CCG tree/parse structure, and possibly the combinatory rules used to derive a parse?

mwhite14850 commented 4 years ago

You can show derivations using the :derivs option in tccg.

Though not documented, it's also possible to show derivations for files in the ccgbank .auto format using the openccg/bin/ccg-draw-tree tool.

On Sun, Oct 25, 2020 at 6:32 PM Julie Kallini notifications@github.com wrote:

Is there a way to see the CCG tree/parse structure, and possibly the combinatory rules used to derive a parse?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OpenCCG/openccg/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6G7TP4TV4VYM3OJ6ZIQ63SMTGR5ANCNFSM4S6XXYJQ .

jkallini commented 4 years ago

Thank you for the quick response!

Is there a way to accomplish this for novel text using the pre-trained models? I have been following the instructions inccgbank_README. I downloaded english-models.2013-03-15.tgz and successfully extracted the models, and I have installed the Stanford Core NLP tools. However, when I run

ccg-build -f build-ps.xml test-novel &> logs/log.ps.test.novel &

a new directory is made (data/novel/two-sents.dir/) but no testbed file is generated. I realized that I can run tccg with the :derivs option on the extracted grammar that is produced when running the above command, but that would eliminate the nice text preprocessing offered by the Stanford Core NLP tools.

mwhite14850 commented 4 years ago

You'll need to check the generated log file (ie logs/log.ps.test.novel) to see why a testbed file was not created. Presumably something went wrong along the way, perhaps due to a configuration issue.

In principle, you should be able to view the derivations of novel text parses, but it will take a few steps, and I'm not sure if this has ever been tested. First, in the test-parser-novel task of ccgbank/build-ps.xml, you'll need to add the -includederivs command line arg, so that the derivations are included in the testbed file. Then you'll need to convert these derivations to the ccgbank .auto file format before using the ccg-draw-tree tool. These two steps are discussed for viewing xml derivations from the converted ccgbank in the "Viewing CCGbank derivations" section of docs/ccgbank-README. Getting this to work with derivations in testbed files may not be too hard though.

I should note that with the rapid adoption of neural models in NLP, the practical value of parsing and generating with CCG has become unclear, and for this reason the OpenCCG project has been rather dormant of late. CCG remains interesting from a theoretical perspective though, so I suspect it's been used more recently just for experimenting with hand-crafted grammars. Thus, depending on your goals, it may or may not be worthwhile spending time on finding a way to view derivations of parses using the off-the-shelf models.

On Sun, Oct 25, 2020 at 11:19 PM Julie Kallini notifications@github.com wrote:

Thank you for the quick response!

Is there a way to accomplish this for novel text using the pre-trained models? I have been following the instructions inccgbank_README. I downloaded english-models.2013-03-15.tgz and successfully extracted the models, and I have installed the Stanford Core NLP tools. However, when I run

ccg-build -f build-ps.xml test-novel &> logs/log.ps.test.novel &

a new directory is made (data/novel/two-sents.dir/) but no testbed file is generated. I realized that I can run tccg with the :derivs option on the extracted grammar that is produced when running the above command, but that would eliminate the nice text preprocessing offered by the Stanford Core NLP tools.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenCCG/openccg/issues/34#issuecomment-716330637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6G7TNXPAMRO5HWTKX6K6LSMUIHBANCNFSM4S6XXYJQ .