3

I am trying to implement a probabilistic ccg with lambda-calculus features.

Basically i want to do the following code:

>> lex = parseLexicon(r'''
 :- S,NP
 He => NP {sem=\x.he(x)} [1.0]
 Walks => S\NP {sem=\X. walk(X)} [1.0]
 There => S\S {sem=\x . there(x)} [1.0]
 ''')
>> parser = CCGChartParser(lex)
>> all_parses = parser.nbest_parse(“He walks 
there”.split(),n=100)
>> for parse in all_parses: 
 printCCGDerivation(parse)

but existing CCG implementation of NLTK does not support {sem=\x.he(x)} [1.0] kinds of semantic parts in lexicon.

Are there Any other CCG implementations that can handle this? Or can i represent this inside of NLTK?

ayyayyekokojambo
  • 1,165
  • 3
  • 13
  • 33
  • 1
    I am curious if you ever found a solution to your question? – GuSuku Jan 13 '15 at 01:46
  • 1
    @crackjack no, unfortunaltely. there were a master thesis project implementation on this but it is not completed. i contacted with thesis advisor, he said project is no longer maintaned. – ayyayyekokojambo Jan 18 '15 at 20:56
  • 1
    I'm that guy. The semantics predicate was recently implemented. The probabilistic parsing for CCG is on the horizon. Please see my answer below. – Tanin Apr 03 '16 at 17:18

3 Answers3

3

Unfortunately no, this does not exist yet. I too have been looking at this space. It seems to be in the works mentioned here on their wiki - Semantic-Parsing

If you are interested in other languages / frameworks, take a peek at Semantic Parsing with Execution, Stanford or The University of Washington Semantic Parsing Framework.

If you want to build something from the ground up, you might want to obtain the CCGBank or revive C&C Tools.

Most of the above is in Java, but I have seen attempts to parse the C&C Marked file in Python.

I personally would like to see CCG come to Node.js.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Rob Ellis
  • 31
  • 2
  • Thanks for you info. I checked the page where I can download CCGBank (the linguistic data consortium site, https://catalog.ldc.upenn.edu/ldc2005t13) but it seems I will be charged to obtain. – Yohan Chung Feb 28 '17 at 00:13
2

NLTK CCG recently supports semantics predicate (Lambda-Calculus representation) computation. Please see the tests here: https://github.com/nltk/nltk/blob/develop/nltk/test/ccg_semantics.doctest

The probabilistic parsing for CCG is on the horizon: https://github.com/nltk/nltk/issues/1356

Tanin
  • 1,853
  • 1
  • 15
  • 20
-1

If you don't mind switching to Common LISP, there is a ccg tool (CCGlab) developed by Cem Bozsahin. It also has PCCG training. https://github.com/bozsahin/ccglab

CSaki
  • 1