How to apply Formal Semantics to Conversational AI

I am learning the Montague Semantics, one of the most influential works done in the Computational Linguistics.

There is an example with a list of similar English Noun Phrases with lambda expressions:

(1) Every student \lambda \forall x [ S(x)->P(x) ]

(2) Some student \lambda P \exists x [ S(x) /\ P (x) ]

(3) No student \lambda P \not \exists x [ S (x) /\ P (x) ]

The formal representation is type-theoretic and hard to read for non domain readers but it does not matter: the only concern at initial stage is, the three NPs are different with different deeper semantic structures. They each have different meanings and usages, and we can imagine some question answering pairs for each, such as "Every student has got on the bus" -> "We can move now", "Some student still in transition" -> "We need to wait", etc. We don't need to bang our head into a wall on getting the formulae all understood.

However, when the real application come, such as I need to replace "student" to "orders", and there are chatbot decision based on "Every order", "Some order", "no order" etc, the three original NPs will have a three modified items that one-to-one mapped to the original. Although each phrases change by a word, the whole structure is actually very similar.

Then you come back to those lambda expressions, and you may feel assured that, those lambda expressions won't change if I switch from "student" to "order". And, on what ground do I claim that the two problem are isomorphic? Just check out the formulae, they are same.

That's the beauty of formalization. It gives one a definite way of claiming that two things are related. No more "soft" word like "very similar", "almost", since they mean nothing.

Some extra opinionated thoughts. Although the above formulae are long, I still favor them because they represent daily common terms. On the contrary, in Functional Programming the Monoid pattern might be simpler in math, but have no natural language usage.

Takeaway

* Math or formalization is not for the initial understanding.

* They only find useful when one want to "borrow" a whole structure from one domain to another.

* The above activity is common, so formalization is useful.

要查看或添加评论,请登录

Pingping Xiu的更多文章

社区洞察

其他会员也浏览了