- Natural Language Processing
- Summary
Course Syllabus
Obiettivi
Lo scopo del corso è fornire un'introduzione ai concetti fondamentali relativi all'elaborazione del linguaggio naturale (NLP) nonché una panoramica dei principali strumenti utilizzati nel settore. Inoltre, verranno presentate alcune applicazioni di NLP, ad esempio traduzione automatica e rilevamento di discorsi di odio.
Gli obiettivi specifici rispetto ai Descrittori di Dublino (DdD) sono i seguenti:
1. Conoscenza e capacità di comprensione
- Acquisire familiarità con i concetti fondamentali del Natural Language Processing (NLP).
- Comprendere le principali tecniche statistiche e neurali per l'elaborazione del linguaggio naturale.
- Conoscere gli strumenti e modelli più recenti nel settore del NLP, inclusi Word2Vec, FastText, GloVe, BERT, GPT.
2. Conoscenza e capacità di comprensione applicate
- Applicare algoritmi e modelli NLP a problemi reali quali machine translation e hate speech detection.
- Utilizzare strumenti open-source per implementare sistemi di NLP.
- Progettare e sviluppare un'applicazione NLP partendo da un dominio specifico
3. Autonomia di giudizio
- Essere in grado di scegliere i metodi e modelli più appropriati per risolvere compiti specifici relativamente all'analisi del linguaggio naturale.
- Analizzare l'efficacia di modelli linguistici
4. Abilità comunicative
- Presentare in modo chiaro e argomentato un progetto di NLP, anche attraverso esposizione orale.
- Comunicare i risultati dell’analisi a un pubblico tecnico e non.
- Collaborare in gruppo per la realizzazione di un progetto complesso, condividendo conoscenze e strategie.
5. Capacità di apprendere
- Sviluppare capacità autonome di studio attraverso il completamento di assignment facoltativi derivanti da attività di laboratorio focalizzate all'uso di modelli e strumenti di NLP.
Contenuti sintetici
Il contenuto del corso include i principi fondamentali dell'elaborazione del linguaggio naturale (NLP) e offre una panoramica degli strumenti chiave utilizzati in questo campo. Il corso coprirà una vasta gamma di argomenti, che vanno dalle tecniche statistiche ai recenti progressi negli approcci neurali. Inoltre, il corso comprende dimostrazioni pratiche di diverse applicazioni di NLP, tra cui traduzione automatica e rilevamento dell'incitamento all'odio.
Programma esteso
Introduzione al corso
- Approcci razionalisti ed empiristi al linguaggio
- L'ambiguità del linguaggio: perché il NLP è difficile
Elementi linguistici essenziali
- Risorse lessicali
- Legge di Zipf
- Collocazioni
- Sintassi
Rappresentazione frequentista del testo (TF, TF-IDF, ecc.) e word embedding
- Word2Vec
- FastText
- Glove
Tecniche di visualizzazione degli embeddings:
- PCA
- t-SNE
- UMAP
Sequence-to-sequence (RNN, LSTM)
Transformer e modelli linguistici di grandi dimensioni
- Meccanismi di attenzione: self- e multi-head attention
Modelli linguistici contestualizzati:
- ELMO
- BERT
- GPT
- LLAMA
Prompting e fine-tuning
Metriche di valutazione dei modelli del linguaggio
Explainability dei modelli linguistici
Prerequisiti
Basic knowledge of statistics and programming languages.
Modalità didattica
Il corso sarà tenuto in lingua inglese e si articolerà sia in lezioni frontali che introdurranno gli argomenti principali, sia in sessioni tutoriali in cui verranno spiegati gli strumenti open source.
Possono far parte del corso seminari tenuti da esperti a livello nazionale e internazionale.
24 lezioni da 2 ore svolte in modalità erogativa in presenza.
Materiale didattico
Daniel Jurafsky and James Martin, "Speech and Language Processing, 2nd Edition", Prentice Hall, 2008.
Emily M. Bender, "Linguistic Fundamentals for Natural Language Processing", Synthesis lectures on human language technologies, Morgan&Claypool Publishers, 2013.
Yoav Goldberg, "Neural Network Methods for Natural Language Processing", Synthesis lectures on human language technologies, Morgan&Claypool Publishers, 2017.
Mohammad Taher Pilehvar and Jose Camacho-collados, "Embeddings in Natural Language Processing", Synthesis Lectures on Human Language Technologies, Morgan & Claypool Publishers, 2021.
Periodo di erogazione dell'insegnamento
Second Semester
Modalità di verifica del profitto e valutazione
Progetto
• Il progetto consiste nello sviluppo di uno strumento per l'elaborazione del linguaggio naturale basato su metodi e modelli presentati durante il corso.
• E' necessario identificare un dominio di interesse e un set di dati per il quale si intende affrontare compiti specifici che coinvolgano metodi, modelli e strumenti di NLP.
• Il progetto deve essere presentato oralmente
• Il progetto viene valutato nell'intervallo [0-24] in accordo ai seguenti criteri:
- Definizione del problema e degli obiettivi: max 2 punti
- Giustificazione delle scelte metodologiche: max 3 punti
- Implementazione e correttezza del codice: max 4 punti
- Analisi dei risultati sperimentali: max 6 punti
- Completezza e chiarezza della relazione finale: max 6 punti
- Conclusioni e considerazioni finali: max 3 punti
Esame orale
• La prova orale può avere un esito compreso tra [-8; +8]
• Si compone di 4 domande su argomenti affrontati durante il corso: -2 punti per una risposta errata o per nessuna risposta, +2 punti per una risposta corretta.
Non sono previste prove in itinere.
Orario di ricevimento
To be agreed with the teacher
Aims
The aim of the course is to provide an introduction to the fundamental concepts of Natural Language Processing (NLP) as well as an overview of the main tools used in the field. In addition, some applications of NLP will be presented, e.g. machine translation and hate speech detection.
The specific objectives with respect to the Dublin Descriptors (DdD) are the following:
1. Knowledge and understanding
- Become familiar with the fundamental concepts of Natural Language Processing (NLP).
- Understand the main statistical and neural techniques for natural language processing.
- Become familiar with the most recent tools and models in the NLP field, including Word2Vec, FastText, GloVe, BERT, GPT.
2. Applied knowledge and understanding
- Apply NLP algorithms and models to real-world problems such as machine translation and hate speech detection.
- Use open-source tools to implement NLP systems.
- Design and develop an NLP application starting from a specific domain
3. Autonomy of judgment
- Be able to choose the most appropriate methods and models to solve specific tasks related to natural language analysis.
- Analyze the effectiveness of linguistic models
4. Communication skills
- Present an NLP project clearly and with arguments, also through oral presentation.
- Communicate the results of the analysis to a technical and non-technical audience.
- Collaborate in a group for the realization of a complex project, sharing knowledge and strategies.
5. Ability to learn
- Develop independent study skills through the completion of optional assignments deriving from laboratory activities focused on the use of NLP models and tools.
Contents
The course content includes fundamental principles of Natural Language Processing (NLP) and offers an overview of the key tools utilized in this field. The course will cover a range of topics, ranging from statistical techniques to recent advancements in neural approaches. Moreover, the course incorporates practical demonstrations of different NLP applications, including machine translation, and hate speech detection.
Detailed program
Course introduction
- Rationalist and Empiricist Approaches to Language
- The Ambiguity of Language: Why NLP Is Difficult
Linguistic Essentials
- Lexical resources
- Zipf’s laws
- Collocations
- Concordances
- Syntax
Frequentist Representation of Text (TF, TF-IDF, etc..) and Word Embeddings
- Word2Vec
- FastText
- Glove
Visualization of embeddings:
- Principal Components Analysis
- T-distributed stochastic neighbor embedding
- Uniform Manifold Approximation and Projection
Sequence-to-Sequence (RNN, LSTM)
Transformers and Large Language Models
- Attention Mechanisms: Self and Multi Head Attention
Contextualized Language Models:
- ELMO
- BERT
- GPT
- LLAMA
Prompting and Instruct Tuning
Language Model Evaluation Metrics
Interpretability and Explainability of Language Models
Prerequisites
Basic knowledge of statistics and programming languages.
Teaching form
The course will be taught in English, and it will consist of both lectures introducing the main topics and tutorial sessions where open-source tools will be explained.
Seminars held by experts at national and international levels may be part of the course.
24 lectures of 2 hours delivered in person.
Textbook and teaching resource
Daniel Jurafsky and James Martin, "Speech and Language Processing, 2nd Edition", Prentice Hall, 2008.
Emily M. Bender, "Linguistic Fundamentals for Natural Language Processing", Synthesis lectures on human language technologies, Morgan&Claypool Publishers, 2013.
Yoav Goldberg, "Neural Network Methods for Natural Language Processing", Synthesis lectures on human language technologies, Morgan&Claypool Publishers, 2017.
Mohammad Taher Pilehvar and Jose Camacho-collados, "Embeddings in Natural Language Processing", Synthesis Lectures on Human Language Technologies, Morgan & Claypool Publishers, 2021.
Semester
Second Semester
Assessment method
Project
• The project consists in the development of a natural language processing tool based on methods and models presented during the course.
• Each group/individual must identify a domain of interest and dataset for which it intends to address specific NLP tasks.
• The project must be presented orally
• The project is evaluated in the range [0-24] according to the following criteria:
- Definition of the problem and objectives: max 2 points
- Justification of the methodological choices: max 3 points
- Implementation and correctness of the code: max 4 points
- Analysis of the experimental results: max 6 points
- Completeness and clarity of the final report: max 6 points
- Conclusions and final considerations: max 3 points
Oral Exam
• The oral exam can have an outcome between [-8; +8]
• It consists of 4 questions about topics addressed during the course: -2 will be given for an incorrect answer or no answer, +2 for a correct answer.
There are no mid-term tests.
Office hours
To be agreed with the teacher