Docsity

Computational linguistics Lectures notes 3 - C. Chesi, Appunti di Linguistica

Toggle sidebar
bg1
16.11.18
LEXICON, MORPHOLOGY… AND NON‐STANDARD ORTHOGRAPHY
Essential references
Jurafsky, D. & Martin, J. H. (2009) Speech and Language Processing. Prentice‐Hall. (2nd edition)
http://www.cs.colorado.edu/~martin/slp.html Chapter 3
Extended references
●Koskenniemi, K. (1983) Two‐level morphology: A general computational model for word‐
form recognition and production. Helsinki
●Miller & al. (1993) Introduction to WordNet: An On‐line Lexical Database. ms.
●PustejovskyJ. (1995) The Generative Lexicon. MIT Press
●Levin B. (1993) English Verb Classes and Alternations. The University of Chicago Press.
Index:
Lexicon and Morphology
●Organizing lexical entries
●Two‐levels morphology
●Morphological analysis with FiniteStateAutomata (FSA) and FiniteStateTransducers (FST)
●Some simple application and psycholinguistic reality: stemming
Input normalization
●Intro to orthographic correction
●Error classification
●Spell‐checking methods
●T9 and Swipe
Generative lexicon
Include in the lexicon any inflected word as independent and «atomic»?
●It will be inefficient:
GL was initially developed as a theoretical framework for encoding selectional knowledge in natural
language. This in turn required making some changes in the formal rules of representation and
composition. Perhaps the most controversial aspect of GL has been the manner in which lexically encoded
knowledge is exploited in the construction of interpretations for linguistic utterances. The computational
resources available to a lexical item within this theory consist of the following four levels:
1. Lexical Typing Structure: giving an explicit type for a word positioned within a type system for
the language;
2. Argument Structure: specifying the number and nature of the arguments to a predicate;
3. Event Structure: defining the event type of the expression and any subeventual structure it may
have; with subevents;
4. Qualia Structure: a structural differentiation of the predicative force for a lexical item.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Anteprima parziale del testo

Scarica Computational linguistics Lectures notes 3 - C. Chesi e più Appunti in PDF di Linguistica solo su Docsity!

LEXICON, MORPHOLOGY… AND NON‐STANDARD ORTHOGRAPHY

Essential references Jurafsky, D. & Martin, J. H. (2009) Speech and Language Processing. Prentice‐Hall. (2nd edition) http://www.cs.colorado.edu/~martin/slp.html Chapter 3 Extended references ●Koskenniemi, K. (1983) Two‐level morphology: A general computational model for word‐ form recognition and production. Helsinki ●Miller & al. (1993) Introduction to WordNet: An On‐line Lexical Database. ms. ●PustejovskyJ. (1995) The Generative Lexicon. MIT Press ●Levin B. (1993) English Verb Classes and Alternations. The University of Chicago Press. Index: Lexicon and Morphology ●Organizing lexical entries ●Two‐levels morphology ●Morphological analysis with FiniteStateAutomata (FSA) and FiniteStateTransducers (FST) ●Some simple application and psycholinguistic reality: stemming Input normalization ●Intro to orthographic correction ●Error classification ●Spell‐checking methods ●T9 and Swipe Generative lexicon Include in the lexicon any inflected word as independent and «atomic»? ●It will be inefficient: GL was initially developed as a theoretical framework for encoding selectional knowledge in natural language. This in turn required making some changes in the formal rules of representation and composition. Perhaps the most controversial aspect of GL has been the manner in which lexically encoded knowledge is exploited in the construction of interpretations for linguistic utterances. The computational resources available to a lexical item within this theory consist of the following four levels:

  1. Lexical Typing Structure: giving an explicit type for a word positioned within a type system for the language;
  2. Argument Structure: specifying the number and nature of the arguments to a predicate;
  3. Event Structure: defining the event type of the expression and any subeventual structure it may have; with subevents;
  4. Qualia Structure: a structural differentiation of the predicative force for a lexical item.

