Upload
ruben-bos
View
226
Download
4
Embed Size (px)
Citation preview
Taaltheorie en Taalverwerking
Bachelor Kunstmatige Intelligentie
Vorm van deze cursus:
Elke week:
• Hoorcollege• Huiswerk• Werkcollege• Oefenopdrachten
Vorm van deze cursus:
Elke week:
• Hoorcollege (Remko Scha)• Huiswerk (Prolog-opdrachten)• Werkcollege (Tikitu de Jager)• Oefenopdrachten
Vorm van deze cursus:
Elke week:
• Hoorcollege (Remko Scha)• Huiswerk (Prolog-opdrachten)• Werkcollege (Tikitu de Jager)• Oefenopdrachten
Ingangseis:
Enige vaardigheid in Prolog programmeren
Vorm van deze cursus:
Elke week:
• Hoorcollege (Remko Scha)• Huiswerk (Prolog-opdrachten)• Werkcollege (Wouter Josemans)• Oefenopdrachten
Ingangseis:
Enige vaardigheid in Prolog programmeren Niet: Andere vakken.Ook niet: tentamen Prolog
Jurafsky & Martin: Speech and Language Processing
eerste editie (online: blackboard course documents) of tweede editie (te koop)
[Ook een klein stukje uit: Russell & Norvig: Artificial Intelligence: a Modern Approach.]
Taaltheorie & Taalverwerking=
Inleiding Computerlinguïstiek=
Inleiding Taaltechnologie
Taalverwerking
Cognitie Toepassingen
Cognitie Toepassingen:
Machine TranslationInformation RetrievalQuestion Answering
Taalverwerking
Taaltheorie (Linguïstiek)
Linguïstiek: Taal-analyse op verschillende niveau's:
Fonetiek/Fonologie: Geluid
Morfologie: Woord-structuur
Lexicon: Woorden
Syntax: Zins-structuur
Discourse: Text
Syntax: Structuur
Semantiek: Betekenis
Pragmatiek: Gebruik
Linguïstiek: Taal-analyse in verschillende dimensies:
Onze focus: de interpretatie van tekst.[Derdejaars-college Zeevat: Discourse]
Linguïstiek & A.I.
Onze focus: de interpretatie van tekst.[Derdejaars-college Zeevat: Discourse]
Daarom eerst: de interpretatie van zinnen.[Tweedejaars-college Scha: Natuurlijke-Taal Interfaces]
Linguïstiek & A.I.
Onze focus: de interpretatie van tekst.[Derdejaars-college Zeevat: Discourse]
Daarom eerst: de interpretatie van zinnen.[Tweedejaars-college Scha: Natuurlijke-Taal Interfaces]
Daarom eerst: de structuur van zinnen.[Dit college.]
Linguïstiek & A.I.
Inhoud van deze cursus:
"Taaltheorie en Taalverwerking"
=
Formele Linguïstiek & Computerlinguïstiek
Inhoud van deze cursus:
Blok a: Structuur van woorden en zinnen (morfologie en syntax):
• Formele Talen en Automaten
• Formele Grammatica's
• Analyse-algoritmes t.b.v. zulke grammatica's
Inhoud van deze cursus:
Blok b:
• Semantiek (Betekenis)
• Discourse (Tekst & Dialoog)
• Toepassingen (b.v.: Machine Translation)
Formele Linguïstiek
Basics Computerlinguïstiek
Logica Machine Learning
Advanced Computerlinguïstiek
Week 1: Formele talen en automaten.
Deel 1: Reguliere Expressies & Eindige-Toestands-Automaten.
Theorie der Formele Talen en Automaten.
Wiskunde over verzamelingen strings.
Uitgevonden door: Noam ChomskyKlassiek overzichtsboek: Hopcroft & Ullman
Prettig leerboek: Peter Linz
Theorie der Formele Talen en Automaten.
String: Sequentie van discrete symbolen, afkomstig uit een gegeven "alphabet".
Theorie der Formele Talen en Automaten.
String: Sequentie van discrete symbolen, afkomstig uit een gegeven "alphabet".
Taal: Verzameling strings.
Theorie der Formele Talen en Automaten.
String: Sequentie van discrete symbolen, afkomstig uit een gegeven "alphabet".
Taal: Verzameling strings.
Grammatica: Definitie van een taal.
Theorie der Formele Talen en Automaten.
String: Sequentie van discrete symbolen, afkomstig uit een gegeven "alphabet".
Taal: Verzameling strings.
Grammatica: Definitie van een taal.Automaat: "Implementatie" van een grammatica.
Grammatica's en automaten heb je in soorten:meer of minder "krachtige".
We beginnen nu met de eenvoudigste.
Grammatica's en automaten heb je in soorten:meer en minder "krachtige".
We beginnen nu met de eenvoudigste:
Reguliere Expressies & Finite State Automata
Grammatica's en automaten heb je in soorten:meer en minder "krachtige".
We beginnen nu met de eenvoudigste:
Reguliere Expressies & Finite State Automata
[Volgende week: hiërarchie van verschillendesoorten grammatica's en automaten.]
Formele talen.
Neem aan: alphabet: a...z en Talen b.v.:
{ab, ad, da, }{ab}{, ab, abab, ababab, abababab, .....}{ab, aabb, aaabbb, aaaabbbb, ...}
Reguliere expressies:
Strings: ab --> {ab}
Disjunctie:(ab | bc) -->{ab, bc}
Kleene Star: (ab)* --> {, ab, abab, ababab,
abababab, ...}Concatenatie:
(ab)*c -->{c, abc, ababc, abababc, ...}
Reguliere expressies
(a | b)*c -->
Reguliere expressies
(a | b)*c -->{c, ac, bc, aac, abc, bac, bbc, ...}
Reguliere expressies
(a | b)*c -->{c, ac, bc, aac, abc, bac, bbc, ...}
(a*c) | (b*c) -->{c, ac, aac,aaac, ..., bc, bb, bbbc, ...}
Reguliere expressies in Perl e.d.:
Heel veel "syntactic sugar":
• negatie• optionaliteit• minstens één• [0-9], [a-z]• wildcard• etc.
Finite State Automata
• Ook wel genoemd: Finite State Machines, Finite Automata, Eindige-Toestands-Automaten, Eindige Automaten
• Ander formalisme, equivalent aan Reguliere Expressies
FSAs als Grafen
FSAs als Grafen
J & M: "Schapentaal":
baa(a)*!
FSAs als Grafen
J & M: "Schapentaal": baa(a)*!
Sheep FSA
We can say the following things about this machineIt has 5 states
At least b,a, and ! are in its alphabet
q0 is the start state
q4 is an accept state
It has 5 transitions
But note
• There are other machines that correspond to this language
More Formally: Defining an FSA
We specify an FSA by enumerating the following things:
The set of states: Q
A finite alphabet: A
A start state q0
A set F of accepting/final states F Q
A transition function (q,i) that maps QxA to Q
Transition function can be represented by a state-transition table:
Recognition
• Recognition is the process of determining if a string is accepted by a machine
• It is the process of determining if a string is in the language defined by the machine
Recognition
• Start in the start state
• Examine the current input
• Consult the table
• Go to a new state and update the tape pointer.
D-Recognize
• FSAs can be viewed from two perspectives:– Acceptors that can tell you if a string is in the
language– Generators to produce all and only the strings
in the language
Dollars and Cents
Non-Determinism
Non-Determinism
Epsilon transitions do not examine or advance the tape during recognition
Equivalence
• Non-deterministic machines can be converted to deterministic ones
• That means that they have the same power; non-deterministic machines are not more powerful than deterministic ones
Going from Regular Expressions to FSA
All regular expression operators can be implemented by combinations of concatenation, disjunction, and closure
So if we could just show how to turn closure/union/concat from regexps to FSAs, this would give an idea of how FSA compilation works.
Take any regular expression and build an automaton
Intuition: inductionBase case: build an automaton for single symbol (say ‘a’)Inductive step: Show how to imitate the 3 regexp operations in
automata
Disjunction
Accept a string in either of two languages
Concatenation
Accept a string consisting of a string from language L1 followed by a string from language L2.
Closure
Verbind de eindtoestanden met de begintoestand met een epsilon-arc.
Opgaven
Wekelijks per email verzenden aan [email protected] met cc aan [email protected]
Vermeld in de subject-heading: "TTTV".
Gezamenlijke inzending door groepjes van twee personen wordt toegestaan en zelfs aangemoedigd.
Eindcijfer
Eindcijfer is het gemiddelde van het gemiddelde cijfer van alle opdrachten en het cijfer van het tentamen, met dien verstande dat beide voldoende moeten zijn.
Er is een tussentoets in week 8.
http://iaaa.nl/TTTV/