0

How can we distinguish the meaning from POS,words,form..or any other information.. f.e.

 the cube is **in** the box

 the sign splits a rule **in** two parts

in the first case the meaning is containment in the second it is just sort of connector.

the reason I want to know this is to build structures. If i want to use in as functor :

   in(cube,box)
   in(sign-split-rule,two-parts)  <-- not convincing

   split(sign,rule^in(rule,two-parts))  <--- better

i.e. in the first case i can use in , in the second i have to prioritize the verb first..

Is it the case always to use verb first and only then to look for connectors like in,into,on,after,before ...

BTW I'm not looking for pure Linguistic rules, but more for a Structural/relational rules. verbs,nouns reveal L-Struct, connectors reveal R-Struct


this is my initial crack on it, for now POS-based :

import spacy

class Sent2Struct(object):

    def root(self,doc):
        for word in doc :
            if word.dep_ == 'ROOT' : return word

    def lol(self,root) :
        if len(list(root.children)) == 0 : return root.text
        childs = [ self.lol(child) for child in root.children ]
        return [root.text] + childs 



   In [100]: print( ss.lol(ss.root(nlp('the box is on the table'))) )                                                                                                           
   ['is', ['box', 'the'], ['on', ['table', 'the']]]

i.e.

   is(box(the), on(table(the)) )
3
  • 2
    This is a complex topic and there are many competing theories of (lexical) semantics. If FOL is good enough for you I’d recommend Jerry Hobbs’ “The syntax of English in an abductive framework”, he discusses this kind of problems. – Atamiri Jan 2 at 3:22
  • Your edit is just a recursive linearisation of the dependency tree. It’s not POS-based (you aren’t using any tags aside from ROOT which is a technicality for the base case), it’s based on lemmata. Note that it’s still syntax, not semantics. – Atamiri Jan 5 at 12:07
  • u right, i know its still just syntax ;(.. – sten Jan 5 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.