Docsity
Trusted Seller

Complete notes Computational Linguistics 1 Linguistic computing Passarotti Part1, Sbobinature di Linguistica

Toggle sidebar
bg1
COMPUTATIONAL LINGUISTICS 1
Prof. M. Passarotti
INTRODUCTION
Basics and history of computational linguistics
02.10.2023
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
1. Rule-based is the old-fashioned approach, since it’s based on rules it’s very rigid e.g. “clean” adj./verb ->
understand form context -> to teach it to a computer we have to write a rule e.g. if it’s followed by a noun
then it’s a verb (part of speech tagging).
But NLP (Natural language processing -> TAL trattamento automatico del linguaggio) doesn’t work like this,
there’s many exception e.g. usually noun phrases are in the form adj.-noun
Humans, linguists, write the rules by their own knowledge of language -> intuition based approach
2. Statistical approach --> machine learning and data: every day the web grows with data and most of them
are linguistic data. Each query in google are words. Statistical process is the real change of the last decade
because we have huge amounts of data, today we have more than 50m new tokens on the web, and we
also have computational power that can manage this data.
e.g. in a corpus each word has been assigned a part of speech and we show this corpus to a statistical
machine that will learn regularities and exceptions to the regularities. Not knowing the reason but knowing
the circumstances.
empirically based -> the machine doesn’t know the subject, but it learns from data.
The process is called induction.
Computational perspective: computationally, performing calculations.
Every time a linguistic question arises every linguist goes to data to search for answers that support or go
against his thesis.
Experimental: computers compute data to support linguistics intuitions
For decades linguistic has been taught and learned all based on intuition, but the last century was the
century of micro things, and this was applied also to linguistic and literature since both use data and are
empirical, so why not using computer for processing this data.
NOT the same as:
• Informatica Umanistica, Cultura Digitale: italian translation of digital humanities
• Digital Humanities (highlights format of the data): we deal with linguistic data, and it will not
be a digital mind but a computational mind. Computational linguistics does not depend on
the support that helps computing
DH: performing a tasks with digital (new) tools
CH: requires a methodological turn (new processes)
Companion to DH (2004): discussion on the very name was old already then, alternative was Companion to
humanities computing, because today everything is digital
Computational humanities is performing computation of linguistic data: the most humanistic discipline there
is.
A very young science, started at most 50 years ago
The Mission of CL
• To formally describe natural language for developing programs and tools for various NLP tasks:
writing a formal rule of grammar, is a way to formally describe natural language.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b

Anteprima parziale del testo

Scarica Complete notes Computational Linguistics 1 Linguistic computing Passarotti Part1 e più Sbobinature in PDF di Linguistica solo su Docsity!

COMPUTATIONAL LINGUISTICS 1

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

  1. Rule-based is the old-fashioned approach, since it’s based on rules it’s very rigid e.g. “clean” adj./verb -> understand form context -> to teach it to a computer we have to write a rule e.g. if it’s followed by a noun then it’s a verb (part of speech tagging). But NLP (Natural language processing -> TAL trattamento automatico del linguaggio) doesn’t work like this, there’s many exception e.g. usually noun phrases are in the form adj.-noun Humans, linguists, write the rules by their own knowledge of language -> intuition based approach
  2. Statistical approach --> machine learning and data: every day the web grows with data and most of them are linguistic data. Each query in google are words. Statistical process is the real change of the last decade because we have huge amounts of data, today we have more than 50m new tokens on the web, and we also have computational power that can manage this data. e.g. in a corpus each word has been assigned a part of speech and we show this corpus to a statistical machine that will learn regularities and exceptions to the regularities. Not knowing the reason but knowing the circumstances. empirically based -> the machine doesn’t know the subject, but it learns from data. The process is called induction. Computational perspective : computationally, performing calculations. Every time a linguistic question arises every linguist goes to data to search for answers that support or go against his thesis. Experimental : computers compute data to support linguistics intuitions For decades linguistic has been taught and learned all based on intuition, but the last century was the century of micro things, and this was applied also to linguistic and literature since both use data and are empirical, so why not using computer for processing this data. NOT the same as:
    • Informatica Umanistica, Cultura Digitale: italian translation of digital humanities
    • Digital Humanities (highlights format of the data): we deal with linguistic data, and it will not be a digital mind but a computational mind. Computational linguistics does not depend on the support that helps computing DH: performing a tasks with digital (new) tools CH: requires a methodological turn (new processes) Companion to DH (2004): discussion on the very name was old already then, alternative was Companion to humanities computing, because today everything is digital Computational humanities is performing computation of linguistic data: the most humanistic discipline there is. A very young science, started at most 50 years ago The Mission of CL
    • To formally describe natural language for developing programs and tools for various NLP tasks: writing a formal rule of grammar, is a way to formally describe natural language.

