



































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!




































































Prof. M. Passarotti INTRODUCTION Basics and history of computational linguistics 02.10. What Computational Linguistics is (and is not) CL is an interdisciplinary field concerned with the statistical or rule-based modelling of natural language from a computational perspective , as well as the study of appropriate computational approaches to linguistic questions ( Wikipedia ) Interdisciplinary : it’s in the very name, by definition, linguistics is related to the humanities, computational to the hard sciences. Statistical or rule-based modelling: 2 approaches
-> so, the aim of cl is to develop tools that automatically perform some natural language tasks. Several different tasks: part of speech tagging, designing the syntax of a sentence, machine translation, semantic role labelling Usually the different tasks were done in different stages with different models, now e.g. chat gpt when being prompted does all the tasks together since it was trained thanks to a large language models
considered a symbol (digital vs. analogic) -> digital /symbolic representation of something (contrary to analogic)
business machine) machine. A project of work wrote by Busa was given to the top engineers, but the response was that it was impossible to make. After some time, Watson decided to fund Father Busa for more than thirty years, and Busa became a legend at IBM. The reason for this was that Thomas Watson was an enlightened man and he understood that at that time they were at the very beginning of the society of communication , his company should have locally raised the know how to process linguistic data (regarding communication) automatically starting from scratch. Today the best tool you can have that includes a lot of NLP processing is called Watson. Busa, Roberto (1951), S.Thomae Aquinatis Hymnorum Ritualium Varia Specimina Concordantiarum. Primo saggio di indici di parole automaticamente composti e stampati da macchine IBM a schede perforate. Milano, Bocca. Busa, Roberto (1958), I principali problemi dell'automazione del linguaggio scritto, in Atti della VI Sessione delle Giornate della Scienza - Convegno Int. sui Problemi dell'Automatismo, Milano, 8 - 13 Aprile 1956 , vol. I, Roma, Consiglio Nazionale delle Ricerche. The root of it all A letter wrote in Latin tells us that he took example from Father Peter o’Reilly who wrote a similar schedularium, but he was still looking for the way and the means -> IBM + funds 1950 At the beginning of the project Father Busa was writing to different university to find endorsement, and he did, but he also found someone who was sceptical -> just a tremendous mechanical labour, not scholarly work, not research for linguistic/philosophy -> conservative reaction Still the method is the one that we apply everyday now -> either you take everything or nothing, you need every data to train. The US department of commerce approved of his project because they had certain needs: automatic information retrieval from big archives (limitation: implicit concepts -> challenge is finding something that is not explicit in text -> embeddings are the solution), patent search. Fast, Accurate, Portable Resta ad ogni modo assodato che d’ora in poi la storia delle concordanze non dovrà più registrar cifre come quelle del passato […] in pochi giorni il filologo […] si troverà tra mano lo schedario generale […] , sicuro di un’ esattezza quale mai gli avrebbe garantito l’intervento […] del collaboratore umano. With an automatic mean I can have a lot of data that’s correct within a few days -> Quantity, speed and quantity. […] varie e interessanti estensioni di questo sistema in funzione di scopi pur molto diversi: […] dovunque insomma uno stesso complesso di segni – numeri, simboli, parole o frasi, poco importa – debba essere ordinato. The automatic processing method, computational methodology, can have a lot of extension for very different objectives/scopes and applicable to every kind of data. (Busa 1951, 35-36) Main Difficulties Le difficoltà principali nascono rispettivamente dalle limitazioni della memoria meccanica e dalla mole e complessità dei fatti linguistici , unita alla ancora rudimentale conoscenza che noi ne abbiamo. (Busa, 1958, p. 836) After almost ten years of work on digitalizing the text of T. D’aquino father Busa realized the main difficulties:
A New Linguistic Awareness -> economics Le attività di produzione, scambio e difesa, esigono dall’automazione l’ “information retrieval”, che io tradurrei come reperibilità tempestiva delle conoscenze utili. -> google […] L’automazione del trattamento dell’informazione esige l’automazione della compilazione di indici, di concordanze e di tutti i possibili tipi di statistica dei fatti linguistici. [….] una lessicologia e una linguistica che sono più sistematiche, più esaurienti, più largamente utili, e oso dire, più umanistiche, di quanto non lo siano state a tutt’oggi quelle tradizionali. […] il “libro magnetico” rappresenta un vero e proprio cambiamento di dimensione. Ma non è solo quantitativo né solo di velocità. È anche qualitativo. […] L’interpretazione induttiva del fenomeno linguistico […] promette di far ricominciare il ciclo della consapevolezza linguistica e grammaticale con maggiori profondità, sistematicità e documentazione Today linguistic resources are all inductive, so somewhere human beings still have a role: although today computers have knowledge they still miss wisdom. Impact […] è chiaro che la linguistica esploderebbe in una enorme industria dell’informazione se solo riuscisse a conquistare quelle posizioni [automatic indexing & automatic abstracting] (Busa, 1983, p. 7.2) -> This will explode in a really big industry of information The Principal Aim «In this field one should not use the computer primarily for speeding up the operation, nor for minimizing the work of the researchers. It would not be reasonable to use the computer just to obtain the same results as before, having the same qualities as before, but more rapidly and with less human effort. [...] To repeat: the use of computers in the humanities has as its principal aim the enhancement of the quality, depth and extension of research and not merely the lessening of human effort and time.» Busa, R. (1980). The annals of humanities computing: The Index Thomisticus. Computers and the Humanities, pp. 83-90. Using computers for processing linguistic data is not a matter of speed, it’s a matter of quality and it takes much more time than normal research. SOME PHOTOGRAPHS: Titles of Newspapers that Father Busa collected, articles of him. “old” words: Cybernetics, electronic era, vivisect, electronic brain -> today we talk about artificial intelligence that exploded in the last years thanks to large language models. A punch card: cards with holes corresponding to information for computers, ancestor of a digital text. Father Busa collected 2million cards that were then connected to floppy disks, then to CD -ROM and then just the web. Digital will pass, Computing does not pass, it’s a methodology. 09.10. So if you remember last time, this was the last slide (the Principal Aim) and we were saying that basically using computers for processing linguistic data is not a matter of speed, it is a matter of quality and indeed it takes you much more time than doing traditional research. So some photographs:
In the ’50 there were great expectatinos for computers, for automatic processing, automation. Here are some titles from newspapers that can be found in the Busa’s Archive. These are some of the oldest titles, Father Busa collected all of the newspaper articles about him throughout six decades, so imagine how much material is there. I selected these 3 interesting headings because they report some words that are not fashionable anymore: Cybernetics , who talks about cybernetics anymore…it’s an old word that nobody uses anymore; Electronic era, sounds old; Vivisect , I’m pretty sure Father Busa himself suggested to the journalist to write vivisect, it’s really one of the words of Father Busa “you have to vivisect the lexicon of the author”; Electronic Brain, nobody talks about cervellone elettronico but actually today we talk about artificial intelligence which already 5 years ago was not a new word, it sounded more or less like Cybernetics can sound today, so AI exploded during the last 5 years mostly thanks to large language models and to having lots of data. This is a punch card, scheda perforata. Cibus, I selected this image because in 2015 there was the expo about food. And this is how it worked: these were two operators dressed in white working in one of the first labs of Father Busa in the 50s. I met this woman, she is now 85 years old, she has great memories of those times, and she is a great source of nice stories about the history of humanities computing. If you go to the simulator site (: http://stefansinclair.name/punchcard/) you can create these cards with holes that machines computers receive in input and according to the position of the holes the information was taught. This is a way to formalize language: you had to find a way to record in a way that was machine readable the information, and the information is basically the text, so in a way this it the ancestor of what today we call a digital text: a text that is formalized in such a way that a computer can process it. This is the first form of machine readability in history, just basically a set of holes and if you see in the machine here you placed the card, and the two women were basically just writing the text of Thomas D’Aquinus. At the beginning of the 60’s this was part of the collections of the punch cards of the Index Thomisticus. Father Busa collected more than two million punch cards and when he had these cards he then converted them into the magnetic tapes, nastri magnetici, and from there to big floppy disks, then small floppy disks, then CD-ROM and then to just the web. So this is one of the reasons why I tell you that I don’t like the word digital humanities , because digital is something that will pass sooner or later while computing is a methodology, it will not pass. This is a photo of the expo in ’62 in Bruxelles, one of the men watching is a very famous sportsman, he is said to have saved Italy from civil war in the 40s together with Coppi, he’s Gino Bartali, who looks quite sceptical of what
Translation and Computational Linguistics that changed in American Journal of Computational Linguistics (1974) and lastly ‘till today it’s Computational Linguistics (1980). Machine translation disappeared, not because it was not needed but we were not able to do it. One step after the other is crucial, do not consider performing semantic tasks without being able to perform morphological tasks, syntactic tasks and lexical tasks. In 1972 there was an IBM meeting in Pisa about linguistic processing. Pisa at the time was center of the world, the first Italian big computer was installed in Pisa at the Centro Nazionale Universitario di Calcolo Elettronico, not by chance the Index Thomisticus was moved to Pisa, the first lab of computational linguistics, apart from the one of Father Busa was set in Pisa by Antonio Zampolli, who was one of the pupils of Father Busa, who then founded the Istituto di linguistic Computazionale del Consiglio Nazionale delle Ricerche. The text is in Italian here is the translation: The computer cannot lemmatize the words that are not included in its vocabulary. Lemmatization: operation of reducing the forms to its lemma, the word that you find in the headings of the lexical entries in dictionaries e.g. andare: vado, vai, andiamo, andassimo, andremo -> in the dictionary you search for the infinitive. At that time given the text in order to lemmatize the text automatically there was a simple program that presented a list of all the forms of the language followed by its lemma e.g. went – go; The problem was that it was too rigid, if a form is not found in the vocabulary used by the machine it is not analysed so the out of vocabulary word were not processed and analysed. As a human if you listen to a form that you’ve never heard before you can perform some cognitive process e.g. enclodiamo = verb 1st person plural indicative; the machines were not able to perform previsions about the possible analyses of words when they were not included in the vocabulary -> today machine learning teaches regularities for recognition. The problem that was most difficult to solve is that of omographic words. The computer can decide for instance if the Italian word danno in a specific comtext is a masculine noun synonym of ruin or instead a form of the verb dare which means to give, or even it can be the present of dannare another verb. How can the machine distinguish between these three possible analyses? I already said that omography and ambiguity are our big enemies: two words written in the same way can result in two different lemmas. e.g. danno noun v. verb; The same sequence of characters can be related to different lemmas and you need context to understand which is the right one, so we must provide the machine with context, giving some hints in order to understand and distinguish between the verb and the noun. Unfortunately, this disambiguation is only done manually, and this slows the elaboration, but if there is this first level of problem where you are not even able to distinguish between nouns and verbs, all the subsequent layers are put in difficulty. The collaboration between scholars and linguists has so far produced methods for the automatic syntactic analysis of sentences by which it is possible to perform cognitive distinctions between homographic words that pertain to different part of speech but have different meaning. The added value of machine processing is in doubt because it takes a lot of time to process manually all these tasks. Basically here it says that you need automatic syntactic analysis to perform disambiguation between the parts of speech, actually we’ll see that you can perform part of speech tagging even without syntax e.g. danno grande soddisfazione : danno = main verb, grande soddisfazione = main verb (syntactic expression) We were talking about finding the right lemma for the different part of speech e.g. danno = noun (damage), verb (do -> to give) and (dannare -> to damn).
In the report we find an example of a program which was done at CNUCE in Pisa to analyse automatically sentences like “ lo zio legge il libro ” which is a difficult sentence to process for a machine since lo can be either a pronoun or an article, legge either a noun or a verb and libro either a noun of a verb. You can now realize how many cognitive processes you do every day to distinguish between e.g. a pronoun and an article. A machine needs to be taught how to do it. To me reading this report from 50 years ago is enlightning because the problems were already there so part of speech tagging on one side and semantic processing on the other, consider that even 50 years ago in computational linguistics nobody really was handling semantics, we were all still working on syntax without semantics. Today it is the big deal and this is the reason why we moved towards machine translation again, because machine translation deals with semantics because it is translating a concept form a language to another using syntax, lexicon, morphology but dealing with semantics. Here there are some examples of the same word e.g. Lancia which in Italian can be a boat, or a whip, or a verb, but in a specific sentence and use (a token = occurrence of a specific word in a text) it has just one meaning There are several cases where the human being must use his own experience and knowledge of the real world, of the relations and relationships that hold between people and objects. We have a list of words somewhere related to some meaning and you have relations between words e.g. father and son; How can we teach the machine these relations which are very important for the semantic processing? E.g. today in the canteen I ate pizza v. today in the canteen I ate a student -> not possible because you have the semantics of eat , students and pizza and during your life you were exposed to several occurrences of the word to eat and you know that the object of eat must be something that can be eaten and you know that students cannot be eaten. You can say e.g. this girl eats my soul implying that you love this girl and it’s a difficult love story: this is metaphor processing and it’s very difficult because the prototype of these verbs have required that the subjects and objects of the verb have some properties; in most cases you can’t inverse them, you can’t say e.g. today in the canteen a pizza ate me. So think about all the knowledge of words that you have and we must provide machines with this knowledge. The solution to this problem so to speak is semantics, the task that many assign to computational linguistics for the next 30 years. Today we have large language models, we have Chat GTP, we have artificial intelligence, and what is surprising to me is that this knowledge of words is there in the core of large language models, because thanks to embeddings, the organization of words in a space where words are closer or far from each other according to how they behave in a training corpus, you know that words have relations between each other. From Rationalism to Empiricism Since the end of the 90s there was this big turn that I already mentioned: before, everything was performed by using rules of the form if…then e.g. if you have an article then after it there should be a noun, but language is grey not black or white. So we moved from rule-based approaches (intuition based -> rationalism) to data-driven approaches (-> empiricism) where we need data, statistical algorithms and computational power because at the end of the 90s we had data, that is to say corpora, linguistic resources, we had statistical algorithms and some computational power even if they were nor so big and refined. So we moved from thinking machines to learning machines that learn from empirical data -> the electronic brain , the idea that machines were able to think, just after the ALPAC report we realized that machines do not think, so we moved to machines that learn from empirical evidence, and this empirical evidence that we show the machine are linguistic resources. Now we are back to thinking machines, machines that learn so much that they seem to be able to think. AI, Chat GPT, seems to be able to think but it’s just predictive, it predicts what is the most probable word that comes.
Re- Words: differences I already mentioned that when you bring replicability of experience you bring scientificity in the humanities, digital humanities casts intellectual problems in experiments and these experiments must be replicable in order to make the whole process scientific. Let’s see the differences between a number of Re-words:
The World of CL Some achronims:
Sinclair (2004) focuses on the fact that corpora provide empirical evidence , data which are source for linguistic research, so we may use corpora in order to perform linguistic research. Most linguistic resource is based on empirical evidence. Unless you are a very Chomskian scholar and you do not think that data will ever help you in your research life and you are a linguist, you need empirical data. When you talk to classicists, they do not think they need help NLP tools and corpora. If you are a classicist, you need corpora because you do not have Cicero to call, all you have is data. Corpora are very important to perform linguistic research.
are right. This is not a good idea: we must work with empirical data that were not built by ourselves just for our research’s aim. Here the role of intuition , which is very important in the two different approaches introduces by Tognini- Bonelli in 2001: corpus based and corpus driven approaches. Corpus based approach is partly based on competence, corpus driven is based on performance. The one who introduced the difference between performance and competence in linguistics is Chomsky. He is not exactly a friend of corpora and thinks we have to base our research on internal and not external language, so on what we know about language because we are native speakers. He does think we do not need external data. Competence is what we know about language because we are native speakers and have a natural faculty of languages when we are born, while performance is based on empirical data and performing a linguistic act. Chomsky focuses just on competence, what we know about language as human beings, without using empirical data. Typical criticism for Chomsky is that there is no corpus with all the possible realizations of language, because language is recursive: you can always build a new part of a sentence. Imagine with “and”: the microphone and the table and the students and the wall, and so on. Chomsky does not think corpora are useful because they cannot represent the entire universe of possibilities that a language gives. Of course, a computational linguist focuses on performance, we focus on data. Our approach is corpus- based and corpus evidence is «used to confirm/refine/reject intuition-based linguistic theories». I have an intuition about language, for example that in Italian subjects and on the left-side of the head or that syntax in Dante is more complex in “Inferno” than in “Paradiso”. You know Italian and Dante’s texts and your knowledge leads you to an intuition. You have to demonstrate your intuition with practical and empirical experiments. I go on corpora to confirm, reject or refine my intuition. Running an experiment that demonstrates that you are wrong is a result because then you start wondering what and why was wrong. There are three different approaches under the CORPUS-BASED APPROACH: One is insulation and it is the most theoretical approach. «Fully intuition-based theories are tested on corpus evidence», which is what I have just explained. I have a full intuition-based theory (for example that subjects in Dante are on the left) and I go to corpora to try and refine, confirm or reject my intuition. Then there is standardisation , which is also called enrichment. It is a more empirical approach that is testing a theory by annotating corpus evidence*. We want to demonstrate something so we annotate, enrich the text with some annotations in order to collect evidence about the research we want to conduct. I have an intuition about the left or right position of the subject. I go through the text and I annotate all the occurrences of subjects. Annotate means that for each occurrence, I assign a label (for example, for each occurrence of a noun I assign the label “noun”). Annotation is the process of enriching a text with metadata. The enrichment approach is empirical because I test my theory by annotating, looking at all the occurrences of a phenomenon. Annotating is an enlightening task because every time you annotate, you learn something about language. New ideas come out, you realize how difficult language is and how many phenomena are there. This is why it is also called enrichment: this approach enriches data with some metadata. Then there is the paradigmatic approach, called instantiation. «Data are possible, alternative choices. Strict connection between theoretical markedness of a choice and its ‘ranking’ in a corpus». Let’s get back to the example of the position of the subject. Simplifying, let’s pretend that the subject can be either on the left or on the right (there are actually some cases in which the subject is both on the left and on the right, for example coordinate clauses). There is a connection between theoretical markedness of a choice and its ranking in a corpus. Usually, the choice that has the lowest rank is the most marked. This means, the choice that is less frequent in a corpus. The ranking is the list of possibilities raked by their frequency in a corpus. Imagine we have the two values of subjects on the left or subjects on the right. You rank them, obtain 100 occurrences of subjects in the text and 95/100 are subjects on the left. The ranking of subjects on the right is lower than the ranking of subjects on the left. Among the possible choices, the one that has the lowest ranking (less frequent) is more marked. More marked means that is not the default choice.
language, bibliographic information. Descriptive metadata is all that you predicate about the bibliographic and classificatory description of the text. Administrative information is the documentary information about files, data availability, revision status, owner. A corpus is a product and you must provide information about the properties of this product, so there are metadata that describe for instance how many files is the corpus composed of or the tagset. A tagset is a set of labels that are used to annotate the corpus under some point of view. Imagine your corpus is PoST corpus, what are the labels you use? You can assign “noun” for nouns, or different labels to record that is a noun. This is declared in administrative metadata, usually it is in the licence (this corpus is under the licence of…), revision status (the data were revised on…), the owner (the developer and the owner of data). Analytical metadata is about interpretation and analysis of corpus components. Things here deal with some NLP tasks, among which are not structural properties (such as chapter and titles, that are not NLP tasks, they are organizational tasks). Instead, finding quotations, finding foreign words, performing name-entity recognition and performing linguistic analysis has to do this NLP. You have an header of the corpus with information about the author, the owner of the corpus, some other information about the structure and then you have linguistic information. Finding a name-entity is an NLP task, finding a proper noun and saying it is the name of a city is an NLP task. We will focus on name-entity recognition and now on linguistic analysis because annotated corpora are corpora enhanced with annotation (metalinguistic annotation, so layers of linguistic analysis and now we will see these layers). Corpus annotation is the practice of adding interpretative linguistic annotation to a corpus. If I give you a text in English and tell you to annotate it, we will see different interpretations because we do not have a common criterion for assigning PoS now. Leech (2004): “Corpus annotation is the practice of adding interpretative linguistic information to a corpus” Layers of Linguistic Annotation Tokenisation: deals with “tokens”, which are the minimal units of analysis. To tokenise a text means to divide it into the minimal units of analysis from there onwards. The easiest tokenisation is to divide a text into words. Usually, the words of a text are its tokens. We have not to define what a word is: usually the simplest definition (apart from punctuation) is that a word is a string of characters separated by blanks. This does not always work (compra-lo one word but two tokens, complex words, multi word expressions often considered as one token). Tokenisation is essential, tokens can also be parts of a word (cars can be car + s, so two tokens. It depends on the type of your analysis). Tokenisation seems to be simple, but it is something you have to think about: what are the criteria for tokenisation? (spoken corpora): you usually perform phonetic and prosodic annotation, so you annotate accents and intonation. Morphological analysis and lemmatisation and PoS tagging: We will deal with morphological analysis and lemmatisation (remember the ALPAC record) and PoS Tagging. PoST is the task of assigning a part of speech to the tokens of a text. You assign one and only one part of speech to each token. Lemmatisation is about lemma. Lemma is the headword, so the word that is canonically, conventionally used to refer to a lexical entity. In Italian it is the infinitive for verb, it is just a convention. Participles are sometimes quoted as an adjective and sometimes as a verb, there is no right or wrong in this. The challenge today is to harmonise the different criteria. Morphological analysis deals with number, gender, mode, tense, person. There are “tratti morfologici”, morphological features. “Faccia” in Italian is form of the verb “fare” (= to make) or a noun. Lemmatisation of “faccia” tells us it comes from the verb “fare” (lemmatisation) and it is a token at the subjunctive, third person singular (morphological analysis). At this very low level NLP tasks we can already see how much information must be produced by the machine in order to produce some metadata (morphological features, lemmatisation, PoS). It takes time for a machine to do this with one billion words. Syntactic analysis: deals with subjects, objects, complementations, what we call “analisi logica”. Treebanks are here and in this first part of computational linguistics we will focus on treebanks. Information structure (TR): thema and rhema, so thema is what is given and rhema is what is new. What time will you take the train tomorrow? I will take the train at 9. At 9 is the new information, so it is the rhema and we can see it because “at 9” is a good answer for the question.
Anaphora/ellipsis resolution: Anaphora resolution: I met John. He is happy. “He” refers to John and it is anaphora resolution. Not John as a word but John as an entity. Ellipsis resolution: John eats apples and Mary cakes. The second “eat” is not there, so this is ellipsis resolution because something is missing. Pragmatic-rhetorical annotation (RST; illocutionary force): is a very interesting and difficult task and it is about the illocutionary force of phrases (this is a question, a command, a promise…). We started from the minimal units, and we are heading to relations between tokens, between sentences. All computational linguistics is about semantics, and we are moving towards semantics. Semantic annotation: SRL, WSD: The processing of semantics is difficult, semantic deals with SRL Semantics Role Labelling (=assigning semantic roles). Semantic roles are agent, patient, addressee, beneficiary, source, location, time. This is semantics. I would come tomorrow at school, I would come tomorrow at 6 : “at school” and “at 6” are syntactically the same, but at this level of syntactic analysis they are not the same. Conveyed by the same semantic structure, but different syntactic. All prepositional phrases are prepositional phrases, as a semantic level. Semantic also deals with Word Sense Disambiguation: words usually have more meanings (polysemous - polisemico). Especially content words have more meanings, choosing the right meaning of a word is word-sense disambiguation. We deal with it every day, for example, when we say “faccia di tolla” in Italian. Nobody has a faccia di tolla, it does not mean “face” in the literal sense. Multimodal annotation: gesture, facial expressions, perceptible context… Why Annotating? For Theoretical purposes: