160 likes | 311 Views
Introduction to Computational Linguistics. Finite State Machines (derived from Ken Beesley). Language and Notation. LANGUAGE. = a set of strings. NOTATION. = a specialised formalism. NOTATION sing s[aiou]ng s.ng (sing|song) [0-9] [0-9][0-9] [0-9]*. LANGUAGE sing
E N D
Introduction toComputational Linguistics Finite State Machines (derived from Ken Beesley)
Language and Notation LANGUAGE = a set of strings NOTATION = a specialised formalism
NOTATION sing s[aiou]ng s.ng (sing|song) [0-9] [0-9][0-9] [0-9]* LANGUAGE sing sang, sing,song,sung sang, sing,song,sung… sing,song 0,1,2,3,4,5,6,7,8,9 01,02,03,...99 0…9,00…99,000…999… Language and Notation
MACHINE Languages,Notations and Machines LANGUAGE NOTATION
FINITE STATE MACHINE Regular Languages and Finite State Machines REGULAR LANGUAGE describe recognise REGULAR EXPRESSION
Physical Machines with Finite States • The Lightswitch Machine PUSH UP OFF ON PUSH DOWN
Physical Machines with Finite States • The Lightswitch Toggle Machine PUSH OFF ON PUSH
Physical Machines with Finite States • The Fan in Ken Beesley’s Old Car R R R LOW MED HI OFF L L L
Physical Machines with Finite States • Three-Way Lightswitch R R R LOW MED HI OFF R
The Cola Machine • Need to enter 25 cents (USA) to get a drink • Accepts the following coins: • Nickel = 5 cents • Dime = 10 cents • Quarter = 25 cents • For simplicity, our machine needs exact change • We will model only the coin-accepting mechanism
Physical Machines with Finite States • The Cola Machine Start State Final/Accept State N N N N N 5 10 15 20 25 0 D D D D Q
Finite State Automaton • A Finite State Automaton comprises: • An alphabet (a set of symbols) • A set of states of which • one or more is a start state • one or more is a final state • A transition function indicating the transitions between states according to symbols from the alphabet.
Finite State Recognition • A given FSM recognises a string if, from the start state, there is a path to a final state in which each transition is licenced by the transition function applied to successive characters in the string. • An FSM recognises a language if it recognises every string in the language.
The Cola Machine Language • List of all the sequences of coins accepted: • Q • DDN • DND • NDD • DNNN • NDNN • NNDN • NNND • NNNNN • Think of the coins as SYMBOLS or CHARACTERS • The set of symbols accepted is the ALPHABET of the machine • Think of sequences of coins as WORDS or “strings” • The set of words accepted by the machine is its LANGUAGE
Linguistic Machines a n t o c t g i r e m a e s “Apply” m e s a
A Morphological Analyzer Lexical Word Language DOG +PL FSTransducer Surface Word Language DOGS