Majid Al-RaimiApplications of NLP

ICS 582Lecture 01Part 02

Applications of NLP

Five application families with the products that ship them: fully automatic and computer-aided machine translation, web question answering before and after LLMs, spelling and grammar correction, information extraction, and aspect-level sentiment analysis.

Concepts
5
Slides
7-13
Reading
30 min
Understood
0/5 concepts

Why this part matters

Your PhD work will build or evaluate systems like the ones on these seven slides, and a good answer about this lecture names each application together with the NLP task hiding behind it. A screenshot of Google Translate is not an answer. "Fully automatic translation for information access, versus computer-aided translation where a human owns the final text" is.

This part turns seven product screenshots into five reusable ideas: the human-in-the-loop spectrum (machine translation), extraction versus generation (question answering), dictionary versus context (spelling), text to fields (information extraction), and target plus polarity (sentiment). Along the way it plants one more idea that part 03 formalises: most NLP products are chains of components, and every link in the chain can be wrong.

By the end you can

  1. Contrast fully automatic and computer-aided translation, and say when a human must stay in the loop.
  2. Explain the three steps behind a factual answer box, and how retrieval-augmented generation changes both the output and the failure mode.
  3. Distinguish non-word from real-word spelling errors, and say why the second needs a language model.
  4. Read an email and fill an event template, including normalising 'tomorrow' against the message date.
  5. Explain why sentiment must be assigned per aspect, using the word 'light' as the worked case.

Take the definition of NLP from part 01, paste it into Google Translate, and pick Arabic. In under a second the right pane fills with معالجة اللغة الطبيعية هي فرع من فروع الذكاء الاصطناعي and a Latin transliteration line underneath. Nobody touched that output. The system read 142 characters of English and produced finished Arabic. That is machine translation in its fully automatic mode, and it is the mode most people picture when they hear the words.

Now look at the second screenshot on the same slide, which looks nothing like a consumer product. The source box holds an Arabic news sentence about the Lebanese president being subjected to a fierce campaign in parliament. The translator has typed one word into the translation box, lebanese, and the system has answered with a ranked list of what the next word could be: president, suffered, exposed, president emile, before, presented, offer. The human is still writing the sentence. The machine is predicting where the sentence goes next. This is computer-aided translation, and its existence is the most important fact on the slide: the professional tool keeps the human in charge.

Interactive computer-aided translation: the human validates a prefix (lebanese), the system proposes ranked suffixes, the human accepts one and the caret moves on

Two modes, and who owns the final text

Jurafsky and Martin list three uses of MT: information access, aiding human translators, and in-the-moment communication. Fully automatic MT serves information access: you want to read a page written in a language you do not know, and a rough but instant translation is worth more than a perfect one next week. Google Translate alone, they note, translates hundreds of billions of words a day between over 100 languages. The second use is aiding human translators. Here the system is not the author. It drafts a translation that a person then fixes, a workflow called post-editing. Interactive systems (Barrachina et al., 2009) go further: they sit inside the editor and predict as the person types, which is what the slide shows.

The interactive kind has a precise description. Barrachina and colleagues put it this way: in each iteration, a prefix of the translation is validated (accepted or amended) by the human and the system computes its best, or n-best, translation suffix to complete that prefix. Read the slide's list with that in mind and it stops being a random menu. The list is an n-best set. "suffered" and "exposed" are two English readings of the same Arabic verb تعرض, and "president" versus "president emile" are two choices about how much of the source to consume in one step. The translator resolves in one click what a fully automatic system would have to gamble on.

ModeWho produces the final textTypical useSlide 7 example
Fully automaticThe systemInformation access, gisting, chatGoogle Translate rendering the NLP definition in Arabic
Assisted, post-editingThe human, correcting a machine draftLocalisation, documentationNot pictured, but the common industrial workflow
Assisted, interactive predictionThe human, accepting or amending predicted suffixesProfessional translation of news, legal and medical textThe ranked list under the typed word lebanese
Two modes of machine translation

