Introduction To NLP
Introduction To NLP
Langage Naturel
Introduction to NLP
K. BELATTAR,
[email protected]
Nombre de crédits : 03
Coefficient de la matière : 03
Site : https://canvas.instructure.com/enroll/4GEPW8
28/11/2023 2
Prerequisites
Requirements
• Statistics and probability
• Linear algebra (vector space)
• Python programming
Courses objectives
- Understand the fundamentals of natural language processing
- Grasp basic techniques in artificial intelligence to address problems studied in
NLP
Course evaluation (continuous assessment+ final exam)
28/11/2023 3
Is Natural Language Processing important?
28/11/2023 4
Is Natural Language Processing important?
Abundance of data in Natural Language
Massive amount of data available electronically in the form of natural
language texts (online newspapers, Wikipedia, etc.) with multilinguage
content. Percentage of internet users per langage (March, 2020)
https://explodingtopics.com/blog/data-generated-per-day https://en.wikipedia.org/wiki/Languages_used_on_the_Internet
28/11/2023 5
Is Natural Language Processing important?
28/11/2023 6
Is Natural Language Processing important?
Machine-Facilitated Human-Human Communication
Significant portion of human-human communication is facilitated by
machines NLP.
28/11/2023 8
Natural language processing
https://www.analyticsvidhya.com/blog/2021/06/part-2-step-by-step-guide-
to-master-natural-language-processing-nlp-in-python/
28/11/2023 9
Natural language processing
Morphological Analysis
To understand distinct words according to their morphemes (the
smallest units of meaning)
For example, consider the word: “unhappiness ”
We can be broken down into three morphemes named prefix, stem,
and suffix, with each conveying some form of meaning:
• The prefix un- refers to “not being”,
• The suffix -ness refers to “a state of being”.
• The stem happy is considered a free morpheme since it is a “word”
on its own.
28/11/2023 10
Natural language processing
Lexical Analysis
The process of identifying and analyzing the structure of words and phrases.
Output: sequence of tokens
Exemple: The sentence “He goes to college.” is divided into [ ‘He’ , ‘goes’ , ‘to’ ,
‘college’, ‘.’]
- Lexicon normalization:
(1) Stemming
économie, économiquement, économiste → économ
(2) Lemmatization
lemme des mots «petit, petite, petits et petites» est «petit»
28/11/2023 11
Natural language processing
Syntactic analysis
1) To check whether the words are well-formed or not
For example, consider the phrase “Colourless red idea.” This would be
rejected by the syntactic analysis as the colorless word here with red doesn’t
make any sense.
2) To analyze the words of a sentence so as to uncover the grammatical
structure of the sentence. subject
D N D N
D
check the Soup
28/11/2023 The cooks 12
Natural language processing
Semantic analysis
To determine the possible meanings of a sentence based on the
interactions among word-level meanings in the sentence.
For example , the semantic analysis disregards sentences such as “I
hate hot ice cream”.
28/11/2023 13
Natural language processing
Discourse analysis
Process of exploring the relationships between sentences, identifying
the main subject and understanding how each sentence contributes
to text’s overall meaning.
For example, consider the sentence “He wanted that”
Here, the word “that” in the sentence depends upon the prior
discourse context.
28/11/2023 14
Natural language processing
Pragmatic analysis
The study of contextual meaning.
For example, consider the sentence “close the window?”
This sentence should be interpreted as a request instead of an order.
28/11/2023 15
Approaches to NLP
28/11/2023 16
NLP challenges
28/11/2023 17
NLP challenges
Exemple of NLP ambiguity:
- I prepared (cooked) her a duck (for let her eat it)
28/11/2023 18
NLP challenges
Exemple of NLP expressiveness:
Could you please do it for me?
- No!
- I will not do it
- I would not do it
- I can’t
- I am afraid this will not be possible
28/11/2023 19
NLP challenges
28/11/2023 20
NLP applications
28/11/2023 21
NLP applications
[2] Khennak Ilyes. Traitement Automatique du Langage Naturel (TALN), USTHB, 2023.
[5] Yoav Goldberg. A Primer on Neural Network Models for Natural Language Processing
[6] Delip Rao and Brian McMahan. Natural Language Processing with PyTorch
28/11/2023 23