# Thesaurus / Walker approach, with three complete examples

Subject: Natural Language Processing

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/nlp/#tee/formulas/f-wsd/u5-walker

Canonical: https://deep-learning-study-room.vercel.app/read/nlp/tee/formulas/f-wsd--u5-walker/

Formulas explained through full worked examples

**The Walker approach uses thesaurus categories as semantic evidence.** Associate each candidate sense with a category. Count or weight context words that support that category. Choose the largest total.



$$
\operatorname{score}(s)=\sum_{w\in C} I(w,\operatorname{category}(s))
$$





$$
I=1
$$

 if the supplied category mapping says the context word supports the sense, otherwise 

$$
I=0
$$

. The summation symbol means add all those contributions. Weighted questions may replace 1 with a supplied weight. Category membership must be supplied or justified; it is not guessed from word frequency.

**Question. Disambiguate bank using Walker scoring. Context words are money, interest, annum, fetch. The finance category supports money, interest and annum; the location category supports none of these words.**

#### Given

Two categories: Finance and Location. Each supported word contributes 1.

#### To find

The two totals and selected bank sense.

#### Formula and why it applies

Sum the category indicators for each sense.

#### Step 1. Make a contribution table

| Word | Finance | Location |
| --- | --- | --- |
| money | 1 | 0 |
| interest | 1 | 0 |
| annum | 1 | 0 |
| fetch | 0 | 0 |

#### Step 2. Add Finance



$$
1+1+1+0=3
$$

.

#### Step 3. Add Location



$$
0+0+0+0=0
$$

.

#### Step 4. Select

3 > 0, so select the financial institution.

**Answer.** Finance, with score 3 versus 0.

**Question. Use Walker scoring for “The fisherman caught bass beside the lake.” Context {fisherman,caught,lake}. The Fish category contains all three clues; the Music category contains none.**

#### Given

Fish and Music senses, binary category membership given.

#### To find

The correct bass sense.

#### Formula and why it applies

Score = sum of context-category matches.

#### Step 1. Record Fish matches

fisherman → 1; caught → 1; lake → 1.

#### Step 2. Add Fish score



$$
1+1+1=3
$$

.

#### Step 3. Add Music score



$$
0+0+0=0
$$

.

#### Step 4. Choose

Fish has the larger score.

**Answer.** Bass refers to a fish.

**Question. Score “The player used a bat in the match.” Context {player,match}. Sport supports both words with weights 2 and 1; Animal supports neither. Use the supplied weighted Walker scheme.**

#### Given

Sport weights {player:2, match:1}; Animal weights {player:0, match:0}.

#### To find

Weighted sense scores.

#### Formula and why it applies

Use the sum of supplied weights, not an unweighted count, because the question explicitly gives weights.

#### Step 1. Sport contribution of player

Add 2.

#### Step 2. Sport contribution of match

Add 1. Sport total = 2 + 1 = 3.

#### Step 3. Animal total

0 + 0 = 0.

#### Step 4. Compare

3 > 0 selects the sporting implement.

**Answer.** Bat is the sports implement.

Walker: dictionary ke exact words nahi, context kis topic/category ko support karta hai woh count.