Why keep the human at all, when the top screenshot is so good? Because the same paper opens with the plain admission that current MT systems are still not perfect and that in practice their output needs to be edited to correct errors. Which errors matter depends on the text. A gisted news article can survive a wrong verb. A contract, a drug label or a court transcript cannot, and someone must be accountable for the register, the terminology and the liability. The assisted mode is how the field turned an imperfect technology into a productivity tool rather than waiting for a perfect one.

Recall

Name the two modes of machine translation on slide 7 and say who produces the final text in each.

Fully automatic: the system produces the final output, as in the Google Translate screenshot, used for information access. Assisted or computer-aided: the human produces the final text, and the system either drafts for post-editing or predicts completions interactively, as in the ranked list under lebanese.

Quick check

On slide 7, what does the ranked list under the typed word 'lebanese' represent?

The product numbers, and why they are pipelines

Slide 8 adds two products with feature lists. The Google Translate app page counts how many languages each mode supports, and the Skype Translator blurb promises voice calls in seven languages and adds a line worth remembering: it uses machine learning, so the more you use it, the better it gets. That sentence is the whole of part 03 in miniature. The system is not a fixed set of rules; it is a model that improves with data.

As printed on slide 8 (historical)

Google Translate, typing
103 languages
Google Translate, offline
52 languages
Google Translate, instant camera translation
30 languages
Google Translate, camera mode (photos)
37 languages
Google Translate, conversation mode (two-way speech)
32 languages
Skype Translator, voice calls
7 languages
Skype Translator, instant messaging
more than 50 languages

The more durable lesson on the slide is structural. Typing 103 languages is one system: text in, text out. Camera mode is not. To translate the Russian street sign in the photo, the phone must first read the pixels as characters (optical character recognition), then translate the characters, then paint the English back onto the image. Conversation mode is longer still: recognise speech, translate, synthesise speech in the other language. Jurafsky and Martin describe exactly this image-centric case, OCR of the text on a phone camera image used as input to an MT system to translate menus or street signs.

Camera image
pixels

A photo of a sign or a menu.

OCR
Recognised text
characters

Wrong letter here, wrong word later.

MT
Translated text
target language

The only NLP step the slide names.

render
Overlay
on screen

Painted back over the sign.

Camera mode is a chain. MT is one link, and an error in any earlier link reaches the user.
Speech
audio

One speaker talks.

ASR
Transcript
words

Speech recognition guesses the words.

MT
Translated text
target language

Same MT engine as above.

TTS
Synthesised speech
audio

The other speaker hears it.

Conversation mode adds a link at each end: speech recognition before MT and speech synthesis after it.

Keep this picture. When part 03 introduces the linguistic pipeline from paragraphs down to morphemes, and when part 04 lists the ways language defeats a system, both are describing links in chains like these. A product that looks like one feature is usually three or four NLP tasks in a row, and the quality the user sees is the product of all of them.

Type how heavy is our planet into a search engine and two very different things can come back. On slide 9 the engine answers with a card: Earth, Mass, 5.972 × 1024 kg, a photograph, and a row of related planets. On slide 10 the same query produces an AI Overview: a paragraph explaining that Earth has a mass of approximately 5.972 × 1024 kilograms, about 13.1 septillion pounds, measured using gravity rather than scales, with a heading on how scientists measure it and two cited sources in a side rail. Both are question answering. They are built on opposite principles.

What the answer box has to get right

The card looks trivial and hides three separate decisions. The slide's own label names two of them: information extraction and word sense disambiguation. Start with the word "heavy". It has several senses: heavy rain, heavy traffic, a heavy heart, a heavy object. Only one of them is a physical quantity a database could store, so the system must choose the sense "has a large mass" before it can look anything up. That choice is word sense disambiguation, and the answer card's label "Mass" is the visible trace of it.