●in Turkish (agglutinative language) there would be 600x106entries. In Finnish 107 ●It will be non‐informative:

  • No relation among lexical entries (alphabetic order is not interesting)
  • No processing hints (nouns = verbs?) A computational lexicon can be conceived as: ●Mental lexicon – the relation among lexical units are psycholinguistically plausible? ●Computational lexicon – is the lexical representation efficient? Rule of thumb: ●Lexical representation must be explicit and independent(with respect to the application that will use it) ●Global structure of lexical entries is as important as internal structure ●A lexicon must have a sufficient domain coverage (consider nearly 400.000 lexical entries) Computational Lexicon evaluation parameters:
  • Coverage(sufficient domain extension, and depth, also in terms of featural information)
  • Extensibility (how easy it is enriching the lexicon?)
  • Utility (single application benefit) ! Remember: ●completeness does not ensure correctness (neither psycholinguisticnor computational) ●psycholinguistic plausibility does not guarantee computational effectiveness (and the way around) Single entry structure: ●orthographic/phonetic information ●morphology(inherent features like number, gendered...) ●syntactic(POS and more fine grained features: mass/countable, animacy, selection…) ●semantic(semantic relations, useful information for Machine Translation) CASA (“house”) <C,A,S,A> {N, sing, fem ...} {N com ...} [house] E.g. XML coding for the “casa” («house») entry: <word cat=“noun" subcat="common.countable" num="sg" gen="f" sem="c12"> casa Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.

Global structure of the lexicon: semantic networks Global lexicon structure ●Subcategorization (and alternation Levin 1993) might be correlated with semantic class ●We could draw immediate inferences on the basis of the hierarchical organization of the items in an ontology (part_of, member_of…) Wordnet (Miller 90) ●Example of semantic network (goal: organizing the lexicon on the basis of the meaning rather than orthography) based on the following principles:

  • Relation amongnouns (hierarchy and inheritance), verb (implicatures), adjectival and adver bials (oppositions) (but no functional words are included)
  • Every lexical concept (synset) can be represented using their synonims(other synsets)
  • Kind of relations used:
    • Hyponymy(relation between a more concept general (bird) and a more specific one «robin»; “robin” is an hyponym of “bird”) •Hypernymy (inverse of hyponymy)
    • Meronimy(part_of)...
  • Representation of the «semantic ambiguity» problem: polysemy(cane= animal and cane = part of a gun, are two distinct synsets in wordnet) Semantic Relations example (Miller 1993) It is a representation of our domain of knowledge. We use it as an anthology to see how words are related to others. The knows, puts in relation the words. DYNSET: semantic tagging In every language, we have 3 types of ambiguities: lexical, syntactic and semantic WordNet is a lexical database for the English language. It groups English words into sets of synonyms called synsets, provides short definitions and usage examples, and records a number of relations among these synonym sets or their members. WordNet can thus be seen as a combination of dictionary and thesaurus. While it is accessible to human users via a web browser,its primary use is in automatic text analysis and artificial intelligence applications.

