ASSIGNMENT-4 (AI AND ML ):
Q1. What is NLP?
NLP (Natural Language Processing) is a subfield of artificial
intelligence that focuses on enabling computers to understand,
interpret, and generate human language. It combines computer
science, linguistics, and machine learning to analyze, process, and
generate natural language data.
Q2. Different NLP Models:
Some popular NLP models include:
1. Word2Vec
2. GloVe
3. FastText
4. BERT (Bidirectional Encoder Representations from Transformers)
5. RoBERTa (Robustly optimized BERT approach)
6. XLNet
7. Transformer-XL
8. Long Short-Term Memory (LSTM) networks
9. Recurrent Neural Networks (RNNs)
10. Convolutional Neural Networks (CNNs) for NLP
Q3. Difference Between Stemming and Lemmatization:
Stemming and lemmatization are text normalization techniques:
- Stemming reduces words to their base form using algorithms (e.g.,
Porter Stemmer).
- Lemmatization uses dictionaries to find the root word (lemma).
Example:
- Stemming: "running" becomes "run"
- Lemmatization: "running" becomes "run" (using dictionary lookup)
Q4. BOW (Bag of Words):
BOW is a representation of text data as a bag, or a set, of its word
frequencies:
- Ignores word order and grammar
- Represents text as a numerical vector
- Used in information retrieval, text classification, and topic modeling
Q5. Converting Paragraph to Numerical Form:
Example paragraph: "The quick brown fox jumps over the lazy dog."
Applying techniques:
- Tokenization: ["The", "quick", "brown", "fox", "jumps", "over",
"the", "lazy", "dog"]
- Stopword removal: ["quick", "brown", "fox", "jumps", "lazy"]
- Stemming/lemmatization: ["quick", "brown", "fox", "jump", "lazi"]
- BOW representation: [1, 1, 1, 1, 1, 0, 0, ...] (binary vector)
Q6. Environment in AI:
In AI, an environment refers to the external space where an intelligent
agent interacts:
- Includes other agents, objects, and conditions
- Provides feedback to the agent's actions
- Can be fully or partially observable
Q7. Fixed vs. Dynamic Environment:
Fixed Environment:
- Unchanging rules and conditions
- Deterministic outcomes
Dynamic Environment:
- Changing rules or conditions
- Stochastic or uncertain outcomes
Q8. Wumpus World AI Example:
The main goal of the Wumpus World example is to illustrate agent
navigation and decision-making:
- An agent must avoid obstacles (pits) and danger (Wumpus)
- Find and grab gold
- Return to the starting point
Q9. Types of Agents:
1. Simple Reflex Agents
2. Model-Based Reflex Agents
3. Goal-Based Agents
4. Utility-Based Agents
5. Learning Agents
Q10. Embedding Techniques in NLP:
Popular embedding techniques:
1. Word2Vec
2. GloVe
3. FastText
4. BERT
5. RoBERTa
6. XLNet
7. Transformer-XL
8. ELMo (Embeddings from Language Models)
9. Character Embeddings
10. Sentence Embeddings (e.g., Sentence-BERT)