Natural Language Processing and Computer Vision
What the exam tests
You must describe a text-processing pipeline, distinguish rule-based, retrieval-based, and generative chatbots, and explain the basics of image classification, including why convolutional networks suit images.
Core concepts
- Text pipeline: lowercasing and cleaning → tokenisation → stop-word removal → stemming or lemmatisation → vectorisation (bag of words, TF-IDF, embeddings) → model.
- Stemming vs lemmatisation: stemming chops affixes crudely ('studies' → 'studi'); lemmatisation uses vocabulary and grammar to return a real word ('studies' → 'study').
- Chatbots: rule-based systems match keywords; retrieval-based systems fetch the closest stored answer; generative systems produce new text from a language model.
- Images as data: a colour image is a grid of pixels with red, green, and blue channels; a 64 × 64 RGB image holds 64 × 64 × 3 = 12,288 values.
- CNNs: convolution filters slide across the image to detect local patterns such as edges; pooling shrinks the feature map; deeper layers combine edges into shapes and objects.
Worked example
A model classifies 64 × 64 RGB photos of healthy and diseased leaves. A student flattens each image into a 12,288-length vector and feeds it to a dense network, which performs poorly. Reasoning: flattening destroys which pixel neighbours which, so the network cannot learn that a spot is a local pattern. A CNN keeps the 2-D grid, learns small filters, and shares weights across positions, so it detects spots anywhere in the image with far fewer parameters. The CNN is the correct choice.
Traps that cost marks
- Removing all stop words before sentiment analysis, which can erase negation such as 'not good'.
- Mixing up stemming (crude, may give non-words) with lemmatisation (dictionary form).
- Thinking bag of words preserves word order; it does not.
- Calling a chatbot 'generative' when it only matches pre-written replies.
- Forgetting the channel dimension when computing image size.