The second decision is about "our planet". No table anywhere has a row called "our planet". The phrase is a string; the answer requires a thing. Google's Knowledge Graph was announced in 2012 under exactly that slogan, things not strings: a model that understands real-world entities and their relationships to one another, so that "Taj Mahal" can mean the monument or the musician. Mapping the mention "our planet" to the entity Earth is entity linking. (The literature calls this entity linking; entity resolution more often means merging duplicate records.) Only once both decisions are made does the third step become a lookup: fetch the mass attribute of the Earth node.

A string becomes a thing: 'our planet' is resolved to the Earth node, 'heavy' is read as the mass attribute, and the graph returns one value

Where did the graph get that number? From text, by information extraction: Jurafsky and Martin define IE as turning the unstructured information embedded in texts into structured data, for example for populating a relational database, and note that knowledge graphs of structured relational knowledge are a useful way for search engines to present information to users. The answer box is therefore the last inch of a long chain: extractors read encyclopedias and fact sheets once, store facts as graph edges, and the search engine reads the edge at query time. The same machinery returns in the email example two concepts from now.

Worked example

How the answer box answers 'how heavy is our planet'

  1. Disambiguate the sense

    "heavy" is read as mass, not as the sense in heavy rain or heavy traffic. This selects the attribute to look up.
  2. Resolve the entity

    "our planet" is mapped to the knowledge graph node Earth. This selects the row.
  3. Retrieve the fact

    The pair (Earth, mass) returns 5.972 × 1024 kg, a value that an information extraction system once pulled from a source document into the graph.
  4. One field, rendered

    Earth / Mass / 5.972 × 1024 kg, plus neighbouring nodes (Mars, Venus, Jupiter) as "People also search for".
PlanetSlide 9 valueEarth masses on slideNASA valueNASA ratio to Earth
Earth5.972 × 1024 kg15.9722 × 1024 kg1
Mars6.39 × 1023 kg0.1076.4169 × 1023 kg0.107
Venus4.867 × 1024 kg0.8154.8673 × 1024 kg0.815
Jupiter1.898 × 1027 kg317.81.89813 × 1027 kg317.8
Masses shown on slide 9 versus NASA planetary fact sheets

The ratios check out from the slide's own numbers: 6.39 / 59.72 = 0.107, 4.867 / 5.972 = 0.815 and 1898 / 5.972 = 317.8. The Mars row also carries a quiet lesson: the card shows 6.39 × 1023 kg while NASA's current fact sheet lists 6.4169 × 1023 kg, about 0.4 percent higher. Nothing in the card is broken. An extracted fact is only as accurate as the source it was extracted from, and that is the answer box's characteristic failure: it can only be as wrong as its stored fact, and it has no way to be more right.

What changes when a language model writes the answer

Slide 10 is the same query on a search page with an AI Mode tab and an AI Overview. Nothing was looked up in a graph and rendered as a card. Instead the engine retrieved documents, handed them to a large language model, and let the model write. Jurafsky and Martin call this retrieval-augmented generation: use information retrieval techniques to retrieve documents, then use a large language model to generate an answer conditioned on those documents. The recipe is three lines. Retrieve the top passages for the query, build a prompt that contains the query and those passages, and call the model.

The screenshot shows every ingredient. The retrieved passages are the two cards in the side rail, an AIP Inside Science article titled "How Much Does Earth Weigh?" and the Wikipedia article on Earth. The generation is the paragraph, which is not a quotation from either page but a new text stitched from both, complete with a unit conversion: 5.972 × 1024 kg times 2.20462 lb/kg is 1.317 × 1025 lb, which is the "13,170,000,000,000,000,000,000,000 lbs" in the overview and the "13 thousand, 170 billion trillion pounds" in the AIP article. The citation chips are the last ingredient, what the textbook calls a knowledge citation that helps the user decide whether to trust the generation.

a^=LLM(prompt(q,  retrieve(q,k)))\hat{a} = \text{LLM}\big(\text{prompt}(q,\; \text{retrieve}(q, k))\big)
Retrieval-augmented generation: the answer is generated from the query and the top k retrieved passages

Look closely at the second chip and you can see the seams. Its snippet reads "Table_title: Earth Table_content: header: | Designations | row: ...", which is not prose at all; the retriever pulled a Wikipedia infobox as a flattened table and the model wrote around it. That is the point of the shift: the classic box extracts one structured fact and shows it, the overview retrieves raw text and composes. The output is more helpful, more explanatory and more flexible, and it introduces a failure that the card never had.

PropertyAnswer box (slide 9)AI Overview (slide 10)
What is producedOne field, rendered as a cardA paragraph, with headings and a Show more button
Where the answer comes fromA knowledge graph entryRetrieved pages fed to a large language model
Core NLP stepsSense disambiguation, entity linking, lookupRetrieval, prompt construction, generation
ProvenanceImplicit: the graph itselfExplicit: citation chips next to claims
Main failureA stale, imprecise, or missing factFluent text that is not faithful to the facts or its cited sources
Cost per queryA lookupA large model inference
Extraction versus generation on the same query

That new failure has a name. Large language models hallucinate, and a hallucination, in Jurafsky and Martin's words, is a response that is not faithful to the facts of the world. They report a study in which, asked questions about the legal domain, large language models hallucinated from 69 to 88 percent of the time, and add the more troubling half: it is not always possible to tell when a model is hallucinating, partly because LLMs are not well calibrated, so they can give a very wrong answer with complete certainty. The card can be stale. The paragraph can be wrong while sounding exactly like the truth, and the citations can point to a page that does not say what the paragraph claims.

Recall

What are the three things a classic answer box must do to answer 'how heavy is our planet'?

Disambiguate "heavy" to the sense mass, resolve "our planet" to the entity Earth, and retrieve the (Earth, mass) fact, 5.972 × 1024 kg, from a knowledge graph populated by information extraction.

Quick check

Compared with the classic answer box, what new failure mode does the AI Overview introduce?

Slide 11 shows spelling and grammar correction at work: a Word window with one sentence in it, This is bigger then that ofcourse. Two words are underlined, and the colours are not decoration. ofcourse carries a red squiggle. then carries a blue one, and the context menu under it offers a single replacement, than. Microsoft's documentation spells out the convention: potential spelling errors get a red squiggly line, potential grammatical errors get a blue one. The two colours mark two different problems, and the second is much harder than the first.

Red under a non-word that fails dictionary lookup; blue under a real word that only the context 'bigger ___ that' exposes, with the suggestion 'than'

Jurafsky and Martin draw the line precisely. Non-word spelling correction is the detection and correction of spelling errors that result in non-words, like graffe for giraffe. Real-word spelling correction is the task of detecting and correcting spelling errors even if they accidentally result in an actual word of English. ofcourse is the first kind: it is not in any dictionary, so the check is a lookup that needs no context whatsoever. then is the second kind. It is a perfectly good English word, in the dictionary, spelled correctly. Nothing about the word itself is wrong. What is wrong is the word in this position, between "bigger" and "that", where English demands the comparative partner "than".

That difference is why the second problem is hard. The textbook says it directly: real-word spelling error detection is a much more difficult task, since any word in the input text could be an error. And it is not a rare case. Studies suggest that between 25 and 40 percent of spelling errors are valid English words. A checker that only consults a dictionary silently passes a quarter to nearly half of all mistakes. To catch them, the system must know what English sentences look like, which is to say it needs alanguage model, a model that assigns higher probability to "bigger than that" than to "bigger then that", or a grammar rule that encodes the same preference by hand.

The noisy channel, in one line

The classical machinery for both kinds is the noisy channel model. Imagine the writer meant some word w and a noisy channel, their fingers, produced x. The corrector wants the intended word that best explains what it sees.

w^=argmaxwVP(xw)P(w)\hat{w} = \arg\max_{w \in V} P(x \mid w)\, P(w)
Noisy channel: the channel model (how likely this typo is, given w) times the language model (how likely w is here)

The candidate set V is kept small because the majority of spelling errors consist of a single-letter change, so candidates within one insertion, deletion, substitution or transposition of the typed string (Damerau-Levenshtein distance 1) cover most cases. For a non-word, the language model term just prefers common words. For a real-word error, the channel model works against the correction: in the Mays et al. model the textbook uses, P(x | w) is alpha (about 0.95) when the typed word is the intended one, and only the small remainder 1 - alpha is spread over candidates such as than. The language model term P(w) must therefore outweigh that bias, and it can only do so from context.

Worked example

Why 'then' needs context

  1. Dictionary lookup

    ofcourse is not in the vocabulary. Flag it, generate neighbours within one edit (insert a space, giving "of course"), pick the most probable. No context needed. Red underline.
  2. Dictionary lookup again

    then is in the vocabulary. Lookup passes it. If the checker stopped here, the error would survive.
  3. Generate real-word candidates

    Words within one edit of "then" include than, the, them, ten, hen. Each is a plausible intended word under the channel model.
  4. Score the sentence with a language model

    Under any model of English, "bigger than that" is far more probable than "bigger then that", "bigger the that" or "bigger them that". The product of channel and language model peaks at "than".
  5. Blue underline, one suggestion

    The checker offers than, exactly the menu on the slide. The exact probabilities depend on the model; the ordering does not.

This is also the oldest NLP application most people use every day. Jurafsky and Martin note that spelling correctors are ubiquitous in pretty much any software that relies on keyboard input, from word processors to search boxes to phone keyboards, and the same noisy channel idea reappears in speech recognition and machine translation. Real-word correction was also an early case of a language model doing linguistic work that no dictionary could, which is the pattern the whole modern field follows.

Recall

Which of 'then' and 'ofcourse' is a non-word error, and why is the other one harder to catch?

ofcourse is a non-word error: it is not in the dictionary, so lookup catches it with no context. then is a real-word error: the word exists, so only the context "bigger ___ that" reveals the mistake, which needs a language model or a grammar rule. Between 25 and 40 percent of spelling errors are of this kind.

Quick check

Why does Word need context to flag 'then' but not 'ofcourse'?

An email arrives for Dan Jurafsky, dated January 15, 2012, subject "curriculum meeting". The body is two lines: "Hi Dan, we've now scheduled the curriculum meeting. It will be in Gates 159 tomorrow from 10:00-11:30. -Chris". Beside it sits a grey card that the mail client has filled in by itself: Event, Date, Start, End, Where, and a blue button, Create new Calendar entry. The email is prose. The card is a record. Getting from one to the other is information extraction, and the card is the clearest picture of it in the whole lecture.

ExtractorFrom an email to a calendar record

Hover or tap a span in the email, or a field in the record, to see what filled it.

Subject:
Date:
To:
Dan Jurafsky

Hi Dan, we've now scheduled the .

It will be in from -.

-Chris

extract, normalise, fill
Create new Calendar entry

Two fields are copied straight from the text (the room and the event name). Three are inferred: the date is the header date plus one day, and the time range is split in two with morning assumed. Inferred slots are where an extractor can be wrong.

The extracted record on slide 12

Event
Curriculum mtg
Date
Jan-16-2012
Start
10:00am
End
11:30am
Where
Gates 159
Action
Create new Calendar entry

The card is an instance of what Jurafsky and Martin call template filling: find documents that invoke a particular script, then fill the slots of the associated template with fillers extracted from the text. The script here is "a meeting is being scheduled", the template has five slots, and the textbook adds the distinction that makes the slide interesting. Slot fillers may consist of text segments extracted directly from the text, or they may consist of concepts that have been inferred from text elements through some additional processing. Sort the five fields by that rule and they split cleanly in two.

FieldText it came fromCopied or inferredWhat had to happen
WhereGates 159CopiedRecognise a building-plus-room string as a location
Eventcurriculum meetingCopied, then abbreviatedTake the subject line as the event name
Datetomorrow, with the header date January 15, 2012InferredResolve a relative expression against the document date
Start10:00InferredSplit the range, assume morning
End11:30InferredSplit the range, assume morning
Copied fillers versus inferred fillers

Resolving "tomorrow"

The Date field is the one worth slowing down on, because the word "tomorrow" contains no date at all. Jurafsky and Martin call this temporal normalization, the task of mapping a temporal expression to a point in time or to a duration, and they explain why it is possible: most temporal expressions are incomplete and only implicitly anchored, often with respect to the dateline of the article, which they call the document's temporal anchor. The values of expressions such as today, yesterday or tomorrow can all be computed relative to that anchor, and the rule for these two is the simplest one there is. Tomorrow adds a day to the anchor, yesterday subtracts one.

Worked example

From 'tomorrow' to Jan-16-2012

  1. Find the anchor

    The email header gives the document date: January 15, 2012. This is the temporal anchor.
  2. Classify the expression

    "tomorrow" is a relative expression, not an absolute date like "January 16" and not a duration like "two hours".
  3. Apply the rule

    Anchor plus one day: 2012-01-15 becomes 2012-01-16, the ISO 8601 value that the card displays as Jan-16-2012.
  4. Split the time range

    "10:00-11:30" is one string holding two times. Start takes 10:00, End takes 11:30. The text never says am or pm; the extractor assumes a meeting at ten is in the morning, which is a world knowledge inference and a possible error.
  5. Fill the location

    Gates 159 is recognised as a named entity of type location, a building name followed by a room number, and copied into Where.
  6. Five slots, one action

    Every slot is filled, so the client can enable Create new Calendar entry. The two copied fields are safe. The three inferred ones are where a bug would live.

Two threads tie this concept to its neighbours. First, the textbook's own exercise on this chapter asks for exactly the application on the slide: associating temporal expressions connected with events in email with specific calendar entries, which is a sign of how central the example is. Second, the graph that the answer box read from in the previous concept was populated by the same kind of extractor working over encyclopedias instead of inboxes. Search returns documents. Extraction returns fields with normalised values that a program can act on, and the blue button is the program acting.

Recall

List the fields the calendar extractor fills from Chris's email, and explain how 'tomorrow' becomes Jan-16-2012.

Event (Curriculum mtg), Date (Jan-16-2012), Start (10:00am), End (11:30am), Where (Gates 159). "tomorrow" is a relative temporal expression. It is normalised by taking the document's temporal anchor, the header date January 15, 2012, and adding one day.

Quick check

How does the extractor turn 'tomorrow' into Jan-16-2012 on slide 12?

Slide 13 puts a camera next to a list of the things people talk about when they review it: zoom, affordability, size and weight, flash, ease of use. Under "Size and weight" it collects three remarks: "nice and compact to carry!", "since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!", and "the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera". Read the second and third again. Both say the camera is light. Decide below whether each one is praise or complaint, then read on.

Try itThree opinions on size and weight

Decide the polarity of each review before revealing the marks the slide gives them.

  • nice and compact to carry!

  • since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!

  • the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera

Pick a polarity for each review.

The slide title pairs information extraction with sentiment analysis, and that pairing is the lesson. Bing Liu, whose book defined the field, states the principle: an opinion consists of a sentiment (positive or negative) and a target, and an opinion without its target being identified is of limited use. He calls the finer-grained task aspect level analysis, earlier called feature-based opinion mining after Hu and Liu's 2004 work on exactly this kind of camera review, and he formalises an opinion as a tuple of entity, aspect, sentiment, holder and time. Then he adds the line that explains the slide title: that tuple is basically a database schema. Sentiment analysis at this level is an extraction task first. Find the aspect, then judge the polarity of what was said about it.

