Definition
A farmer in Odisha reads a government scheme notice in Odia that was written in English an hour earlier. A student reads a two-line summary of a twenty-page report. Machine translation and summarisation both turn one text into another while keeping its meaning, and they are among NLP's biggest success stories.
Machine translation (MT) converts text from a source language to a target language. It has moved from rule-based systems (dictionaries and grammar rules), to statistical MT (phrase tables learned from parallel text, popular in the 2000s), to neural MT using encoder-decoder networks with attention and, since 2017, transformers. Summarisation shortens a text while keeping its key points. Extractive summarisation selects important sentences from the original; abstractive summarisation writes new sentences, as large language models do. Both are evaluated automatically with overlap scores such as BLEU (for translation) and ROUGE (for summaries), and ultimately by human judgement.
In simple words
Translating word by word is like replacing every brick in a house with a brick from another country and expecting the same house: the bricks fit, but the walls end up in the wrong places. Good translation rebuilds the whole sentence in the new language's pattern. Summarising is like telling a friend a film's story in one minute.
Overview
- Machine translation converts text between languages; summarisation shortens text while keeping its key points.
- Translation moved from rules (1950s–1980s) to statistics (1990s–2000s) to neural networks (from about 2014).
- Word order differs between languages: English is subject-verb-object, Hindi usually subject-object-verb.
- BLEU scores translations and ROUGE scores summaries by overlap with references.
- Abstractive systems can produce fluent but wrong text, so critical uses need review.
- IndicTrans2 and Bhashini support translation among India's scheduled languages.
Why it matters
India has 22 scheduled languages and hundreds of others, so translation unlocks education, health information, government services and business for millions of people. Summarisation helps people cope with too much text: news, legal judgements, research and meeting notes.
Key terms
- Parallel corpus
- Pairs of sentences that are translations of each other, used to train MT.
- Encoder-decoder
- A network that encodes the source sentence and decodes it into the target language.
- BLEU
- A translation score from matching word n-grams with reference translations, with a brevity penalty.
- Extractive summarisation
- Choosing the most important original sentences.
- Abstractive summarisation
- Generating new sentences that express the main points.
- ROUGE
- A summary score measuring overlap of words or n-grams with reference summaries.
Types
Machine translation and summarisation each come in several types. These are the main approaches.
1. Rule-based machine translation
Translation using bilingual dictionaries and hand-written grammar rules.
- How it works: Linguists write rules for word order, agreement and morphology; the 1954 Georgetown-IBM experiment translated 60 Russian sentences.
- Example: Word-by-word translation giving "main khaata hoon chaawal" instead of "main chaawal khaata hoon".
- When to use it: Use it to understand why translation is hard; modern systems rarely rely on it alone.
2. Statistical and neural machine translation
Translation learned from parallel text: phrase tables in statistical MT, encoder-decoder networks in neural MT.
- How it works: Neural MT with attention (2014–2015) and transformers (2017) translates whole sentences, handling reordering and context far better.
- Example: Google Translate switched to neural MT in 2016; IndicTrans2 translates among 22 Indian languages.
- When to use it: Use neural MT for almost all translation today, with human review for important documents.
3. LLM-based translation
Using a large language model to translate through prompting.
- How it works: The model follows instructions about tone, terminology and format, and can explain its choices, but can also add or omit content.
- Example: Translating a product description into Tamil while keeping brand names unchanged.
- When to use it: Use it for flexible, context-aware translation, checking numbers and names carefully.
4. Extractive summarisation
Selecting the most important sentences from the original text.
- How it works: Sentences are scored by word frequency, TF-IDF, position or graph centrality (TextRank) and the top ones are kept in order.
- Example: Keeping two sentences of a Chandrayaan-3 paragraph that best summarise the mission.
- When to use it: Use it when faithfulness matters, since every sentence comes from the source.
5. Abstractive summarisation
Writing new sentences that express the main points.
- How it works: Encoder-decoder models or LLMs generate a summary, which can be fluent and concise but may contain invented details.
- Example: A two-line summary of a long court judgement written by a language model and checked by a lawyer.
- When to use it: Use it for readable summaries, always checking facts against the source.
Explained in detail
From rules to neural translation
Rule-based MT used bilingual dictionaries and hand-written grammar rules. It struggled because languages differ in word order, idioms and ambiguity: English puts the verb in the middle (subject-verb-object) while Hindi usually puts it at the end (subject-object-verb), so a word-by-word translation of "I eat rice" gives "main khaata hoon chaawal" instead of "main chaawal khaata hoon". Statistical MT learned phrase translations and reordering probabilities from millions of parallel sentences. Neural MT, from about 2014, encodes the whole source sentence into vectors and generates the translation word by word, using attention to look back at the relevant source words. Transformers made this far better and faster, and multilingual models such as IndicTrans2 now translate among all 22 scheduled Indian languages.
Extractive and abstractive summaries
| Extractive | Abstractive | |
|---|---|---|
| Output | Original sentences, selected | New sentences, generated |
| Typical method | Score sentences by word frequency, TF-IDF or graph ranking (TextRank) | Encoder-decoder or large language model |
| Faithfulness | High: every sentence is from the source | Can hallucinate facts |
| Readability | Can be choppy | Fluent and concise |
Evaluating translation and summaries
BLEU compares a machine translation with one or more human reference translations. It computes the share of the candidate's word n-grams (usually up to 4-grams) that appear in the references, clipping repeated matches, takes their geometric mean, and multiplies by a brevity penalty so that very short outputs cannot score highly just by being precise. ROUGE does the reverse for summaries, focusing on how much of the reference is recovered. These scores are cheap and useful for comparing systems, but they miss meaning: a correct translation that uses different words scores low, so newer metrics use embeddings, and important uses still need human review. Neural systems can also produce fluent but wrong output, such as a translated medicine dosage with the number changed, so critical text must be checked by a qualified person.
In the code below, word-by-word translation puts the Hindi verb in the wrong place in both test sentences. BLEU-2 gives 0.71 to "the cat sat on the mat", 1.00 to the exact reference, only 0.37 to the short "on the mat" because of the brevity penalty, and 0 to a scrambled version with the right words in the wrong order. A frequency-based extractive summary of a seven-sentence paragraph on Chandrayaan-3 keeps the sentences about landing near the lunar south pole and about the two weeks of work on the Moon.
How it works
- Decide the language pair or summary length and who will read the output.
- Use a strong pre-trained model, such as IndicTrans2 for Indian languages.
- Compute BLEU or ROUGE on a test set with references to compare systems.
- Have fluent speakers rate adequacy and fluency on a sample.
- Check names, numbers and dates, and keep a human in the loop for critical documents.
The maths
- Clipped n-gram precision
- Candidate and reference lengths
Reference: "the cat is on the mat". Candidate: "the cat sat on the mat". Unigram matches are the, cat, on, the, mat: 5 of 6, so p₁ ≈ 0.83. Candidate bigrams are the cat, cat sat, sat on, on the, the mat; three appear in the reference (the cat, on the, the mat), so p₂ = 3 ÷ 5 = 0.6. Both sentences have 6 words, so the brevity penalty is 1. BLEU-2 = √(0.83 × 0.6) ≈ √0.5 ≈ 0.71. The candidate "on the mat" has perfect precision but is only 3 words long, so BP = e^(1 − 6/3) = e⁻¹ ≈ 0.37, and its BLEU-2 is 0.37.
In code
from collections import Counter
import math
import re
import numpy as np
from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS
# 1. Word-by-word "translation" breaks Hindi word order (subject-object-verb)
dictionary = {"i": "main", "eat": "khaata hoon", "rice": "chaawal", "she": "woh", "reads": "padhti hai", "books": "kitaabein"}
for sentence, correct in [("i eat rice", "main chaawal khaata hoon"), ("she reads books", "woh kitaabein padhti hai")]:
literal = " ".join(dictionary[w] for w in sentence.split())
print(f"{sentence!r}: word by word -> {literal!r}; correct -> {correct!r}")
# 2. BLEU with unigrams and bigrams, clipped counts and a brevity penalty
def bleu2(candidate, reference):
c, r = candidate.split(), reference.split()
precisions = []
for n in (1, 2):
cand = Counter(tuple(c[i:i + n]) for i in range(len(c) - n + 1))
ref = Counter(tuple(r[i:i + n]) for i in range(len(r) - n + 1))
precisions.append(sum(min(k, ref[g]) for g, k in cand.items()) / max(sum(cand.values()), 1))
bp = 1.0 if len(c) >= len(r) else math.exp(1 - len(r) / len(c))
return bp * math.sqrt(precisions[0] * precisions[1]), precisions
reference = "the cat is on the mat"
for candidate in ["the cat sat on the mat", "the cat is on the mat", "on the mat", "mat the on cat the is"]:
score, (p1, p2) = bleu2(candidate, reference)
print(f"{candidate!r:<26} unigram {p1:.2f} bigram {p2:.2f} BLEU-2 {score:.2f}")
# 3. Extractive summary: score each sentence by how often its content words appear in the whole article
article = ("Chandrayaan-3 was launched by ISRO from Sriharikota in July 2023. "
"Its lander Vikram touched down near the lunar south pole on 23 August 2023. "
"India became the first country to land a spacecraft near the lunar south pole. "
"The rover Pragyan rolled out of the lander and studied the lunar soil near the landing site. "
"Scientists confirmed the presence of sulphur in the lunar soil. "
"The lander and rover worked for about two weeks, one lunar day, before going to sleep. "
"The landing day is now celebrated in India as National Space Day.")
sentences = re.split(r"(?<=\.)\s+", article)
content = [[w for w in re.findall(r"[a-z0-9-]+", s.lower()) if w not in ENGLISH_STOP_WORDS] for s in sentences]
freq = Counter(w for words in content for w in words)
scores = [sum(freq[w] for w in words) / len(words) for words in content]
keep = sorted(np.argsort(scores)[-2:])
print("Most frequent content words:", freq.most_common(4))
print("Sentence scores:", [round(x, 2) for x in scores])
print("Summary:", " ".join(sentences[i] for i in keep))Output
'i eat rice': word by word -> 'main khaata hoon chaawal'; correct -> 'main chaawal khaata hoon'
'she reads books': word by word -> 'woh padhti hai kitaabein'; correct -> 'woh kitaabein padhti hai'
'the cat sat on the mat' unigram 0.83 bigram 0.60 BLEU-2 0.71
'the cat is on the mat' unigram 1.00 bigram 1.00 BLEU-2 1.00
'on the mat' unigram 1.00 bigram 1.00 BLEU-2 0.37
'mat the on cat the is' unigram 1.00 bigram 0.00 BLEU-2 0.00
Most frequent content words: [('lunar', 5), ('lander', 3), ('near', 3), ('day', 3)]
Sentence scores: [1.17, 2.1, 2.12, 2.1, 1.83, 2.12, 1.86]
Summary: India became the first country to land a spacecraft near the lunar south pole. The lander and rover worked for about two weeks, one lunar day, before going to sleep.Try it yourself
Extractive or abstractive?
Which kind of summary is each?
Highlighting key sentences in a judgement
A news app's one-sentence headline written by a model
An LLM writing a fresh two-line summary
Copying the three highest-scoring sentences from an article
Match the era of machine translation
Which approach fits each description?
- Dictionaries plus hand-written grammar rules
- Phrase tables learned from parallel text
- Encoder-decoder with attention
- One model translating among 22 Indian languages
Translating a health advisory
A state health department must publish a heatwave advisory in five languages within a day.
Common mistakes
- Translating word by word and ignoring word order and idioms.
- Treating a high BLEU score as proof that a translation is correct.
- Publishing abstractive summaries without checking them against the source.
Check yourself
Summary
- Machine translation moved from rules to statistics to neural transformers; word order and idioms are key challenges.
- Summaries are extractive (selected sentences) or abstractive (new sentences).
- BLEU and ROUGE measure overlap, but critical outputs need human review.
Finished reading?
Sources: Papineni et al. (2002), BLEU: a Method for Automatic Evaluation of Machine Translation · Vaswani et al. (2017), Attention Is All You Need · AI4Bharat: IndicTrans2 and other open models for Indian languages