Sub topic 3
Tag Every Question by Subject, Topic and Format
This chapter assumes you have read the earlier chapters on the exam pattern and on collecting past papers. You should have a set of verified papers and answer keys, and a copy of the official syllabus. You should also be comfortable with simple tables and percentages. Every later chapter in this tutorial counts or sorts tags, so the tags need to be right.
Why tagging comes first
A pile of past papers is just text. You cannot ask it "how often is polity asked?" until each question carries a label. Tagging turns each question into one row of data. Once the rows exist, weightage, trends and difficulty become counting jobs.
The quality of every later number depends on the quality of the tags. If two people tag the same question differently, the counts differ, and the conclusions drift with them. The goal of this chapter is a tagging scheme that gives the same label no matter who applies it, or when.
The fields to record
Use one row per question. Keep the fields few, so tagging stays fast and consistent.
| Field | What it holds | Example |
|---|---|---|
| year | The year of the paper | 2023 |
| set | Question paper set, if more than one was released | A |
| q_no | Question number in the paper | 37 |
| subject | One value from a fixed list | Polity |
| topic | One value from a fixed list under that subject | Fundamental Rights |
| format | The shape of the question | Statement-based |
| source_type | Static, Maharashtra-specific or current affairs | Static |
| answer | The official key's answer | C |
The source_type field is tagged now but analysed in a later chapter. Difficulty is also rated later, so leave it out for now. Adding a column later is cheap. Tagging a second time is not.
Build the subject and topic lists from the syllabus
Do not invent your own categories while reading questions. Take them from the official syllabus. Write the subject list first, then the topics under each subject, and freeze the list before you start tagging.
A short starting list might look like this:
- History: Ancient, Medieval, Modern India, Maharashtra history, Freedom movement
- Geography: Physical, Indian, Maharashtra, Economic, Climate and mapping
- Polity: Constitution, Fundamental Rights and Duties, Parliament and states, Local governance, Bodies and commissions
- Economy: Basics, Banking, Budget and taxation, Planning and schemes, Agriculture
- Environment: Ecology, Biodiversity, Climate change, Conventions and laws
- Science: Physics, Chemistry, Biology, Health, Technology
- Current affairs: Government schemes, Awards and persons, Places in news, Reports and indices
Check this list against the current notification. The names and groupings above are an example, and the official syllabus may word them differently. Use the official wording where you can, so your labels map back to what the commission published.
Three rules for consistent tagging
Rule 1: One question, one subject
Every question gets exactly one subject and one topic. Some questions sit between areas. A question on the Reserve Bank's role in the Constitution could be Polity or Economy. Pick by this test: which area would a teacher use to explain the answer? Then record the choice in a short rules note so the next similar question gets the same label.
Rule 2: Tag by what the question tests
Tag by the knowledge needed to answer, not by words in the question. A question that mentions a river but asks which Five-Year Plan funded a dam is an Economy question about planning. A question that mentions a dam but asks about the river's origin is Geography.
Rule 3: Write down every ruling
Keep a plain text file called tagging_rules.md. Each time you settle a borderline case, add one line. For example: "Questions on Panchayati Raj amendments go to Polity, Local governance, not Maharashtra." This file is what makes your tagging repeatable. Without it, the same question can get a different label next month.
Format tags
The format describes how the question is asked. It matters because each format calls for a different method of answering, and a later chapter on elimination uses these tags directly. Start with a small set of formats that appear in objective papers like this one:
| Format | How to spot it |
|---|---|
| Direct fact | A single question with four plain options, such as "Which river...?" |
| Statement-based | Several numbered statements, and options like "1 and 2 only" |
| Match the pairs | Two lists to be matched, with coded options |
| Chronological order | Events or items to arrange in sequence |
| Assertion and reason | Two linked statements, and options on whether the reason explains the assertion |
| Odd one out | Four items, one of which does not belong |
| Which is incorrect | A "not correct" or "except" stem |
Check the actual papers before you adopt this list. Some formats may be absent in a given year, and the paper may use others. Add a format only after you have seen it in at least two or three questions, so the list does not grow without limit.
A question can be both statement-based and "which is incorrect". Use one primary format. Record the negative stem as its own yes-or-no column called negative_stem, because it is a common reason for mistakes under time pressure.
Tag in a spreadsheet, then store as CSV
A spreadsheet is the easiest place to tag, since you can use drop-down lists to stop typos. Create a drop-down for subject, one for format and one for source type. Then export to CSV so Python can read the rows in later chapters. Save it as UTF-8, because Marathi names and terms may appear in the text.
A first few rows of the CSV might look like this:
year,set,q_no,subject,topic,format,source_type,answer
2023,A,1,History,Modern India,Direct fact,Static,B
2023,A,2,Polity,Fundamental Rights,Statement-based,Static,C
2023,A,3,Geography,Maharashtra,Direct fact,Maharashtra-specific,AThe topic column holds one value from your frozen list. Spelling and capitalisation matter: "Polity" and "polity" count as two different subjects in code.
Check the tags with a script
Typos creep in even with drop-downs, especially if you paste rows from elsewhere. A short script can catch bad labels before you analyse anything. This one checks that every subject and format appears in the allowed lists, and reports any row that does not.
import csv
ALLOWED_SUBJECTS = {
"History", "Geography", "Polity", "Economy",
"Environment", "Science", "Current affairs",
}
ALLOWED_FORMATS = {
"Direct fact", "Statement-based", "Match the pairs",
"Chronological order", "Assertion and reason",
"Odd one out", "Which is incorrect",
}
ALLOWED_SOURCES = {"Static", "Maharashtra-specific", "Current affairs"}
problems = 0
with open("pyq.csv", newline="", encoding="utf-8") as f:
for line_no, row in enumerate(csv.DictReader(f), start=2):
for field, allowed in (
("subject", ALLOWED_SUBJECTS),
("format", ALLOWED_FORMATS),
("source_type", ALLOWED_SOURCES),
):
if row[field] not in allowed:
print(f"line {line_no}: bad {field}: {row[field]!r}")
problems += 1
print("rows with problems:", problems)Line numbers start at 2 because line 1 is the header. Run this after every tagging session. If it prints no problems, the labels are at least spelled consistently. It cannot tell you whether a label is right, only that it is valid.
A quick count to confirm the tags work
Once the labels pass the check, a first count shows whether the data behaves as expected. This script reads the tagged CSV and prints each subject's question count and share of the total.
import csv
from collections import Counter
with open("pyq.csv", newline="", encoding="utf-8") as f:
rows = list(csv.DictReader(f))
by_subject = Counter(r["subject"] for r in rows)
total = sum(by_subject.values())
for subject, n in by_subject.most_common():
print(f"{subject}: {n} ({n / total:.0%})")Compare the total with the number of questions you expect. If the papers have a fixed number of questions, then a tagged year should add up to exactly that number. A mismatch means a skipped row or a duplicate. Fix that now. The detailed interpretation of these shares is the subject of the next chapter.
Make the tagging reliable
Tagging is a judgement task, so test it.
- Tag one paper fully.
- Wait a few days, then tag the same paper again without looking at your first pass.
- Compare the two. Count the questions whose subject or topic differs.
- For every mismatch, decide which label is right and add a line to
tagging_rules.md.
If more than a small handful of questions differ, your categories are too vague or overlap too much. Tighten the definitions before tagging more papers. If a friend is also preparing, have them tag the same paper and compare. Two people agreeing is stronger evidence than one person agreeing with themselves.
The flow of the tagging process
Common errors
- Tagging by keyword. A question mentioning "Maharashtra" is not automatically Maharashtra-specific. Check what knowledge it tests.
- Changing labels midway. Renaming a topic after tagging half the papers splits one topic into two in the counts.
- Too many topics. With 150 topic labels and 100 questions per year, most topics have a count of one or zero, and no trend can be seen. Aim for a list short enough that common topics get several questions across your set of papers.
- Using the key blindly. Tag from the question, but read the answer key as well. If the key and your understanding disagree, note the question and check an authoritative source before you rely on it.
- Ignoring multiple sets. If a year has several sets with shuffled questions, tag one set and map the others by question text. Otherwise the same question is counted several times.
Check your understanding
Exercise
You are tagging a question that asks which constitutional amendment gave Panchayati Raj bodies constitutional status. Your list has both "Polity: Local governance" and "Maharashtra: Local bodies". Which tag do you use, what do you do next, and why?
Show answer
Tag it Polity, Local governance, because the question tests knowledge of a constitutional amendment and a teacher would explain it under polity. Then add a line to tagging_rules.md saying that questions on constitutional amendments about local bodies go to Polity, so the next similar question gets the same label.
Exercise
After tagging, your validation script prints "line 14: bad subject: 'polity'". The row's other fields are correct. What is wrong, and how do you fix it?
Show answer
The label is spelled with a lowercase "p", so it does not match the allowed value "Polity". Code treats the two as different strings. Change the cell to "Polity" (ideally using the drop-down), re-export the CSV and run the script again until it reports no problems.