Traitement Automatique du
Langage Naturel
Introduction to NLP
K. BELATTAR,
belattar.alger1@gmail.com
Département Génie industriel - École Nationale Polytechnique
28/11/2023 1
Présentation de la matière
Semestre : 01
Intitulé de l’UE : UEM211 (Unité Enseignement méthodologique)
Intitulé de la matière: Traitement automatique du langage naturel
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?
• Massive amount of data available electronically in the form of natural
language texts (online newspapers, Wikipedia, etc.)
• 2005: production of 6.5 Exabytes per year of text
• September 2008: Google processed 20 Petabytes of text data per day
• Conversational agents have become an important form of human-
machine communication.
• A significant portion of human-human communication is facilitated by
machines.
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?
Rise of Conversational artificial intelligence
Conversational agents (chatbot and virtual assistant) have become an
important form of human-machine communication.
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.
Digital Platforms and Messaging and Email and Online
Social Media Chat Applications Virtual Meetings and
Communication
Video Calls
28/11/2023 Conversational Agents 7
Language Translation Services
and Chatbots
Natural language processing
Natural language processing (NLP) is a branch of
artificial intelligence (AI) at the crossroads of linguistics
(speech and text), computer sciences, mathematics,
statistics.
Aim : To develop technology tools that can understand
and generate natural language to make the use of
technology seamless, intuitive/natural as soon as
possible.
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
For example, the chef cooks the soop NP VP NP
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
Rule-based a set of rules used to express all the expert knowldge
relating to any task of NLP (lexical analysis, syntactic analysis, etc.)
Statistical NLP consists of extraction of statistics about the occurrence
of words, grammatical categories named entities with appropriate
techniques to do the analysis.
Machine learning techniques (especially neural networks and deep
learning more recently).
28/11/2023 16
NLP challenges
(1) Ambiguity phonological, lexical, syntactic, semantic,…etc.
(2) Expressiveness: natural languages have fairy different alternatives
for expressing the same idea.
(3) A lot of content is implicit which requires knowledge to understand
utterance.
28/11/2023 17
NLP challenges
Exemple of NLP ambiguity:
- I prepared (cooked) her a duck (for let her eat it)
- I prepared (cooked) his duck
- I made his duck (wooden/ceramic?)
- I forced him to bend like a duck
- I used my magic wand and transformed into a duck!!
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
Exemple of implicit knowledge:
The mankeys were chasing the cats, we gave them bananas because
they were hungry.
Exemple of handling discourse:
John woke up late today. His alarm broke.
28/11/2023 20
NLP applications
Voice recognition Handwriting recognition Automatic translation
Spell check Text summarization Question-answering systems
28/11/2023 21
NLP applications
Virtual assistant Research systems Event extraction
Spam recognition Sentiment analysis
28/11/2023 22
References
[1] https://web.stanford.edu/~jurafsky/slp3/
[2] Khennak Ilyes. Traitement Automatique du Langage Naturel (TALN), USTHB, 2023.
[3] Jurafsky and Martin. Speech and Language Processing
[4] Jacob Eisenstein. Natural Language Processing
[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