AspectSentenceCue wordsPolarity
Size and weightnice and compact to carry!nice, compactpositive
Size and weightsince the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!small, light, contrasted with heavy, bulkypositive
Size and weightthe camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this cameraflimsy, plastic, very light in weight, delicatenegative
Three opinions on one aspect

Now the word "light" can be explained rather than just noticed. In the second review it sits next to "small" and is set against "heavy, bulky professional cameras", so it means easy to carry. In the third it sits next to "flimsy", "plastic" and "delicate", so it means insubstantial. The physical fact is identical. The polarity is a property of the aspect and the context together, not of the word and not of the document. Liu's own camera example makes the mirror image point: "my wife thinks it is too heavy for her" is a negative opinion about weight, and nothing about the word "heavy" on its own tells you that.

One word on two pans: next to small and compact, 'light' is praise; next to flimsy and plastic, the same word tips the beam the other way

Aspects are not always spelled out either. Hu and Liu give the sentence "While light, it will not easily fit in pockets" and point out that the word size does not appear in it, so the system has to infer the aspect before it can score the opinion. Their illustrative summary for a digital camera counts opinions per feature, which is what the grey bars beside the slide's review list are sketching.

FeaturePositiveNegative
picture quality2536
size13410
Hu and Liu's feature summary for a digital camera
  1. Find the sentences that express an opinion.
  2. Extract the aspect each opinion targets, explicit (flash) or implicit (light, therefore size and weight).
  3. Classify the polarity of the opinion about that aspect, using the surrounding words.
  4. Aggregate into per-aspect counts, so a reader sees two positive and one negative on size and weight.

The order matters. A whole-document score would average the third review's complaint about build against whatever it praised elsewhere, perhaps affordability, and report a lukewarm three stars that helps nobody. Liu makes the same point with a restaurant: "although the service is not that great, I still love this restaurant" is positive about the restaurant and negative about the service, and a document-level system does not discover what exactly people liked and did not like.

Recall

Why is 'light' positive in one camera review and negative in another?

Sentiment attaches to an aspect in context. Next to "small, compact" and contrasted with "heavy, bulky", light means easy to carry, a positive on size and weight. Next to "flimsy, plastic, delicate", light means cheap and fragile, a negative. The pipeline extracts the aspect first, then classifies polarity from the surrounding words.

Recall

Which systems in this part are pipelines of several NLP components?

Camera translation (OCR, then MT, then rendering), conversation mode (speech recognition, then MT, then speech synthesis), the LLM answer (retrieval, then generation), and aspect sentiment (aspect extraction, then polarity classification).

Quick check

In the camera reviews, 'light' is positive once and negative once. What does that show?

Recap

If you remember nothing else

  • Machine translation has two modes: fully automatic for information access, and computer-aided (post-editing or interactive prediction) when a human owns the final text.
  • Slide 8's categories are still the right ones to learn; the counts are a historical snapshot, not a fact sheet. Learn the modes (typing, offline, camera, conversation, voice calls), not the numbers: Google Translate passed 240 languages in 2024 and Skype was retired on 5 May 2025.
  • Camera and conversation translation are pipelines: OCR or speech recognition, then MT, then rendering or speech synthesis. Each stage can inject error.
  • A factual answer box needs word sense disambiguation (heavy means mass), entity linking (our planet means Earth) and a knowledge graph lookup (5.972 × 10^24 kg).
  • An AI Overview is retrieval-augmented generation: retrieve pages, prompt an LLM, cite. Its new failure mode is fluent text that is not faithful to the facts or its cited sources.
  • Non-word errors (ofcourse) fail dictionary lookup. Real-word errors (then for than) pass it and need context. Between 25 and 40 percent of spelling errors are real words.
  • Information extraction fills a template: Event, Date, Start, End, Where. 'tomorrow' is normalised as the email date plus one day, Jan-16-2012.
  • Sentiment is a pair of target and polarity. The same word 'light' is positive next to 'compact' and negative next to 'flimsy', so extract the aspect first, then classify.

Sources