< Return to Video

#rC3 Type theory and meaning in linguistics

  • 0:00 - 0:16
    rc3 hacc preroll music
  • 0:16 - 0:20
    Herald: All right, we are back again from
    the HACC or about:future studios on the
  • 0:20 - 0:30
    rc3 remote Congress 3 this year sadly
    remote so we'll do as we can. We have a
  • 0:30 - 0:37
    really nice talk coming up here about type
    theory in linguistics and about meaning in
  • 0:37 - 0:44
    linguistics. From daherb. He will be
    talking about the uses of type theory in
  • 0:44 - 0:52
    both programing languages and natural
    languages and maybe draw, like,
  • 0:52 - 1:02
    similarities between them. He has a PhD in
    computer science, was in Sweden for 6 years
  • 1:02 - 1:07
    at a university and is now back in
    Germany. There is sadly no translation for
  • 1:07 - 1:12
    this talk because there aren't enough
    angels to do all the translation work.
  • 1:12 - 1:17
    There is a pixelflut behind me. It's my
    own implementation. So if you want to spam
  • 1:17 - 1:23
    me, you can. I'm not sure if it will work,
    but apart from that, I think that's enough
  • 1:23 - 1:27
    of introduction. Let's go to daherb.
  • 1:27 - 1:33
    daherb: Thanks, and a little bit about me:
    I would call myself a computational
  • 1:33 - 1:41
    linguist, even though my Ph.D. officially
    just says computer science. And I see
  • 1:41 - 1:47
    myself in the tradition of this slightly
    outdated xkcd where people try to use
  • 1:47 - 1:56
    computers to test linguistic theories. In
    addition to that, I spent my time in
  • 1:56 - 2:02
    Sweden in a very well known functional
    programming group and basically next to a
  • 2:02 - 2:08
    research group dedicated to type theory.
    So my interests are both into functional
  • 2:08 - 2:14
    programming, and I got a little bit spoiled
    also by type theory. And that inspired me
  • 2:14 - 2:22
    to give this talk. And to start: The
    question is what is meaning in natural
  • 2:22 - 2:29
    language? So I came up with a few
    examples, example sentences. And the
  • 2:29 - 2:39
    question is: what is the meaning of these
    sentences? But before we dive into that, a
  • 2:39 - 2:44
    little bit about linguistics. So there are
    several subdisciplines in linguistics: one
  • 2:44 - 2:52
    is syntax, which is mostly people drawing
    trees. And people are really good at
  • 2:52 - 3:00
    drawing trees these days. On the slide,
    you can see various formalisms, how people
  • 3:00 - 3:06
    draw trees, and that's pretty well
    established these days. But that's
  • 3:06 - 3:14
    basically: what are valid sentences in a
    language? The next question is: what is
  • 3:14 - 3:23
    the meaning of these sentences? And within
    linguistics, for a long time, semantics
  • 3:23 - 3:28
    was something you would not really try to
    approach because it's really, really
  • 3:28 - 3:38
    difficult. But actually, semantics is the
    literal meaning, and in addition to
  • 3:38 - 3:44
    semantics, we might have the meaning in
    context. So this is a very great example
  • 3:44 - 3:52
    of so-called pragmatics. Question: your
    greatest weakness? Answer of the person:
  • 3:52 - 3:56
    interpreting semantics of a question, but
    ignoring the pragmatics. Could you give an
  • 3:56 - 4:05
    example? Yes. So in this example, the
    person only looked at the literal meaning.
  • 4:05 - 4:13
    Can you give an example? Yes, I can give
    an example. Not interpreted as the request
  • 4:13 - 4:19
    to actually give an example. So we have
    the literal meaning and decide that we
  • 4:19 - 4:29
    even have an additional meaning in
    context. So if we look at statements in
  • 4:29 - 4:34
    natural language, we might have challenges
    in interpreting: what do they mean?
  • 4:34 - 4:38
    All men are mortal. Every man is mortal.
  • 4:38 - 4:43
    That we can interpret
    pretty literal. Yesterday it was raining.
  • 4:43 - 4:51
    Tomorrow it will be raining. The first one
    could be a literal fact. The one about the
  • 4:51 - 4:58
    future. Who knows? Then there are
    statements about things that could
  • 4:58 - 5:04
    potentially happen. It could be raining.
    Then there are statements which in our
  • 5:04 - 5:10
    world could never actually happen, like
    John is searching for a unicorn. It's
  • 5:10 - 5:16
    pretty much a matter of fact that there
    are no real life unicorns. So if John is
  • 5:16 - 5:21
    searching for a unicorn, we don't really
    claim that there might be unicorns in our
  • 5:21 - 5:30
    world. And then we have questions like,
    could you pass me the salt where we don't
  • 5:30 - 5:35
    really have the literal meaning or we
    don't care about the literal meaning, we
  • 5:35 - 5:42
    don't care if the answer is yes or no.
    What we actually – what the person
  • 5:42 - 5:47
    making the statement actually means is,
    please hand me the salt. Please pass me
  • 5:47 - 5:54
    the salt. And in addition, there is kind
    of an assumption that there is actually
  • 5:54 - 5:59
    salt on the table. But we don't really
    assume that if John is searching for a
  • 5:59 - 6:03
    unicorn, that there is a unicorn, if
    someone asks the question, can you pass me
  • 6:03 - 6:13
    the salt? there is actually salt on the
    table. So meaning is a very philosophical
  • 6:13 - 6:24
    problem. And why do people care about it?
    There are relevant questions, for example,
  • 6:24 - 6:30
    when are two statements equivalent, when
    do they mean the same? "All men are
  • 6:30 - 6:36
    mortal" Does it mean the same as every man
    is mortal? Or the more challenging "I saw
  • 6:36 - 6:43
    the morning star", "I saw the evening
    star" "I saw Venus". As a matter of fact,
  • 6:43 - 6:49
    these three are meaning exactly the same,
    but if someone says, I saw the morning
  • 6:49 - 6:55
    star, do we know that they actually also
    know that they saw Venus, that the morning
  • 6:55 - 7:03
    star is the same as Venus? And another
    relevant question is, when does one
  • 7:03 - 7:09
    statement follow from other statements?
    And especially in computational
  • 7:09 - 7:20
    linguistics, we want to find automatic
    ways to decide these questions. There are
  • 7:20 - 7:28
    a few more examples. So there is a very
    well-known example: all men are mortal,
  • 7:28 - 7:34
    Socrates is a man. So we should come to
    the conclusion that Socrates is also
  • 7:34 - 7:40
    mortal. Or more challenging: every
    European, has the right to live in Europe.
  • 7:40 - 7:43
    Every European is a person. Every person
    who has the right to live in Europe can
  • 7:43 - 7:48
    travel freely in Europe. Can we answer
    the question, can every European travel
  • 7:48 - 7:57
    freely within Europe? and hopefully find
    some way to answer this question with yes.
  • 7:57 - 8:03
    Humans are – People are usually pretty
    good at deciding that with a little bit of
  • 8:03 - 8:12
    logic and a lot of intuition. But
    computers are really bad about intuition.
  • 8:12 - 8:22
    So we are interested in models or ways
    that actually also work for computers. And
  • 8:22 - 8:30
    these days there are basically two big
    branches: the one the formal approaches.
  • 8:30 - 8:33
    And the other are the statistical
    approaches. The formal approaches use
  • 8:33 - 8:40
    logic to try to answer the questions,
    while the statistical approaches, just
  • 8:40 - 8:49
    look at plenty of data, I shouldn't say
    "just", they use a lot of data to answer
  • 8:49 - 8:57
    the questions we are interested
    in. In this talk, I will only focus on the
  • 8:57 - 9:05
    formal approaches because I like them
    more. But both approaches, both kinds of
  • 9:05 - 9:19
    approaches have the right to exist and can
    be also very helpful in their own way. So,
  • 9:19 - 9:26
    back to the kind of the title of the talk
    now slightly paraphrased: type theory and
  • 9:26 - 9:36
    semantics. And there are basically two big
    approaches to type theory. OK, what is
  • 9:36 - 9:46
    type theory? In computer science type
    theory is the study of what systems of
  • 9:46 - 9:53
    types exist and how, what properties do
    they have? We will shortly see what
  • 9:53 - 10:06
    that could mean. So that … If we go back
    in history, then there are simply typed
  • 10:06 - 10:14
    languages. They go back to Alonzo
    Church. I think in 1940 he described the
  • 10:14 - 10:21
    simply typed lambda calculus. And then a
    few decades later, a guy called Richard
  • 10:21 - 10:30
    Montague used this approach or adopted
    this approach, which was purely from logic
  • 10:30 - 10:44
    to natural languages. And Richard Montague
    was a very particular person. He was … he
  • 10:44 - 10:54
    had a great influence, but also he was not
    an easy person, he openly attacked
  • 10:54 - 11:02
    colleagues and … but his influence on
    linguistics started in the 70s. There are
  • 11:02 - 11:16
    still people trying to work out details
    about his theory. Now we come to the
  • 11:16 - 11:24
    one answer: what is meaning in
    linguistics? And that's so-called truth
  • 11:24 - 11:34
    conditional or model theoretic semantics.
    So, what is the meaning of the sentences
  • 11:34 - 11:45
    like "all men are mortal". And the meaning
    of this sentence is: can we come up with a
  • 11:45 - 11:53
    model which is kind of a picture of a
    world that makes this sentence true? And
  • 11:53 - 12:02
    here in the picture, we have an example of
    that: we have the set of all mortal
  • 12:02 - 12:10
    things. And we have the set of all men in
    our world, and they are a subset, meaning
  • 12:10 - 12:17
    everything that's a man is also a mortal
    thing. And then we have the second
  • 12:17 - 12:24
    sentence, which says "Socrates is a man",
    which means we know that Socrates is one
  • 12:24 - 12:32
    of these objects in the set of all men.
    And then is the question "is Socrates
  • 12:32 - 12:40
    mortal?", and because we know that all men
    are in the set of mortal things, we can
  • 12:40 - 12:47
    answer this question quite easily with
    yes. So one approach to meaning of natural
  • 12:47 - 12:56
    language is: can we find a world in which
    all the properties are in a way that all
  • 12:56 - 13:01
    the sentences we are given are true?
    And because we look at models, it's called
  • 13:01 - 13:18
    model theoretic semantics. And the big
    influence of Montague was … As I mentioned
  • 13:18 - 13:22
    before, there was already the theory by
    Alonzo Church of the simply typed lambda
  • 13:22 - 13:29
    calculus, which was an approach in logic,
    and then there came around Montague and
  • 13:29 - 13:33
    made the statement, this very bold
    statement: "There is, in my opinion, no
  • 13:33 - 13:37
    important theoretical difference between
    natural languages and the artificial
  • 13:37 - 13:42
    languages of logicians. Indeed, I consider
    it possible to comprehend the syntax and
  • 13:42 - 13:48
    semantics of both kinds of languages that
    think a single natural and mathematically
  • 13:48 - 13:57
    precise theory". And that's a really bold
    statement, because we know that usually if
  • 13:57 - 14:04
    we, for example, look at programming
    languages, they are very small and very
  • 14:04 - 14:09
    well-defined compared to what we can
    express in natural languages. But yeah, he
  • 14:09 - 14:19
    made the statement and then he started to
    demonstrate that this is actually
  • 14:19 - 14:33
    possible. Then, let's look a bit at times,
    and I called this a simply typed language,
  • 14:34 - 14:46
    and we can give … We have infinitely many
    types, and every object in our
  • 14:46 - 14:52
    logic language has a
    type. And the type is either e for an
  • 14:52 - 15:01
    entity, t for truth value, or if we have
    some type alpha, and some other type beta,
  • 15:02 - 15:10
    then we have this pair <alpha,beta>, which
    is a type. And then logicians like to be
  • 15:10 - 15:16
    very precise and they say "nothing else is
    the type in this language". And. That's,
  • 15:16 - 15:31
    again, rather abstract. Let's look at some
    examples. We have certain classes of words
  • 15:31 - 15:39
    in our language. For example, we have
    names. And they … our examples are, for
  • 15:39 - 15:47
    example, John and Mary, and we have the
    semantic type e, which is a basic type,
  • 15:49 - 15:55
    and then we have intransitive verbs, which
    means verbs that don't take a direct
  • 15:55 - 16:03
    object like "sleeps" or transitive groups
    that have a direct object like "love". And
  • 16:03 - 16:10
    then we have sentences and they have the
    semantic type t, which is as a computer
  • 16:10 - 16:14
    scientist, I would call it boolean. It's a
    truth value. It's either true or false.
  • 16:17 - 16:24
    And intransitive verbs have this type of a
    pair ("e to t"), which, for example,
  • 16:24 - 16:35
    could interpret as a function from
    entities to truth values. And then I have a
  • 16:35 - 16:45
    few examples down here. So what's in this
    double square brackets? That's our natural
  • 16:45 - 16:53
    language. And what's not in italics, not
    in these double square brackets, that's our
  • 16:53 - 17:03
    logic language. So for simple things like
    the name John, we just claim that there's
  • 17:03 - 17:12
    some object representing John, we call it
    just "j". The same for Mary and also "sleeps"
  • 17:12 - 17:20
    and "love", we translate to just some
    object in our logic language. But what are
  • 17:20 - 17:33
    these exactly? There are two ways to look at
    them: sleep' ("sleep prime"), for example,
  • 17:33 - 17:42
    is either the set of all objects that are
    sleeping in our world. For example, the
  • 17:42 - 17:49
    set only consisting of only having the
    element John or j representing John. So
  • 17:49 - 17:55
    John is the only sleeping entity in our
    world, or we can represent it as a
  • 17:55 - 18:04
    function from entities to truth values and
    the function returns true, if x is a
  • 18:04 - 18:11
    sleeping element in our world and false
    otherwise, and if we define it the
  • 18:11 - 18:17
    following way, that j is mapped to true
    and m is mapped to false, then we get
  • 18:17 - 18:25
    exactly the same representation as with
    the set before. And that theory, that's
  • 18:25 - 18:31
    usually called a characteristic function.
    So either we can treat it as a set or as a
  • 18:31 - 18:39
    function. In this case, it doesn't really
    matter, but the next question is: "what is
  • 18:39 - 18:52
    love?" Or love', to be precise. And
    while "sleep" is a property of an entity –
  • 18:52 - 18:58
    for each entity, we can decide if it's
    sleeping or not. Love is not a property of
  • 18:58 - 19:02
    one entity, but it's the relation between
    two entities. So it's either a set of
  • 19:02 - 19:17
    pairs. Or it is a function which takes two
    parameters, and as soon as we apply to one
  • 19:17 - 19:22
    of the parameters, we end up with the
    second function. So the function with two
  • 19:22 - 19:30
    parameters represent the relation between
    two entities or two individuals. But if we
  • 19:30 - 19:38
    apply to one of the parameters, we get a
    function, which is the property, for
  • 19:38 - 19:59
    example, to be loved by someone. Just to
    keep in mind, for simple predicates, sets
  • 19:59 - 20:07
    and functions are equivalent, and for
    these relations, it's either pairs or it's
  • 20:07 - 20:12
    a function. And if we apply it to one of
    the arguments, we get another function.
  • 20:16 - 20:23
    One of the driving forces behind the
    theory of Montague is compositionality.
  • 20:25 - 20:32
    And that's usually attributed to Frege,
    even though he never really expressed it
  • 20:32 - 20:38
    that way. But one of the most well known
    interpretations is "the meaning of a
  • 20:38 - 20:42
    compound expression is a function of the
    meaning of its parts and the way they are
  • 20:42 - 20:49
    syntactically combined". So if we go back
    here, we kind of have our simple and
  • 20:49 - 20:56
    simplest parts. We have our names and we
    have our verbs, and we have rather simple
  • 20:57 - 21:03
    interpretations what they mean. And now
    the question is how can we combine them to
  • 21:03 - 21:10
    form … for example, the meaning of more
    complex sentences, or in general of
  • 21:10 - 21:18
    sentences. And for that, we need a little
    bit of syntax. Syntax tells us how we can
  • 21:18 - 21:27
    combine these elements to form sentences.
    So the rule syntax 1, for example, says if
  • 21:27 - 21:39
    we have a name and an intransitive verb,
    we can combine them to a sentence. And the
  • 21:39 - 21:46
    second rule, syntax 2, says if you have a
    transitive verb and a name, we can combine
  • 21:46 - 21:55
    it to an intransitive verb. Now we want to
    look at the meaning of sentences like
  • 21:55 - 22:09
    "John sleeps" and the meaning of "John
    sleeps" is that if we interpret the
  • 22:09 - 22:15
    meaning of "sleeps" and that's the
    predicate which can be applied to an
  • 22:15 - 22:23
    entity or an individual to give a truth value.
    And John is of type e, so we can apply
  • 22:23 - 22:31
    sleeps to John and we get, as a result,
    sleep' applied to John. Or the
  • 22:31 - 22:41
    slightly more complex example of "John
    loves Mary". We can first apply the same
  • 22:41 - 22:53
    semantic rule that we can apply the rest
    of the sentence to the subject of the
  • 22:53 - 23:06
    sentence. And then we have to interpret
    "loves Mary", which is this function that
  • 23:06 - 23:14
    takes two parameters and then is first
    applied to the object and then to the
  • 23:14 - 23:23
    subject. So the meaning of "loves Mary" is
    kind of the predicate "to be in in a state
  • 23:23 - 23:30
    of loving Mary". And then we apply to John
    and we get the meaning: Love, Mary, John.
  • 23:35 - 23:44
    And now the question is: how do we
    actually come up with these semantic
  • 23:44 - 23:52
    rules? So how do we know that we have to
    apply "loves Mary" to "John". And that's
  • 23:52 - 24:03
    where the types give us guidance. So we
    know that "loves Mary" is of the Category
  • 24:04 - 24:12
    IV, intransitive verb, which has the type
    , and we know that John is of the
  • 24:12 - 24:18
    category "m", which is of semantic type e,
    and if we see as a function which
  • 24:18 - 24:25
    takes an "e" as a parameter to produce a
    "t" as a result, then we know that we can
  • 24:25 - 24:40
    apply "loves Mary" to John. Then I already
    before mentioned the word lambda calculus
  • 24:40 - 24:46
    or lambda expression: Probably not
    everyone knows what a lambda
  • 24:46 - 24:55
    expression is. It's kind of the solution
    to a very … almost nit picky problem. So
  • 24:55 - 25:00
    if we have some formula, some expression
    like "x^2 + 2 x", what does it
  • 25:00 - 25:07
    exactly mean? And then we could come up
    with just putting numbers instead of x.
  • 25:09 - 25:17
    And if we put 1, we get the result 3 and
    if we put 2 the result is 8 and if we put
  • 25:17 - 25:24
    x=3, we get 15. But what we
    usually mean is: it's some kind of function
  • 25:24 - 25:32
    which takes a number and then maps this
    number to the number's square plus two x.
  • 25:34 - 25:38
    That's what we mean. But it's not really
    written down precisely. And that's where
  • 25:39 - 25:48
    logicians came up with a new operator
    called lambda. Which can introduce a
  • 25:48 - 25:55
    variable and turn up expression, which is
    not completely clear, like the one we had
  • 25:55 - 26:03
    before into a function. So if you write
    "lambda x, x^2 + 2 x", we know
  • 26:03 - 26:10
    that it is a function which has a
    parameter which we call x, and we use that
  • 26:10 - 26:20
    in our expression "x^2 + 2 x".
    And then we can apply this, for example,
  • 26:20 - 26:29
    to 1, which means we have to replace all
    "x"s in our expression by 1, and then we
  • 26:29 - 26:37
    get exactly the same results as we had in
    our informal expression. But now it's on a
  • 26:37 - 26:45
    proper foundation. Why do we need that?
    Because we actually have, kind of higher
  • 26:45 - 27:02
    order types, so we know that the E to T is
    kind of a function from individuals to
  • 27:02 - 27:11
    truth values, that that's the same for
    common noun like man, bird and so on. But
  • 27:11 - 27:22
    what is the type of what we call
    determiners or quantifiers: some, every,
  • 27:22 - 27:31
    the. So the meaning of man is just
    man' or man'(x), the same
  • 27:31 - 27:41
    as we have had with sleep before.
    And the meaning of "every" now we
  • 27:41 - 27:58
    use this lambda. Because the meaning of
    "everything" is for all things "x" that are
  • 27:58 - 28:08
    individuals, if they meet some predicate
    P, then they also meet some predicate Q.
  • 28:12 - 28:19
    That's, again, very abstract, so let's
    have a look at an example. So the meaning
  • 28:19 - 28:31
    of "every man" is: We have a new semantics
    rule meeting all the types, so the type of man
  • 28:31 - 28:42
    is <e,t> and the semantic type of "every"
    is this a slightly more complex type, but
  • 28:42 - 28:47
    is the function from <e,t> to something
    else? So we know we can apply that terminal
  • 28:47 - 29:01
    to our common noun. Then we do our lamda
    magic and we end up with the term lamda Q
  • 29:02 - 29:13
    for all x, man'(x) implies Q(x), meaning for
    all things: If they are men, then they do
  • 29:13 - 29:21
    something or they have a certain property.
    And if we now look at "every man sleeps".
  • 29:21 - 29:30
    We apply "every man" to "sleeps", we just had
    this term on the previous slide and the
  • 29:30 - 29:44
    types for Q<e,t> and for sleeps match,
    so we can just put that in there. And the
  • 29:44 - 29:53
    meaning of "every man sleeps" is for all
    individuals: If they are men, then they
  • 29:53 - 30:08
    sleep. And that way we get a theory how we
    can translate expressions of natural
  • 30:08 - 30:15
    language into expressions, into logic
    expression, for which we can try to find
  • 30:15 - 30:22
    models, so we have this truth conditional
    semantics, and it is compositional in the
  • 30:22 - 30:29
    way that the meaning of an complex
    expression depends on its components. The
  • 30:29 - 30:33
    meaning of "every man sleeps" depends on
    the meaning of "every man" and of "sleeps"
  • 30:34 - 30:43
    and on ways how to combine them. And these
    ways how to combine them are determined by
  • 30:43 - 30:53
    the types we use. So we have some very
    nice method of computing meaning in a
  • 30:53 - 30:59
    compositional way into a logic, so that
    looks already pretty much like what
  • 30:59 - 31:11
    Montague claims, but it has certain
    drawbacks. And for that reason, and also
  • 31:11 - 31:18
    because in logic and computers science the
    research progressed, people came up with
  • 31:18 - 31:26
    the so-called MTTs "Modern type theories"
    or the original is called "Martin-Löf type
  • 31:26 - 31:33
    theory". So this nice bearded guy on the
    left is kind of the person who invented
  • 31:33 - 31:41
    everything and the nice person on the
    right who likes to climb mountains, he
  • 31:41 - 31:47
    used to be … who is a professor in the
    group where I was doing my Ph.D. used
  • 31:47 - 31:55
    these type theories, these modern type
    theories to express the meaning of natural
  • 31:55 - 32:03
    language in a slightly different way. And
    I'll give a quick glance at what changes
  • 32:03 - 32:12
    they have. But first, one of the big
    advantages of this – or one of the biggest
  • 32:12 - 32:16
    implications of these modern type theories
    is usually in computer science, in proof
  • 32:16 - 32:25
    systems. So one of the most or very well-
    known proof assistant is the one with the
  • 32:25 - 32:33
    logo on the right called Coq. Another
    dependently type programming language is
  • 32:33 - 32:39
    the language Agda, which is … both of them
    are used quite extensively in formalizing,
  • 32:41 - 32:48
    and verifying, for example, proofs in
    mathematics, and verifying and proving
  • 32:48 - 32:54
    properties about programs. But they can
    also be used to reason about natural
  • 32:54 - 33:05
    language. So the different approach to
    meaning in language is the so-called proof
  • 33:05 - 33:14
    theoretic semantics. So before we looked
    at what models can be, how models can be
  • 33:14 - 33:22
    used to express conditions under which
    things can be can be seen as true. And now
  • 33:22 - 33:29
    we care more about proofs than about
    truth. And that goes back to logic and
  • 33:29 - 33:38
    computer science again. Where it's
    usually referred to as the Curry-Howard
  • 33:38 - 33:45
    isomorphism. It's that proofs in
    mathematics can be expressed as programs
  • 33:45 - 33:50
    in a computational framework, and that
    allows us practical reasoning on
  • 33:50 - 33:57
    computers. And informally, if you want to
    prove something, A, we can construct a
  • 33:57 - 34:04
    term or write a program t of this type.
    And an example is at the top of the slide
  • 34:07 - 34:13
    where we kind of want – first it's a
    function and it's the function from a
  • 34:13 - 34:19
    semantic representation of the sentence
    "every man walks" to the sentence "John is
  • 34:19 - 34:31
    a man", and finally the sentence "John
    walks". So we want to we have the two
  • 34:31 - 34:37
    sentences "every man walks" and "John is a
    man". And we want to get to the conclusion
  • 34:37 - 34:43
    – or to figure out – if it is a conclusion
    that "John walks". And this is a small
  • 34:43 - 34:50
    proof in the proof assistant Coq there in
    a few lines of code. In a few lines of Coq
  • 34:50 - 34:55
    code we can find the proof that actually
    from the sentence every man walks and John
  • 34:55 - 35:04
    is a man. We can conclude that "John
    walks". The first big extension is: we
  • 35:04 - 35:14
    have more expressive types. So before we
    had the type e for entities and the type t
  • 35:14 - 35:24
    for truth values. So actually the type t
    doesn't change a lot. We now just called
  • 35:24 - 35:30
    it "prop" the type of propositions. But
    for common nouns like man, which were
  • 35:32 - 35:37
    properties <e,t> properties of
    individuals we just introduced new types
  • 35:37 - 35:45
    like "man", "book" and so on. And for
    verbs, for example, we define them as
  • 35:45 - 35:49
    functions from one of these types to
    properties. So not just from any
  • 35:49 - 35:57
    individual, but from meaningful domains.
    So, for example, the meaning of talk
  • 35:57 - 36:04
    requires that whoever is talking is
    actually human, because except for a few
  • 36:05 - 36:12
    situations where other things could talk,
    it's usually only a human who talks. And
  • 36:12 - 36:19
    the meaning of mortal is that something
    has to first be alive to be mortal. That's
  • 36:19 - 36:32
    already nice, so we can limit our domains
    of predicates to very meaningful things
  • 36:32 - 36:41
    where people intuitively would say that
    makes sense, but then we end up in the
  • 36:41 - 36:48
    problem. For example, if we have the
    meaning of "Socrates is of type man" and
  • 36:48 - 36:55
    wave "mortal", but mortal is of this type:
    it takes a parameter that's animate and
  • 36:55 - 37:04
    return a property. And now we want to
    interpret "Socrates is mortal" in pretty
  • 37:04 - 37:10
    much the same way as we did it before, or
    in a similar way as we interpreted things
  • 37:10 - 37:17
    before. So we want to apply this meaning
    of "mortal" to Socrates, but we have the
  • 37:17 - 37:24
    problem, that man doesn't match the type
    animate. So how does that work? And the
  • 37:24 - 37:33
    answer to that, to that is we can assume
    subtypes, or we can introduce subtypes. So
  • 37:33 - 37:42
    if we assume that humans are animate and
    men are human. Then we can actually apply
  • 37:43 - 37:48
    the function that takes an animate object
    as a parameter to something that's a man,
  • 37:49 - 37:57
    and also we want to assume that modified
    objects like a heavy book should still be
  • 37:57 - 38:07
    a subtype of book. And fortunately, we can
    do that in the theory. And the final thing
  • 38:07 - 38:20
    is: some functions, so we can already rule
    out some some things, with the … here, if
  • 38:20 - 38:26
    we say that "talk" only works for humans, we
    can already rule out some nonsensical
  • 38:26 - 38:35
    things, but we can use a little bit of
    this proof theoretic a bit more. So if we
  • 38:36 - 38:43
    have this. I hope it's not too
    distracting that it's a bit of a weird
  • 38:43 - 38:48
    syntax. We define a new type which is
    consumable, and we define two objects that
  • 38:48 - 38:55
    are consumable. It's bread and wine. And
    then we define a new type of action with
  • 38:55 - 39:03
    the two actions. One is eat, one is drink.
    And then we define a new type performance,
  • 39:04 - 39:14
    which depends on both a consumable object
    and an action. And then we can construct
  • 39:14 - 39:21
    objects of this performance, by using this
    construct to perform. So the meaning of
  • 39:21 - 39:28
    "drink wine", for example, could be:
    perform, wine, drink. But we can also in
  • 39:28 - 39:36
    this setting define the meaning of "eat
    wine" as: perform, wine, eat. And that's
  • 39:36 - 39:43
    usually something we want to rule out. We
    want to have only to be able to drink wine
  • 39:43 - 39:51
    or to eat bread, but not to eat wine or
    drink bread. And that we can do by
  • 39:52 - 39:58
    defining a new type of, for example,
    edible and drinkable objects, and we
  • 39:58 - 40:08
    define eat bread as edible bread and drink
    wine as drinkable wine, and then we modify
  • 40:08 - 40:17
    our action and performance, that the
    action of eating needs an object of this
  • 40:17 - 40:25
    type edible for the thing we want to
    consume. And this object is kind of the
  • 40:25 - 40:33
    proof that whatever consumable we want to
    eat is actually edible. And then we can
  • 40:34 - 40:43
    still define drink wine. In a pretty
    similar way, but we cannot find any way of
  • 40:44 - 40:51
    performing eat on wine because there is no
    way of constructing an edible object for
  • 40:51 - 41:04
    wine. Which is a very powerful thing of
    modeling how our real world happens to
  • 41:04 - 41:15
    work, and … that pretty much concludes my
    talk. Here are a few references.
  • 41:15 - 41:24
    And now I'm open for questions.
    Herald: Right, so, so far we have one
  • 41:24 - 41:32
    question I see. And the question is: so
    how far can we take this? Has anyone ever
  • 41:32 - 41:37
    formulated a sufficiently detailed type
    system for English or at least some
  • 41:37 - 41:44
    variant of English, which can be used to
    reason about human-written or even
  • 41:44 - 41:49
    informal texts like algorithmic
    language processing?
  • 41:49 - 41:55
    daherb: That's a very good question.
    And that's one of the weak spots of this,
  • 41:55 - 42:03
    that it involves lots of work. And these
    days a lot of research and effort is more
  • 42:03 - 42:11
    on statistical models where you hopefully,
    very hope, that the computer might learn
  • 42:11 - 42:16
    these things. There are a few there,
    there's for example a dataset. So some
  • 42:16 - 42:23
    logicians sat down at some point and made
    many sentences in this style, like "every
  • 42:23 - 42:34
    European has the right to live in Europe"
    and so on. I think it's a few hundred
  • 42:34 - 42:43
    sentences and that's kind of the benchmark
    where people try to test the systems . And
  • 42:43 - 42:50
    that kind of works. I know there are
    systems that can cover the whole benchmark
  • 42:50 - 42:57
    and give the right results, but there are
    other datasets that are not created by
  • 42:57 - 43:02
    logicians, but by everyday people
    crowdsourced on the Internet, and there
  • 43:02 - 43:08
    it's much more difficult to actually agree
    on what is the conclusion?
  • 43:08 - 43:15
    Herald: Okay, so the main problem is that
    there aren't any curated big enough data
  • 43:15 - 43:19
    sets to to check the algorithms against,
    or?
  • 43:19 - 43:26
    daherb: That's part of the problem. But
    it's also, yeah, it's really difficult to
  • 43:26 - 43:33
    make that work for the complete language,
    for really big parts. But if you have a
  • 43:33 - 43:37
    small application, a small domain, then
    it's definitely a feasible thing to do.
  • 43:38 - 43:45
    And it gives you also an explanation of
    why one sentence follows from another,
  • 43:45 - 43:51
    either by giving you the model in which
    these sentences are true or in the modern
  • 43:51 - 43:57
    type theory by giving you a proof. So
    there is lots of research in doing that
  • 43:57 - 44:03
    without logic and just machine learning,
    and they seem to be pretty good. But then
  • 44:05 - 44:09
    sometimes these systems just give you the
    wrong result and you have no idea why. And
  • 44:10 - 44:15
    yeah, that's the balance. So you get the
    highly reliable results from this system,
  • 44:15 - 44:20
    but you have to do a lot of work to get it
    working, or you use a machine learning
  • 44:20 - 44:24
    system which works much broader, but if
    something goes wrong, it's much more
  • 44:24 - 44:26
    difficult to figure out what is exactly
    going wrong.
  • 44:26 - 44:32
    Herald: Okay, thank you very much. We have
    a question from Gordon in the IRC –
  • 44:32 - 44:39
    live.hacc.media for anyone who isn't there
    yet. How you not managed to mention
  • 44:39 - 44:44
    Lojban? I'm not really sure on how to
    pronounce that.
  • 44:44 - 44:53
    daherb: So, um. I don't know too much
    about Lojban except that it's an
  • 44:54 - 45:00
    artificial language that I think was
    designed to have a clear semantics,
  • 45:00 - 45:12
    probably something like first order logic
    so that approach is different and, these
  • 45:12 - 45:19
    people, at least, who work on this, which
    I presented at least could pretend that
  • 45:19 - 45:28
    they work with proper English. Even though
    some people could also turn it around and
  • 45:28 - 45:34
    say they defined a nice formal language,
    which just looks very much like English,
  • 45:34 - 45:42
    but it's actually it's a formal language.
    Herald: Okay, and we have Bob asking
  • 45:42 - 45:46
    whether there is any effort to create a
    combination of a statistical and logical
  • 45:46 - 45:51
    approach, and if not, why hasn't it been
    done or what are the challenges?
  • 45:51 - 46:00
    daherb: There are definitely approaches
    that try to do that. The question
  • 46:00 - 46:05
    is, where do you put the machine learning
    and where do you put the logic and what
  • 46:05 - 46:10
    parts you can replace by machine learning,
    for example? But there is definitely
  • 46:12 - 46:16
    approaches. I think one is called
    CCG Lamda by people in Japan.
  • 46:16 - 46:25
    So there are definitely these approaches.
    Herald: And we have Klondyke asking
  • 46:25 - 46:32
    whether there is any work on trying to
    infer types and rules from the corpuses.
  • 46:32 - 46:37
    daherb: I'm not really aware of
    anything like that.
  • 46:37 - 46:44
    Herald: Did you try generating valid
    sentences by random.
  • 46:47 - 46:52
    daherb: depends on what you define as
    valid sentences. One answer to this
  • 46:52 - 46:59
    question would be I once wrote a Twitter
    bot which generates random sentences which
  • 46:59 - 47:07
    are all total tautologies. So I used many
    of these techniques I presented to
  • 47:07 - 47:13
    generate natural language sentences,
    which all have a certain logic structure.
  • 47:17 - 47:23
    And if you have a system like that,
    generating is usually not a big issue,
  • 47:23 - 47:33
    analysis is usually the bigger issue.
    Herald: Okay, we have one more question
  • 47:33 - 47:39
    where I can get the context to about the
    xkcd cartoon – maybe go back to the slide,
  • 47:39 - 47:45
    and they want to know whether you can say
    something about why there are many
  • 47:45 - 47:51
    competing syntax trees for the same
    language or more like what the tree is
  • 47:51 - 47:58
    exactly for, what are the differences
    daherb: In this, the main difference is
  • 47:58 - 48:05
    how much effort you want to put into the
    analysis. So the syntax tree at
  • 48:05 - 48:14
    the top left is basically textbook
    level. It gives a very simple analysis and
  • 48:15 - 48:18
    from a linguistic point of view, people
    could argue what exactly is, for example,
  • 48:18 - 48:30
    this category for copula. And the other
    two sentences are kind of – I don't want
  • 48:30 - 48:34
    to really say competing syntactic
    theories, so there are lots of theories,
  • 48:35 - 48:40
    where they try to explain how natural languages
    work. I said people are really good at
  • 48:40 - 48:48
    drawing trees, but they still struggle to
    explain certain things. And over the last
  • 48:49 - 48:55
    almost hundred years, people came up with
    lots and lots of theories, how syntax
  • 48:55 - 49:03
    actually works. And these theories usually
    have nice advantages and on the other
  • 49:03 - 49:09
    hand, drawbacks. So the syntax tree on the
    top right is called combinatory categorial
  • 49:09 - 49:19
    grammars and it uses categories which are
    also kind of function types. So NP/N and
  • 49:19 - 49:29
    can be seen as a function which takes a N
    as a parameter on the right and generates an
  • 49:29 - 49:35
    NP. So the syntactic categories are kind
    of in parallel to the semantic categories.
  • 49:37 - 49:42
    And that way it's easy to translate from
    the syntax tree into the semantic
  • 49:42 - 49:48
    representation while for other syntax
    formalisms it might be more challenging to
  • 49:48 - 49:53
    to do that. So it strongly depends what
    you want to do, how to express that
  • 49:53 - 50:03
    concept. Yeah, it goes a bit in the
    direction of this xkcd. I can subscribe to
  • 50:03 - 50:07
    any dozen of contradictory models and
    still be taken seriously.
  • 50:07 - 50:16
    Herald: Okay, are there any issues on
    these trees with garden path sentences?
  • 50:16 - 50:22
    daherb: I should know more about
    garden path entrances because it's one of
  • 50:22 - 50:30
    the main examples where things go wrong.
    At the moment. I cannot really answer
  • 50:30 - 50:39
    that. I try to give a simple high
    level overview of it. And there are many
  • 50:39 - 50:45
    interesting problems: garden path
    sentences, donkey sentences, where syntax
  • 50:45 - 50:52
    or semantics or both can go wrong.
    Herald: Okay, so far, I don't see any more
  • 50:52 - 51:00
    questions, so I would like to know from
    you, how does one get into type
  • 51:00 - 51:08
    theory or language analytics or semantics
    daherb: Hanging out with the wrong people
  • 51:09 - 51:17
    or, yeah. So computational linguistics is
    a pretty established field these days, so
  • 51:18 - 51:26
    it's what people call interdisciplinary,
    it's taking a lot of computer science and
  • 51:26 - 51:32
    hopefully still a bit of linguistics, and
    then you try to tackle certain problems.
  • 51:32 - 51:39
    And one of the big problems of natural
    language is what do they mean? And when
  • 51:39 - 51:46
    you study that, for example, then you get
    some you learn something about it, and if
  • 51:46 - 51:51
    you're curious about it, you can put
    research into it. And to be honest, my
  • 51:51 - 51:56
    research was something completely
    different. But the topic of semantics was
  • 51:56 - 52:00
    kind of one of the reasons why I wanted to
    do some more research and stay in
  • 52:00 - 52:08
    academia.
    Herald: Okay, thank you. Back again to AI
  • 52:09 - 52:15
    language processing. Do you think there is
    a kind of new, bigger field coming? Well,
  • 52:15 - 52:20
    there was the last few years with natural
    language processing getting more and more
  • 52:20 - 52:26
    accessible to the public and better. And
    do you think that there is still a chance
  • 52:26 - 52:32
    for only analytical approaches, or do you
    think that AI will be in the end, more
  • 52:32 - 52:38
    prevalent?
    daherb: So actually, if you look at the
  • 52:38 - 52:43
    research output in recent years, then you
    only find a little bit about what I was
  • 52:43 - 52:52
    talking about and you find a lot about
    … what I have listed here as statistical
  • 52:52 - 52:58
    approaches, especially language models. I
    guess most people who haven't been away
  • 52:58 - 53:04
    from the Internet in the last few months
    have at least heard a little bit about,
  • 53:04 - 53:11
    for example, GPT-3, which is one of these
    fancy AI models which you can use for
  • 53:11 - 53:17
    generating text based on some
    sentence to start the text. Or people even
  • 53:17 - 53:26
    implemented a dungeon crawl text adventure
    using it. So that's the hot shit in in
  • 53:26 - 53:34
    research, kind of. But these suffer from
    this problem that as soon as something
  • 53:34 - 53:40
    goes wrong, it's really difficult to
    figure out what's going wrong. And you
  • 53:40 - 53:46
    need shitloads of data.
    Herald: Okay, we have some more questions.
  • 53:46 - 53:51
    Just came in. We have some book
    recommendations in the IRC if anyone is
  • 53:51 - 53:59
    interested. And we have one person asking
    whether a function word like conjunctions
  • 53:59 - 54:05
    or some grammar like that-clauses can be
    present in type systems.
  • 54:05 - 54:14
    daherb: So I haven't done anything
    about conjunction and so on. In the simply
  • 54:14 - 54:23
    typed language, they are just translated
    to their logic operators. So you only have
  • 54:23 - 54:28
    usually conjunctions on the sentence level
    so you could make sentences. "John loves
  • 54:28 - 54:35
    Mary" and "Mary sleeps". And because the
    type of sentence is t, which is truth
  • 54:35 - 54:40
    value, which is kind of a boolean
    variable, you can use boolean operations
  • 54:40 - 54:45
    on it. So you analyze the first sentence
    and then you analyze the second sentence
  • 54:45 - 54:51
    and then you check if the logic
    conjunction holds between them. And if you
  • 54:51 - 54:57
    translate that in into models, conjunction
    can also be translated into the set operation
  • 54:57 - 55:05
    of intersection. So conjunctions
    and disjunctions like the
  • 55:05 - 55:10
    function words "and" and "or" are pretty
    easy, or still rather easy to express.
  • 55:13 - 55:19
    There is, …, still many, many challenges
    which into which I couldn't go in the
  • 55:19 - 55:24
    time.
    Herald: Okay. I think that answers the
  • 55:24 - 55:30
    question from before. And there is also a
    new one: This "for all" thing. I always
  • 55:30 - 55:34
    thought that required dependent types. Did
    I miss something or is that actually
  • 55:34 - 55:40
    wrong?
    daherb: If it is a simply typed
  • 55:40 - 55:49
    language, then it doesn't require
    dependent types. There is is an equivalent
  • 55:50 - 55:57
    to the "for all" in dependent types – in
    dependently typed languages. I think that
  • 55:57 - 56:03
    should be the Pi types which are
    dependent function types, but in a simply
  • 56:03 - 56:08
    typed language you just have the forall
    operator.
  • 56:08 - 56:19
    Herald: Okay. Are there new questions? I
    think there are. Can you recommend an intro
  • 56:19 - 56:26
    to linguistics or a book? I think we just
    had some, but maybe, you know, some off
  • 56:26 - 56:35
    the top of your mind.
    daherb: So except for the ones I have in
  • 56:35 - 56:43
    my literature list, there are a few books
    by a professor called Emily Bender, which
  • 56:43 - 56:49
    she coauthored with other people. One is
    about syntax, one is about semantics. And
  • 56:49 - 56:52
    I haven't read them myself, but I think
    they are pretty good from what I heard.
  • 56:55 - 56:59
    Because they also bridge between the
    linguistic knowledge and the requirements
  • 56:59 - 57:02
    you have these days with more
    computational.
  • 57:02 - 57:18
    Herald: Okay. I think, I'm not sure
    whether the "no" is directed towards me or
  • 57:18 - 57:22
    you, but apparently some of these were
    only programing language books, so
  • 57:22 - 57:27
    probably the ones in the IRC. There is
    also a question relayed from Twitter
  • 57:29 - 57:33
    whether semantic web still is a thing in
    your community.
  • 57:35 - 57:44
    daherb: It's a community on its own. And I
    don't know too much about it. It it's
  • 57:44 - 57:48
    definitely still a thing. There are still
    people working on it, but I cannot say too
  • 57:48 - 57:55
    much about it. I think that was probably
    going in this direction, new attempts for
  • 57:55 - 58:05
    multilingual Wikipedia, where you use
    semantic representation for the Wikipedia
  • 58:05 - 58:11
    page and then use that to generate the
    articles in various languages.
  • 58:11 - 58:21
    Herald: Okay, I think the end –
    daherb: And of course,
  • 58:21 - 58:24
    Herald: The IRC, you're already satisfied
  • 58:24 - 58:31
    daherb: Maybe another answer to the
    semantics web and in addition, an answer
  • 58:31 - 58:36
    to a question that was before about
    actually inferring these types somehow is
  • 58:36 - 58:41
    so what you can do with
    these types, especially with expressive
  • 58:41 - 58:46
    types, is you kind of create something
    that's called an ontology, which is in a way
  • 58:46 - 58:54
    a representation of the world. So what I
    try to do here is I define what is edible,
  • 58:54 - 59:03
    what is drinkable, and it's tedious to
    hard code all these things about the
  • 59:03 - 59:09
    world. And a lot of this is represented in
    either datasets or, for example, in the
  • 59:09 - 59:15
    semantic web. So people already put effort
    into encoding that somehow and then you
  • 59:15 - 59:23
    just need to extract it and use it.
    Herald: Okay, we are already at the end
  • 59:23 - 59:28
    of time, there is three minutes left. We
    have one more question. I think after that
  • 59:28 - 59:36
    we'll close it: And are you aware of
    natural language, hand-wavy formal text
  • 59:37 - 59:39
    like codes of law which have been type
    checked?
  • 59:39 - 59:48
    daherb: I know that there are people
    who spend their whole Ph.D. on trying to
  • 59:48 - 59:57
    formalize law texts.
    I think there was also
  • 59:57 - 60:02
    some work on formalizing the GDPR, but
    I heard about a few of these things, but
  • 60:02 - 60:08
    I'm not fully aware of what's available
    and where it is available.
  • 60:08 - 60:15
    Herald: Okay, so if you don't have anything
    more to say, say so. And apart from that,
  • 60:15 - 60:20
    I think we are done here,
    at least for my part.
  • 60:20 - 60:25
    daherb: Yep, then thanks for listening!
  • 60:25 - 60:28
    postroll music
  • 60:28 - 60:38
    Subtitles created by c3subtitles.de
    in the year 2021. Join, and help us!
Title:
#rC3 Type theory and meaning in linguistics
Description:

more » « less
Video Language:
English
Duration:
01:00:54

English subtitles

Revisions