Saturday, April 30, 2011

Disambiguation by constructions

A word may have many senses and a good parser must choose the right one. Which is the right one? This is often obvious from the context. When you see an ambiguous word alone (e.g. cooks), you can tell nothing about its meaning. But if you see it in context, you may start guessing its syntactic and/or semantic behavior (our cooks have prepared the dinner vs. Mary cooks fish). Surrounding words greatly help in determining the part of speech, and many disambiguation algorithms take advantage of that.

But who on earth cares about the parts of speech? Well, many do, for example, parsers, both statistical and declarative, employ this information for building all kinds of structures. But anyway, that's an intermediate thing used for the own convenience of those parsers. For the ultimate text analysis tasks parts of speech are not important at all. The meaning is what is important, not them. So why bother at all? I'm currently trying to live without the intermediate part-of-speech level in my parser, and so far it works. How?

Consider cooks again. It can participate in the following constructions:
  1. she cooks
  2. cooks fish
  3. cooks when something happens
  4. cooks well
  5. the cooks
  6. sad cooks
  7. cooks that came from Germany
  8. and so on
Of those, 1-4 are "verbal", they refer to the same meaning of cooks, the process of cooking. And in fact they can all occur together in one sentence: She cooks fish very well when she's not tired. 5-7, on the other hand, are "nominal", they describe the people who cook for a living. They are also mutually compatible and at the same time totally incompatible with 1-4.

Let's now say there are no nouns, verbs and so on, there are only constructions. Upon encountering cooks, the parser notes all the constructions possible with this word (at least 1-7 from above). It also marks some of them (1-4) as incompatible with others (5-7). Then another word comes, for example, fish. It also generates tons of constructions, some of them also mutually incompatible (fish can be a noun or a verb as well). Importantly, one of them is the familiar Transitive (number 2 in the list). It's been suggested by both words, and it clearly wins over the others which were suggested only by one of the two words.

Now the constructions which are incompatible with this Transitive can be pruned: both "nominal" for cooks and "verbal" for fish. And the Transitive is promoted and may now contribute to the meaning of the entire text. (e.g. Cook.patient=Fish). Disambiguation complete.

Positive side: it's very simple and I don't have to create boring data structures for different parts of speech with all those cases, inclinations, numbers, genders, etc. Negative side: every word now has to know of all contexts it can occur in. Both adjectives and nouns have to specify that they participate in Adjective+Noun construction. That's quite unusual in rule-based parsing where people try to hand-code as little redundancy as possible. Anyway, unusual doesn't mean bad, I'm not very much against redundancy, and I really like the overall simplicity.


D_K said...

It looks to me, that if the task is complex (like the task of syntactic-semantic analysis),
the complexity gets distributed between notions or data structures
in one way or another anyway. That is, it does not matter, will there be special data structures with POSes or not,
the complexity will stay there no strings attached to the method of formalization.
OTOH, you can come up (or might be coming already) with the novel approach, which will beat what I have said above.
But before you get there, to illustrate my idea, when you avoid creating complex data structures with POSes
it leads to an each word holding all of its contexts as you said. And this is pretty much an object centric view
of the reality (like in Finnish language) versus action centric approach (like in Russian).

So in my opinion, what NLP does is studying human brain in the most gentle way. Add pragmatics of the specific NL
and you get the roots of the computer model.

Peter Gromov said...

When I use POSes, I have to think which POSes to assign to each word and in which constructions all these variants participate. When I don't use POSes, I only have to think about the second problem. Well, true, I kinda reinvent them, since the most important constructions are called suspiciously like noun cases, but still I find this less mind-boggling to deal with just one abstraction layer than with two. It may be just me.

I wouldn't be too fast to make such general conclusions about Finnish and Russian. They describe the same reality after all :)

Sometimes NLP is studying human brain, yes. It's usually called Computational Psycholinguistics, and people there are building computational models of language processing that try to explain experimental psycholinguistic results. But generally... I'm not sure that statistical machine translation, or automatic text categorization is very close to the human brain. Of course, it tells us many interesting things about human brain, but to me it seems to be the things that happen in the brain of inventor of those methods, the scientist's brain.

D_K said...


Practical question:
1. in kharms_text.txt -- was English translation done with your program?

Peter Gromov said...

Not yet :) It's just a test data, done by some people. The goal of the program is to simulate this. Just to be really sure that it does something meaningful and non-disputable.