Fundamental of AI
(BE02000041)
Unit – 2
Knowledge Representation -
Natural Language Processing
Prof. Hitesh D. Rajput
Asst. Prof., Computer Engineering Department,
L. D. College of Engineering, Ahmedabad
Outline
• What is NLP?
• Importance of NLP
• Components of NLP
• Basic steps in NLP
• Challenges in NLP
• Applications of NLP
• Current Trends in NLP
• Future of NLP
• Summary
What is NLP?
Definition:
• Natural Language Processing
(NLP) is a subfield of artificial
intelligence (AI) that focuses on
the interaction between
computers and human language.
• It enables machines to understand, interpret, and respond to
human language in a way that is both meaningful and useful.
Key Points:
• Combines linguistics (language) and computer science
(algorithms).
• NLP allows computers to process and analyze vast amounts of
natural language data.
Importance of NLP
• NLP uses many different
techniques to enable computers to
understand natural language as
humans do.
• Whether the language is spoken or
written, NLP can use AI to take real-
world input, process it and make
sense of it in a way a computer can
understand.
• Just as humans have different sensors -- such as ears to hear and
eyes to see -- computers have programs to read and microphones to
collect audio.
• And just as humans have a brain to process that input, computers
have a program to process their respective inputs.
• At some point in processing, the input is converted to code that the
computer can understand.
Components of NLP
1. Syntax:
• Deals with the structure of sentences
(grammar rules).
• Involves parsing to understand how
words relate in a sentence.
2. Semantics:
• Focuses on the meaning of words and
sentences.
• Aims to understand the context behind
words and their relationships.
3. Pragmatics:
• Looks at how language is used in context and how meaning changes in
different situations.
4. Morphology:
• Studies the structure and formation of words.
5. Phonetics:
• Involves the study of sounds in speech, including speech-to-text
conversion.
Basic Steps in NLP
1. Tokenization:
• Breaking text into smaller units (tokens), such as
words, sentences, or paragraphs.
Basic Steps in NLP
2. Named Entity Recognition (NER):
• Identifying proper nouns or named entities (e.g.,
names of people, organizations, locations).
Basic Steps in NLP (Contd..)
3. Part-of-Speech Tagging:
• Assigning words with a part of speech (noun, verb,
adjective, etc.).
4. Sentiment Analysis:
• Determining whether the text expresses positive,
negative, or neutral sentiment.
Basic Steps in NLP (Contd..)
5. Stemming and Lemmatization:
• Reducing words to their base or root form (e.g.,
“running” to “run”).
Challenges in NLP
• Ambiguity: Words can have multiple meanings depending on
context (e.g., "bat" can mean a flying mammal or a piece of
sports equipment).
• Syntax Variations: Sentence structures vary across languages
and dialects, making it difficult for machines to interpret.
• Context Understanding: Understanding the context of a
conversation is crucial for accurate interpretation, especially in
longer texts or dialogues.
• Sarcasm and Irony: Machines struggle to understand nuances
like sarcasm, making interpretation difficult.
Applications of NLP
Applications of NLP
Applications of NLP
• Machine Translation: Automatically translating text or speech
between languages.
• Speech Recognition: Converting spoken language into text for
virtual assistants, transcription services, etc.
• Text Classification: Categorizing text into predefined categories
(e.g., spam detection, news categorization).
• Chatbots and Virtual Assistants: Enabling interactive
conversations with users (e.g., Siri, Alexa, Google Assistant).
• Sentiment Analysis: Analyzing customer reviews or social
media posts to determine sentiment (positive/negative).
• Information Retrieval: Identifying and retrieving the data from
the database
• Information Extraction: Automatically extract structured
information from unstructured text
Current Trends of NLP
Deep Learning in NLP:
• Using neural networks (e.g., transformers) for more accurate
language modeling and text generation.
• Models like GPT-3 and BERT are pushing the boundaries of NLP
capabilities.
Multilingual NLP:
• Building models that can handle multiple languages and
dialects seamlessly.
Explainability in NLP Models:
• Understanding why a model made a specific decision or
output, which is important for trust in AI systems.
Future of NLP
Enhanced Human-Computer Interaction:
• More natural, seamless communication between humans and
machines.
Improved Contextual Understanding:
• Achieving deeper understanding of complex sentences, idioms,
and cultural nuances.
Personalized Services:
• Using NLP to create more tailored and intuitive user
experiences, such as personalized news feeds or virtual
assistants.
Summary
• NLP enables machines to interact with human language,
making it one of the most exciting areas of AI research.
• While challenges like ambiguity and context understanding
remain, techniques such as deep learning and advancements in
multilingual processing are driving the future of NLP.