<div dir="ltr">Vrone,<br><br>The most common way to turn syntax into semantics is by defining logical expressions for each part of speech in a sentence and then composing those parts to make the meaning of the whole. For instance, to find the meaning of the sentence "John sees a man" we can start by assigning a logical meaning of each word in the sentence:<br>
<br>[John] john<br>[sees] \x.\y.sees(x,y)<br>[a] \P.\Q.exists x.(P(x) & Q(x))<br>[man] \x.man(x)<br><br>*Note: The backslash symbol "\" represents the "lambda" operator used in lambda calculus.<br>
<br>We can then "compose" the meanings of individual parts to derive the meaning of the whole sentence by using function application. So, to find the meaning of "a man" we can apply the function for "a" to the function for "man":<br>
<br>(\P.\Q.exists x.(P(x) & Q(x)))(\x.man(x))<br>beta-reduces to: \Q.exists x.(man(x) & Q(x))<br><br>"sees" applied to "John" (and beta-reduced) results in :<br>\y.sees(john,y)<br><br>And "a man" applied to "john sees" results in the meaning of the whole sentence:<br>
exists x.(man(x) & sees(john,x)).<br><br><br>Now, this explanation was probably a bit quick, so I invite you to check out the Natural Language Toolkit (<a href="http://www.nltk.org">www.nltk.org</a>) for further reading. The Toolkit, for which I have developed a large amount of the semantics-related material, contains documentation that explains, in depth, how to compute the meaning of a sentence. Particularly, see the chapter on Logical Semantics [1]. You should also download the open-source code, written entirely in Python, to see precisely how these algorithms are implemented. The NLTK contains not only code to compose logical expressions defined in context free grammars, but also code implementing Glue Semantics (a more powerful method of composing expressions) and code to interface with theorem provers and model builders, which allow the user to perform inferences with the representations.<br>
<br>For more information, feel free to contact me,<br>Dan Garrette<br><a href="mailto:dhgarrette@gmail.com">dhgarrette@gmail.com</a><br><br>[1] <a href="http://nltk.org/doc/en/ch11.html">http://nltk.org/doc/en/ch11.html</a><br>
<br><br>---------- Original message ----------<br>
From: Vrone <<a href="mailto:vrone@hotmail.co.uk" target="_blank">vrone@hotmail.co.uk</a>><br>
Date: Thu, Sep 4, 2008 at 12:20 AM<br>
Subject: [Corpora-List] algo for semantic structure<br>
To: <a href="mailto:corpora@uib.no" target="_blank">corpora@uib.no</a><br>
<br><br>
Hi all,<br>
<br>
Can any one give an idea about best algorithm to transform syntactic<br>
structure into a semantic structure, in NLP context.<br>
<br>
Regards,<br>
Vrone</div>