Vai al contenuto
Artificial Intelligence and Automation Engineering

Siena

Language Processing Technologies

ING-INF/05Primo Semestre54 oreOraleInglesea.a. 2026/2027
Programma
Formal Languages Strings and Languages. Formal definition of language. Grammars. Classification of grammars and languages. Regular languages. Lexical parsing and regular expressions (REGEX). Regular expressions and finite state automata. The POSIX 1003.2 standard for REGEX. Design of lexical scanners. Use of regex library in python. Context-free languages. Syntactic parsing: parse trees, ambiguity, top-down and bottom-up parsers. Top-down recursive parsing. LL(1) parsers. Bottom-up shift-reduce parsers. Conflicts in parsing tables. LR(k) grammars and parsers. Construction of bottom-up parsing tables: the case of SLR grammars. The Earley Parser. Use of parser generators: Lark in python. Natural Language Processing Words. Lexicons. Morphology: morphemes, affixes, morphotactics, and orthographic rules. The case of English: nouns, verbs, irregular forms. Morphological parsing. Models of morphology by Finite State Automata. Finite State Transducers and implementation of morphological parsers. Language Models. Statistical Language Models. Generative Language Models. N-gram models. Unigrams and Naive Bayes classifiers. Bigrams. Probability extimation. Brief overview on smoothing a back-off techniques. Text normalization and tokenization. Byte Pair Encoding (BPE). Word Piece. Tokenizer libraries in python. Word semantics. Lexical semantics. Senses. Polysemy. Synonymy. Sense hierarchies: hyponymy and hypernymy. Wordnet. Synsets. Structure of relationships in Wordnet. Wordnet in python with NLTK. Wordnet similarity. Distributional semantics. Vector embeddings of words. Word2vec. Continous-Bag-of-Words (CBOW). Continous skip-gram. The library fasttext in python for word embeddings. Neural Language Models. N-gram neural language models. Models based on Recurrent Neural Networks (RNNs). Long-Short-Term-Memory networks. Stacked and bi-directional RNNs. Sequence generation with causal language models: greedy generation, beam search, sampling. Encoder-decoder networks. Attention. Transformers. The encoder-decoder architecture. The transformer block. Positional encoding. Multi-head Self-attention. Training and generation. Encoder-based models: Bidirectional Encoder Representations from Transformer (BERT). Decoder-based models: Generative Pre-Trained Transformer (GPT). Large Language Models (LLMs). Pre-Training and Fine-Tuining. LoRA. LLM prompting and alignment. Prompts and prompt templates. Zero-shot and Few-shot learning. Instruction tuning. Chain-of-Thought (CoT) prompting. Reinforcement Learning with Human Feedback (RLHF). Rejection sampling. Direct Preference Optimization (DPO). Transformers libraries. SentenceTransformer. Hugginface tranformers. AutoClass. Models. Tasks. Pipelines. Training. Question Answering (QA) and Retrieval Augmented Generation (RAG). Chatbots. Langchain. Chat model. Prompt templates. Structured outputs. Chat states. Document. Vector stores. RAG implementation. NLP classics. Part of Speech Tagging. Tagsets and PoS taggers. Brief overview of HMMs for PoS tagging. Syntax. Constituent parsing. Chunking (Shallow parsing). The role of Context Free Grammars. Features and constraints (e.g. number agreement). Dependency parsing. NLP libraries (spacy).
Modalità d'esame
Oral exam focused on the discussion of two projects. 1. Project consisting in the development of a parser for a context free language using lark (assigned by instructor). Discussion concerns the design of the grammar and the implemented code. Only code is required. Typical assignment deal with the grammar describing the structure of some programming language instructions. 2. Project consisting in a practical experimentation on an NLP task using the libraries presented in the course (suggested). The project topic is proposed by the student. The project can also be developed in team (2-3 students) depending on its complexity. The project is presented explaining the code, the approach and used models. Slides are not mandatory, but they can be used to support the presentation. The practical project may be replaced by a paper review. The paper may be selected from the ACL anthology. The paper is selected by the student, but requires approval by the instructor. The student must prepare a presentation with a critical discussion on the paper contents. The exam also includes questions on Formal Languages.
Obiettivi
Knowledge of formal language theory Ability to design lexical scanners with regular expressions Ability to design context free grammars and to use parser generators Knowledge of Natural Language Processing models and tools Ability to use tools for Language Modeling and Transformer Libraries Knowledge of Large Language Models (LLMs) Ability to build language processing pipelines based on LLMs
Prerequisiti
Basics of Artificial Intelligence and Machine Learning. Main concepts from probability theory. Basics of programming (python).

Programma dell'a.a. 2025/2026: quello del 2026/2027 non è ancora pubblicato dal docente.

Fonte: scheda ufficiale dell'insegnamento, sito di Siena.