Morphology – the theoretical model We have a surface form (token) and then we want to retrieve the lexical form (lemma). There are two levels of morphology: surface and deep form (lexical). Goal: recognizing a well‐formed string and decompose it in morphemes Theoretical model: Recognize lexicon tools: FSA and 2 level morphology Morphological analysis with FSA An FSA can be used for recognizing or generating a lexical item, but also for representing the Lexicon. FSA recognizing casa and its plural Morphological analysis FSA and two‐level morphology FSA limits no memory: it is not possible toassociatea structural description to an element recognized as belong ing to the lexicon, simple FSAs are not sufficient (since it does not exist an external memory, there is no way to keep track of the derivation). Koskenniemi(83) two_level morphology: a lexical leveland a superficial onethat must be put in a specific relation one with the other. We use Finite‐State Transducers(FST) to do so. Morphological analysis with FSTs Finite‐State Transducers(FST, o Transducers) <Q, Σ, q0, F, δ>: ●Σ= finite, non_null alphabet, input special (complex) chars of the form i:o where iare symbols of t he input alphabetI and o are symbols of the output alphabet O. Σ Є IxO. ε (the null element) can be included both in I and in O ●δ= is defined as (q , q', i: o) and it represents a transition matrix putting in relation a state q(start) with a state q′ (arrival) if the i: o relation is defined. δ is then a relation from Q x Σ to Q

Inadequacy of FSTs (and FSA) to express any morphological phenomena There are languages that present morphological derivations more complex than the one described. Such phenomena fall in the class of what we call non‐concatenative morphology

  • Tagalog(Philippine dialect) uses infixes in the middle of a word: um(marks the agent) + hingi(«lend») = h‐um‐ingi(«lend to someone»)
  • Semitic languages, template morphology: consonant roots (CCC) lmd(«learn») + inflection by vocalic schemes (CVCVC) = lamad(«learned») lumad(«was learned») On inadequacy of FSTs (and FSA) Problems: ●Non‐determinism(multiple transition from the same state qmight be pursued; ε transitions) ●Inadequacy(e.g. non‐concatenative morphology) ●Order of application of FSAs Morphological analysis: some application
  • Information extraction (web, unstructured corpora/digital archives)
  • Keywords expansion: (hotels in Florence = (hotel AND Florence) OR (hotels AND Florence))
  • Stemming: retrieving the word root (stem) we can refine queries and make them more tolerant
  • Porter Stemming Algorithm simple set of cascade FSTs like: ATIONAL ‐> ATE (e.g. relational ‐> relate) ING ‐> ε (talking ‐> talk) pros e cons:
  • Ipergeneralization(Krovetz93) e.g. organization > organ, generalization > generic,
  • Non captured exception : matrices > matrix or European > Europe.
  • Stemming is useful only with expansive research (no standard information retrieval) Morphological analysis: psycholinguistic plausibility How is the mental lexicon structured? ●full listing hypothesis_runs and run, are two lexical entries in the mental lexicon (no internal morphological structure) ●minimum redundancy_only morphemes are encoded in the mental lexicon; accessing an inflected lexical item requires accessing distinct morphemes and combination rules Evidence for a structured lexicon: ●Priming Effects (Stannersad al. 79) irregular inflections: happiness, happilyno priming with the root happyVs. regular inflections: pouring> pour

●Semantic affinity(Marslen‐Wilson 94) government> govern ●Pronunciation errors(Fromkine Ratner 98) *easy enoughlyvs√easilyenough This suggests that some information of the morhemicstructure of the word should be encoded in our mental lexicon. Error Classification Different levels,different strategies/resources: ●lexical ●syntactic ●semantic ●pragmatic Remember that an error may be a true error,or a system error :e.g. at the lexical level a word could not be present in the lexicon, but present in the language (system error) or the result of a typo or a wrong belief on the orthography (true error) Kinds of error correction approaches Main idea: pattern matchingagainst lexical items stored in the repository + some heuristics to find the most suitable candidates for substitution ●Symbolic methods (good representation of the problem) ●Sub‐symbolic methods (Machine Learning approach) Error Correction Minimal Distance (Damerau 64, Wagner 74) It is the minimal number of steps we have to make to pass from an incorrect form to a correct one. ●the best alternative is the one that minimizes the number of insertions, deletions, substitutions and switching of chars ●Compare the form with any possible transformation of this form and verify if there are alternatives present in the lexicon ●This is very inefficient, at worst, we should compare the derived form with any lexical item in the vocabulary! ➔ Similarity Key (SOUNDEX algorithm, Odell e Russel1918, Davidson 1962) ●Procedure: extract a key from the wrong form; extract the keys from all lexical items; compare the keys and provide as correction the lexical items sharing the same key ●Key= first letter of the word + sequence of numbers associated to the chars (according to some frequency calculus); «0» items (vowels) and repeated numbers are reported only once

Error correction in specific contexts: T Linguistic resources needed for T ●Dictionary ●Frequencies (e.g. typing 6 _6, “ON” will be preferred to “NO”. This is determined on the b asis of statistical observations: in this case, the British National Corpus. The alternative choi ce is required about 5% of the time in English T9!) Non linguistic resources to evaluate the model efficiency ●Fitts’ Law (modeling rapid, goal‐directed movements) Results (in Words Per Minutes, wpm) ●Multi‐press:25‐27 wpm ●Two‐key:22‐25 wpm ●T9:41‐46 wpm Today’s key concepts What is a Computational Lexicon ●Single entry structure (morpho‐syntactic features) ●Global structure (Wordnet) How do we deal with morphological analysis ●Two‐level morphology and FST ●Some application (stemming) ●The psycholinguistic plausibility of the model Input normalization and spell‐checking ●Error classification ●Standard approach to spell correction (minimal distance, similarity keys, ngrams) ●The case of T

SYNTACTIC PARSING

Computability and complexity ●Space/time complexity ●Grammatical complexity ●Psycholinguistic complexity Parsing algorithms ●Exploring the problem space created by the grammar ●Main algorithms •top‐down Vs. bottom‐up •left‐corner •Dynamic programming and Earley algorithm References Essential references (http://www.ciscl.unisi.it/master/materials.htm) ●Jurafsky, D. & Martin, J. H. (2009) Speech and Language Processing. Prentice‐Hall. (2nd edition) http://www.cs.colorado.edu/~martin/slp.html Chapter 13, 15 Extended references ●BartonG.E., BerwickR. & RistadE.S. 1987. Computational Complexity and Natural Language. M IT PressShank ●Hale, J. T. (2011). What a rational parser would do.Cognitive Science,35(3), 399‐443. ●Van de KootH. The Computational Complexity of natural language recognition. Ms. University C ollege London Why having a computational model: - Predict possible dysfunctions

  • Calculate the complexity of certain processes A → B → C We have a process in a and then we pass through b to go to c but if it is impossible to pass through b we cannot then reach c. Assuming that we have a problem to solve: put in order some numbers, i.e. a sorting problem. Pick each element and put them in order. The complexity is proportional to the number of elements that we have and so to the number of comparisons we have to make.

It is a basic way to describe a computation. Is a represented as an infinite tape and on each cell of this tape we have numbers or also letters. Then we have a cursor that is able to read, move and write. This gives us the possibility to add or move information on the tape. Sometimes Turing machines can enter in loop, so deal with a computation that never ends is problematic because it alters our idea of knowledge. There is another way to express a computation: flow charts We have an input, a condition and blocks that contain information. Then thanks to a computation, i.e. that alteration of the info we have, we then reach an output. Modularity Turing Machines and flow charts are equivalent: they express the very same class of function (computable functions) Both formalisms guarantee compositionality (M1 ° M2). Hence: “divide et impera” is a programming paradigm that suggests decoupling a problem in small er sub‐problems for which a solution would be easier to be found. Complexity Complexity is directly proportional to the resource usage: ●Time (time complexity): number of elementary steps needed ●Memory (space complexity): quantity of information to be stored at each step Complexity is directly proportional to the problem dimension (e.g. ordering 1000 words will be mo re complex that ordering 10 words); Grammar complexity should be related to its generative power. The problem dimension is expressed in terms of input length to be processed The order of complexity should be expressed in terms of input length, e.g.: A flowchart is a type of diagram that represents an algorithm, workflow or process. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation illustrates a solution model to a given problem. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields.

c∙n^2 (example of polynomial time problem complexity) n = input length c = costant data (depending on the kind of computation) In this case we will say that the complexity order of the problem is n^2 since the constant will be irrelevant with respect to n growing to the infinite. Such complexity order is defined as: O(n^2 ) We are interested in the growing rate of the complexity expressing the mapping between input and output in terms of input dimension For space and time limited problems (resource usage surely finite) the complexity calculus is irrele vant For n growing to the infinite, as in the case of the grammars we want to study, the growing rate is crucial for determining the tractability of the problem A problem is considered computable/tractable if a procedure exists and terminates with an answer ( positive or negative) in a finite amount of time. A problem with exponential time complexity (e.g. O(2N) ) will be hardly computable in a reasonable amount of time. To have an idea, assume a device able to deal with 1 million steps per second, there the calculation for specific input given specific complexity function: If we have to process a great amount of words, we have to include a lot of space and time to process it. The longer is the sentence, the longer is the time that we need to process it. According to the kind of function we have, we may have something like this table. There is a processor that deals with 1 mln operations per second. ¬ ∨ ∧ Complexity of classic problems 3SAT problem (satisfability problemor SAT) find a value assignment for all propositional letters satisfying the formula below: (a ∨ ¬ b ∨ c) ∧ (¬ a ∨ b ∨ ¬ c) ∧ (a ∨ b ∨ c) ∧... In the worst case, all possible assignments must be evaluated, that is 2 N (where 2 are the possible assignment values, True and False, and Nis the number of propositionals a, b, c…).

Parsing Parsing → applying a function P (G, I), i.e. Parsing (Grammar, input) Given a Grammar Gand an input i , parsingimeans applying a function p(G, i )able to: 1.Accept/Reject i 2.Assign to ian adequate descriptive structure (e.g. syntactic tree) Universal Recognition Problem (URP) and reduction Universal Recognition Problem(URP) Given a Grammar G (in any grammatical framework) and a string x, x belongs to the language generable by G? Reduction is there any efficient mapping from this problem to a another well know problem for which we can easily evaluate the complexity? YES… SAT problem! URP is a generalized parsing problem that can be reduced to SAT in its core critical structure In a nutshell: a string x, as a proposizionalain a SAT formula, can receive an ambiguous value assig nment (for instance “vecchia”in Italian can both be a noun and an adjectival, while a can be true or false). We then need to keep the assignment coherent in x(to evaluate the correctnes s of the final outcome) as in a SAT formula. We conclude that URP is at least as complex as SAT, that is, NP‐hard! Per scoprire la classe di complessità di un problema si ricorre alla riduzione: si prende cioè un problema di cui si conosce già la complessità, si trova un mapping efficiente che trasformi ogni istanza del problema noto in un istanza del nuovo problema e che preservi i risultati richiesti. È questo il caso dell’Universal Recognition Problem (URP) che viene così formulato: Data una grammatica G (in qualsiasi framework grammaticale) e una stringa x, x appartiene al linguaggio generabile da G? L’URP è un problema di parsing generalizzato che può essere ridotto ad un problema come 3SAT intuizione di fondo: per una stringa x, come un proposizionale a in una formula di 3SAT, può esistere un’assegnazione ambigua di valori (ad esempio la stringa“vecchia” può essere sia nome che aggettivo, mentre il proposizionale a può essere vero o falso). Inoltre si può parlare di qualcosa come la verifica di accordo sia per la stringa x (tutte le occorrenze di x devono accordarsi in senso linguistico) che accordo tra i proposizionali in una formula 3SAT (inteso come consistenza dell’assegnazione di valori). Si deduce quindi che l’URP è almeno complesso quanto il 3SAT e che quindi è NP-completo. Barton, Berwick and Ristad (1987) focus on grammatical recognition problems that have the following form: Given a grammar G (in some grammatical framework) and a string α, is α in the language generated by G? In what follows we consider several recognition problems of this form. This kind of problem allows one to study the complexity of an entire class of grammars, namely those specified by some grammatical theory (like Government Binding theory or Generalized Phrase-Structure Grammar). For this reason, it is also known as the Universal Recognition Problem (URP) for a linguistic model

Chomsky’s hierarchy and complexity Psycholinguistics complexity Complexity = difficulty in processing a sentence We can assume that complexity and difficulty can be considered as the same thing. There are many hypothesis. Hypothesis 1 : formal complexity = psycholinguistic complexity ((Regular grammar - RG) context free grammar-CFG) In cfg we have many items: an, bn^ … Processing non context‐free structures causes major difficulties (Pullume Gazdar1982) Hypothesis 2 : limited processing memory Limited_size Stack(Yngve1960) linguistic processing uses a stack to store partial analyses. The more partial phrases are stored in the stack, the harder the processing will be. Syntactic Prediction Locality Theory (SPLT, Gibson 1998)total memory load is proportional to the sum of required an integration + referentiality needs:

  1. DPs required VPs (in SVO languages ): DP DPDPVP VPVP... Is harder than DP VP
  2. pronounreferring to an already introduced referential entity is less complex than a new referent (pro < full DPs). The complexity of the URP for a linguistic theory is a direct measure of how difficult it is to parse the languages generated by the class of grammars specified by the theory. Parsing is the process of using a grammar to assign a syntactic structure to a string of words. It is widely assumed that parsing is an integral component of the computations carried out by language users and that apart from the constraints imposed by performance limitations, human 4 sentence parsing is extremely efficiently. To reduce 3SAT to the URP for some grammatical framework, we must first exhibit a mapping from 3SAT problem instances to sentences for recognition. In the proofs that follow, this is achieved simply by erasing the "Y" and "Z" symbols and the brackets in the 3SAT problem instance to produce a sentence for recognition. We then demonstrate how to construct a grammar in the particular linguistic theory that will generate such a mapped sentence iff the corresponding 3SAT instance is satisfiable. For the reduction to be any good, we must show that it can be carried out in polynomial time. What building the grammar boils down to is that one demonstrates how the linguistic framework allows one to realize the three components listed above.

Two main constraints: 1.Grammatical rules predicts that from a root node Scertain expansion will lead to terminals; 2.The words in the sentence, indicates how the S expansions must terminate

  • We can start from the root node S for generating the structure: Top‐Down or goal‐driven algorithm
  • We can start from single words, trying to combine then in phrases up to the root node S: Bottom‐Up, or data‐drivenalgorithm Top‐Down Parsing Algorithm We can read this structure in two possible ways: S made up by NP and VP or VP and NP together make a S. stating that only the first possibility is conceivable, we then have other possibilities to continue the top down tree. the difference with the tic-tac-toe (tris) problem is that here we have the possibility that the S has infinite possible alternatives. CFG are good enough to express the lexica ambiguity: vecchia can be A or N. If we have multiple speech assignments then we have a lexical ambiguity. The syntactic ambiguity here. La vecchia legge la regola Pro – la D – la N – regola V – regola N – vecchia A – vecchia N- legge V – legge A strategy may be relying to probability, but it is important to take into consideration that there are may branches in our problem space. The top-down algorithm can be a way to process a sentence but there is a risk of recursion. A top-down approach (also known as stepwise design and in some cases used as a synonym of decomposition) is essentially the breaking down of a system to gain insight into its compositional sub- systems in a reverse engineering fashion. In a top-down approach an overview of the system is formulated, specifying, but not detailing, any first-level subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels, until the entire specification is reduced to base elements. A top-down model is often specified with the assistance of "black boxes", which makes it easier to manipulate. However, black boxes may fail to clarify elementary mechanisms or be detailed enough to realistically validate the model. Top down approach starts with the big picture. It breaks down from there into smaller segments.

Bottom‐Up Parsing Algorithm Historically, the first parsing algorithm (Yngve55) and possibly the most common (e.g. in program ming languages parsers). It starts from lexical elements, that are terminal symbols, and, phrase by p hrase, up to S. What’better? All of them will give results but both are incomplete talking about direction. We assume that the parsing goes from left to right, but the algorithm can easily do that also from right to left. Top_Down_strategy doesn’t loose time generating ungrammatical trees, but it generates sentences without considering the input till the end. Bottom_Up strategy, will be locally consistent with the input, but it will generate ungrammatical phrases unable to be rejoined under the root node SS. Both blind strategies are complete, then roughly equivalent, but: a. Consider starting from the side with the most precise (unambiguous) information b. Explore the tree trying to be guided by the smallest possible ramification factor. A bottom-up approach is the piecing together of systems to give rise to more complex systems, thus making the original systems sub-systems of the emergent system. Bottom-up processing is a type of information processing based on incoming data from the environment to form a perception. From a cognitive psychology perspective, information enters the eyes in one direction (sensory input, or the "bottom"), and is then turned into an image by the brain that can be interpreted and recognized as a perception (output that is "built up" from processing to final cognition). In a bottom-up approach the individual base elements of the system are first specified in great detail. These elements are then linked together to form larger subsystems, which then in turn are linked, sometimes in many levels, until a complete top-level system is formed. This strategy often resembles a "seed" model, by which the beginnings are small but eventually grow in complexity and completeness. However, "organic strategies" may result in a tangle of elements and subsystems, developed in isolation and subject to local optimization as opposed to meeting a global purpose.