RelEx comparisons

From OpenCog

RelEx attempts to generate dependency relations that indicate comparatives. However, support for comparatives is currently very incomplete; essentially only one sentence type is supported.

This page describes how RelEx deals with comparatives at the present moment (October 3, 2013) and also how they could be dealt with better.

See also RelEx comparatives, which provides many example sentences.

Ambiguous Comparatives

Consider the two sentences:

  • "Ben ate more cookies than Mike."
  • "Ben ate more cookies than Twinkies."

These sentences are ambiguous because it is not clear if Mike/Twinkies is a subject (who is eating) or an object (and is being eaten).

If Ben were a cannibal, the first sentence might mean that Ben ate 5 pounds of cookies but only 2 pounds of Mike, for example.

By contrast, not all comparative sentences are ambiguous: "Ben ate more cookies than Mike did." makes it clear that "Mike" is a subject, doing eating, and cannot be the object being eaten.

What RelEx currently seems to be trying to do

Consider the two interpretations of "Ben ate more cookies than Mike." Both involve:

 _subj(eat, Ben)
 _obj(eat, cookie)

The cannibal interpretation could be understood as also involving the additional relations

_subj(eat_1, Ben)
_obj(eat_1, Mike)
_comparative(cookie, Mike)

The other interpretation (in which Ben ate more cookies than Mike did) could be understood as involving instead, the additional relations

_obj(eat_1, cookie_1)
_comparative(cookie, cookie_1)

To provide a single output for the sentence unifying the two interpretations, one could then say

_subj(eat, Ben)
_obj(eat, cookie)
_subj(eat_1, Ben)
$crVar(eat_1, Mike)
_comparative(cookie, $cVar)

In that case

  • the cannibal interpretation emerges from $crVar = _obj, $cVar = Mike
  • the other interpretation emerges from $crVar = _subj, $cVar = cookie

This is somewhat clever and would seem to work for this particular kind of comparative. However, it's inconsistent with how RelEx handles other kinds of ambiguity.

It is our impression that the current RelEx behavior is a buggy attempt to do what has just been described.

A probably better approach

Probably a better approach would be to change the link parser dictionary, in such a way as to make the two different interpretations of an ambiguous comparative sentence correspond to two different parses in a clear and comprehensible way.

Currently the link parser's rules for handling comparatives appear to give wrong behavior in a number of cases. So an overhaul of this part of the link parser dictionary seems to be needed anyway.

In this case, the cannibal interpretation of the above sentence could perhaps be made to come out to

_subj(eat, Ben)
_obj(eat, cookie)
than(cookie, Mike)
_comparative(cookie, Mike)

and the other interpretation could perhaps be made to come out

_subj(eat, Ben)
_obj(eat, cookie)
_subj(eat_1, Mike)
than(Ben, Mike)
_comparative(cookie, cookie_1)

On the other hand, the sentence "The pig runs slower than the cat" would perhaps be made to come out

_advmod(run, slow)
_comparative(slow, pig)
than(pig, cat)

These suggestions are a bit speculative and some details might come out differently once the link parser dictionary is actually modified and RelEx is tweaked accordingly.

See also