-> 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

  • To use NLP tools for building, analysing, and querying large amounts of linguistic data (written, spoken, audio, video) -> language resources: collections of linguistic data e.g. corpus, dictionary, lexicon
  • Practical outcomes: T9, Google (Semantic Web), NLU, NLG, Siri, Alexa, WhatsApp… ex.
    • Siri uses speech recognition and performs linguistics analysis on your text; its answer is speech synthesis
    • corrections on messages
    • NLP components in the car
    • chat GPT, AI 04.10. The Importance of Modelling -> the process of abstraction ChatGPT is based on large language models Modelling means to abstract representation of phenomenon -> is an action of formal abstraction of data, linguistic knowledge
  • Model : abstract (it can be applied to other situations) representation of linguistic knowledge to simulate the human linguistic performance (research as imitation of nature) We have data and we train a machine with the scope to have an abstract representation of NLP. Io vado e non io andiamo --> learnt by the machine and formally represented. Low level information are empirical single occurrences of words in a text that can be abstracted in order to understand the type of model
  • An important feature of a model is its ability to generalize (and, thus, to explain and/or to predict ) a phenomenon, over its single instantiations. Every time you want to model a piece of reality you understand how little knowledge you have of that piece, trying to generalize a model forces you to explain/predict/understand that reality. Today generally AI is predictive AI; training sets are sets of empirical evidence you train the machine with and prediction is made on training. --> abstracting from the single instantiation of the same structure. The aim is to rise the ability to model, to abstract from the single instantiation.
  • Models are never neutral with respect to the reality that they describe e.g. part of speech tags are sets Components of a Model Usually it has 3 components:
  • Data: representative (building a model of Italian language collecting data just from twitter is not representative, so you want to build a corpus representative of the reality you want to abstract) and balanced (). The model must explain the data → [see section on] Linguistic/language Resources: collections of data (Everything deals with data, which is everywhere) You must be familiar to data to work with it, but about linguistic resources there’s meta data that describe the content and criterion of selection for the data in it The first part of discourse are linguistic resources: the models must explain the data and we will see the linguistic resources, collections of data. A set of parts of speech to describe the part of speech and their distribution in the speech.

considered a symbol (digital vs. analogic) -> digital /symbolic representation of something (contrary to analogic)

  • Artificial Intelligence: mathematics as just one possible field of application of a universal machine Very famous for cryptanalysis. Automatically decrypt the messages of the Vermacht. Theoretical machine where symbols are read. Represent object through symbols. Manipulates symbols on a single tape according to rules (rule based). A universal practical machine. I won't deal with analogue but digital information. Universal: any kind of information, even linguistic. Tokens are the symbols you write in the cells and are the minimal units of analysis (e.g. words) Three Challenging Views Between 30s and 60s:
  • Substantial funding for Cold War
  • Confidence (and some fear) in technology Today:
  • Cryptanalysis: machine translation
  • Turing Machine: computers …but finite
  • Artificial Intelligence: robotics, domotics… Turing Machine as a Tool for Knowledge Building To process any kind of object with a computer compels to formalise it and, thus, to deeply understand its functioning Formalise your data in terms of symbol and makes use of rules to move from one symbol to another to analyse those symbols and this machine is universal, appliable to any kind of object. To deeply understand its function. ABSTRACT: what is cl? and some key words formal representation of NL; modelling: a form of abstract representation of linguistic phenomenon; rule based and statistical approach to NLP and data, the core of the discipline, the empirical evidence we use to train our tool. Today we are living the era of big data, surrounded by data and lot of these data are linguistic data. Computing linguistic data. ALAN TURING: the idea of the symbolic representation of everything, the universal machine. Do we really know the difference between analogic and digital? Analogic> up and down that correspond to an information, we have an analogy between the symbol and the information that is similar. Digital > 0010110 symbolic representation of information with no similarity, it is symbolic. 05.10. Father Roberto Busa SJ One of the pioneers of what we now call Computational Linguistic. First it was humanities/linguistic computing. In the photo he’s looking into a punch card which was how computers used to work, still the same process. Busa’s menthor in the late ’30 assigned to him a thesis about the concept of presence and interiority in the philosophy of Tommaso d’Acquino. So he started by close reading the texts and he found out that the concept was not conveyed only but these words (presenzia) but also with words with in- prefix meaning inside. He started to collect on little cards all the occurrences of these words in order to collect data to support his philosophical intuition (10million). Methodology: close reading – collecting occurrences of the words he had to study -> huge amount of work, what if automatic? After the war, in 1949, the world opens and he has the opportunity to meet Thomas Watson Snr in New York who was the CEO of IBM. And he asked if he could support his research with IBM (international

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:

  1. Practical limitations -> limitations of mechanical memory: the computers were not very powerful and processing a lot of data took a lot of time (days)
  2. size and complexity of linguistics facts -> formalizing language for a computer compels you to expand your own language.

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:

  • Repetition: running the exact same experiment, solution or approach under the same conditions to arrive at the same output result, if it’s not the same something is wrong
  • Replication: replicating the same answer to a given research question by different means (e.g., by evaluating an algorithm on a new dataset)
  • Reproduction: running the same experiment with a different set up algorithm, meaning the different features an algorithm uses
  • Reuse: getting not only to different output results but also to different scientific results so the experiment is different, as just some parts of it remain the same (e.g., tools, scripts, data, workflows) Take-home Messages
  • No one has 'such command of his own language' to be fully confident in processing it with a computer: this is the only thing that I learned after 25 years of computational linguistics, you realize how little you are the more you process language with computers, you understand that you are not confident even in your native language;
  • Empirical results are just the starting point, whenever you have results always tell something so we need to interpret them, also negative results in research are interesting results, looking at the mistakes in a comparative work you can see what’s different between the two works you are analysing with the same NLP tool;
  • Not faster, but better: here we will not make things faster, hopefully we’ll make things better and hopefully at the end you’ll go faster. An inevitable, COMPUTATIONAL turn We are not dealing with Digital Humanities , not Digital Linguistics but Computational Humanities and Linguistic computing. A friend of mine that founded the university of Lausanne, Michael Piotrowski, wrote a nice paper about this difference:
  • Digital Humanities is Contemporary Humanities: it relates to the use of contemporary technology— like digital tools and resources—, but only to a limited extent to genuinely new methods or even a new methodology : you do exactly the same things as before but faster and bigger;
  • Computational Humanities relates not to the use of new tools, but of new methods and thus ultimately a new methodology. It represents a major departure from traditional research in the humanities : I told you, you can do computational linguistics and computational humanities without a computer, just with calculations, it’s just better to use a computer. Climbing the Pyramid Everything deals with climbing the DIKW pyramid, data-information-knowledge-wisdom (also known as the DIKW hierarchy, wisdom hierarchy, knowledge hierarchy, information hierarchy, information pyramid, and the data pyramid): refers loosely to a class of models for representing structural and/or functional relationships between data, information, knowledge, and wisdom. Typically, information is defined in terms of data, structured data it’s information e.g. xml = data with a markup, forma in latin means beauty so in some way you make your data beautiful. Knowledge is something more, it is be implied; until 5 years ago machines were great to work with knowledge and information, they did not have any knowledge, today AI and large language models know much more that is in data and information. Wisdom is knowledge embodied, when your knowledge is part of yourself. «Typically information is defined in terms of data (it’s structured data, in forma-latin), knowledge in terms of information, and wisdom in terms of knowledge». Rowley, Jennifer (2007). "The wisdom hierarchy: representations of the DIKW hierarchy". Journal of Information and Communication Science. 33 (2): 163–180.

The World of CL Some achronims:

  • ACL: Association of Computational Linguistics, the most important association, it holds a conference each year and the acceptance rate of papers Is 25%;
  • ILC-CNR: Isituto di linguistica computazionale del Consiglio nazionale di ricerca funded by Antonio Zampolli in Pisa who was a pupil of Father Busa
  • CLiC-it (2014) the Italian conference of computational linguistics & AILC (2015) the Associazione italiana di linguistica computazionale
  • IJCoL (2015): Italian journal of computational linguistics, today it is a top journal
  • Evalita (2007): the evaluation of Italian NLP, THE Italian counterpart of SemEval (by ACL) a campaign of evaluation of NLP tools about semantics
  • Conferences: ACL, European ACL, North American ACL, COLING, Language Resource and Evaluation Conference, Empirical Methods in NLP, Conference on Natural Language Learning
  • ACL Anthology: collection of all the papers in computational linguistics published in the last 50 years. 11.10. LINGUISTIC RESOURCES Language resources are collections of data which primarily document communicative acts of humans by some form of recording and/or descriptions, both directly as in corpora, or at higher levels of abstraction in lexicons and ontologies. (International Standard for Language Engineering, ISLE) This definition isn’t clear. Linguistic resources are collections of data related to human language. The data can be written, spoken or audio/video (multimodal corpora). There are 2 main categories of linguistic resources:
  1. Textual resources -> collections of text e.g. corpora that records directly some communicative act e.g. text or speech
  2. Lexical resources -> higher level of abstraction because whenever you speak, write or read you deal with text, in this case you abstract from the text the lexicon of the language e.g. dictionary, lexica, glossary, ontology Language resources are pivotal components in NLP because they collect data and in order to perform machine learning you need data -> empiricism, data-driven E.g. you want to build a trained NLP tool for part-of-speech tagging: In order to train a machine to automatically perform part of speech tagging you need a language resource, a corpus that is annotated -> data enriched with something e.g. part of speech tags. Today we could get rid of language resources, we have the web, but the web is a collection of raw data, a sequence of words without annotation; still large language models trained on the web perform really well even in tasks like part of speech tagging. The dictionary is a language resource, a book but the language resources that we use in NLP need to be in machine-readable form. LR collects data: written, spoken, audio/video (multimodal) There are tools for acquiring, building, maintaining, sharing, querying Language resources, not only NLP tools but also some kind of editor that corrects the output of the NLP tool. Querying language resources is performed by using querying formal query language, formalize what seems to be informal. LR: Which Kind Corpora : collection of texts

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.

  • Internal Criteria: “reflect details of the language of the text”. Risk: the corpus reflects the linguist’s knowledge
  • External Criteria: “derived from an examination of the communicative function of a text. A corpus should be designed by experts in the communicative patterns of the linguistic community” I will try to explain this in easier words. The clearest part is that corpus reflects linguistic knowledge, details of the language of a text. Now imagine I want to make a linguistic research about one linguistic phenomenon, for instance I want to study structure and order of relative clauses in Czech. I want to collect some empirical data as a source of data for my research. What should I do? I am a linguist and I have some linguistic knowledge, so I start to select sentences where I find relative clauses, here and there. I already have some intuitions about language and I select sentences according to this intuition. For example, I may find some good examples of relative clauses which occur on the right side of its head. This is an internal criterion, because it is internal to the very research work for which the corpus was built. The corpus was built just for this research. It is not a good criterion, it is better to use a general corpus, so a corpus that was not built just for a specific research, but designed by experts in the communicative patterns of the linguistic community. For instance, scholars who build a sufficiently representative corpus for Italian: from that corpus I extract the evidence about the specific phenomenon that I want to study. Why is this important? Because if you use a corpus that is built upon external criteria, in principle your source of data is not biased by your linguistic knowledge. Using Corpora in Linguistics (Tognini-Bonelli, 2001)
    • Corpus-based (-> competence ): corpus evidence is used to confirm/refine/reject intuition-based linguistic theories
      • ‘ insulation ’: theoretical approach. Fully intuition-based theories are tested on corpus evidence
      • ‘ standardisation ’ (‘enrichment’): empirical approach. Testing a theory by annotating corpus evidence
      • ‘ instantiation ’: paradigmatic approach. Data are possible, alternative choices. Strict connection between theoretical markedness of a choice and its ‘ranking’ in a corpus
    • Corpus-driven (-> performance ): inductive approach. Linguistic theories fully reflect the empirical evidence of the corpus and are developed by induction. The linguist’s knowledge is applied later. See Cobuild (Sinclair) You can perform research using corpus in linguistics following different approaches. The risk in this kind of research is that I have some intuition and I want to find in data something that proves that I am right. This happens because we are lazy, we love our intuitions, our hypothesis and we want to demonstrate that we

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:

  • Theory-Data comparison: I have a theory and I compare it with data in order to refine, reject or confirm a theory. Every time you have a theory you go to data (unless you are a chomskian scholar), even though you are not forced to go to data. Data is a long process, takes years.
  • Hidden features: there are patterns you can find out of dependence among features. You have features, which are properties you assign to your units of analysis. You assign metadata to tokens (for instance their PoS, thir morphology…), then you perform syntactic analysis (you assign syntactic functions like subject, object… which is a relational kind of analysis). These are all features, then you come out with surprising patterns of dependencies among features, for example every time you have an occurrence of the verb “love”, the subjects are masculine nouns on the right side. This is a pattern of dependence, here you find some regularities. Most often, given some conditions, this is what happens. Patterns of dependence among features: fundamental approach to predictive generative a.i. -> Given a sequence of features (or words) there is a dependence that makes you able to predict the sequence of words. These are hidden features because it is not explicit, nobody says it but it is induced from data. For Practical purposes:  Training of NLP tools e.g. ML approach to train PoS tagger for English, you need a PoS corpus for English, where each token is PoS assigned. ML learns the regularities, the patterns of dependence among features, for example that very often an article is followed by a noun. You need annotated data for ML and this is why linguistic data are pivotal components in NLP tasks. Things are changing, first embeddings were a huge amount of data but not really a PoS corpus. Embeddings is space where there are vectors with similar words. In the first embeddings, all articles were together, all names were together, all adjectives were together. Just from inducing information from data, those words had something in common, behaved the same way. Now you can perform PoS tagging at least of functional words (prepositions, adverbs, auxiliaries, verbs) using machines. You give the machine a huge amount of data and it finds out recurrencies and regularities. You are native speakers: If I put an adjective you’ve never heard in a sentence, you recognize it behaves like an adjective. Annotation is always needed because we can fine tune a.i. using annotated corpora.