1 of 16

Natural Language Processing

By

S.V.V.D.Jagadeesh

Sr. Assistant Professor

Dept of Artificial Intelligence & Data Science

LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING

2 of 16

At the end of this session, Student will be able to:

  • Understand coherence, hobs and centering algorithm (understand-l2)

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Session Outcomes

LBRCE

NLP

3 of 16

  • Coherence refers to the logical and semantic connection between sentences in a discourse.
  • A coherent text forms a meaningful, connected whole.
  • It ensures that:
  • Ideas are connected
  • Meaning is clear
  • Reader can follow progression

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Coherence

LBRCE

NLP

4 of 16

  • Types of Coherence
  • 1. Local Coherence: Between adjacent sentences
  • 2. Global Coherence: Across entire discourse
  • Example
  • Coherent Text
  • Anna loves gardening. She spends her weekends planting flowers.�Her garden is admired by her neighbors.
  • Incoherent Text
  • Anna loves gardening. The weather was cold last week.�Many people travel during holidays.

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Types of Coherence

LBRCE

NLP

5 of 16

  • Reference Phenomena is a linguistic mechanism used to link words or expressions within a discourse enabling coherence and meaning.
  • References connect elements in the text to their mentions.

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Reference Phenomena

LBRCE

NLP

6 of 16

  • Anaphora (Backward Reference): Refers back to the earlier expression in the discourse
  • Example: John arrived late. He apologized.
  • He referes to John
  • Cataphora (Forward Reference): Refers forward to ana expression introduced later in the discourse.
  • Example: Before he spoke, John took a deep breath.
  • He refers to John

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Types of Reference Phenomena

LBRCE

NLP

7 of 16

  • Exphora: Refers to something outside the discourse often in the surrounding physical context.
  • Example: Look at that!
  • That refers to something physically available in the environment.
  • Endophora: Refers to elements within the discourse. Includes both Anaphora and Cataphora
  • Example: When she saw him, Mary smiled at John
  • She is anaphoric, referring back to Mary
  • Him is cataphoric referring forward to John

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Types of Reference Phenomena

LBRCE

NLP

8 of 16

  • It involves identifying the antecedent (the referent) for a given anaphor (Pronoun)
  • Anaphora resolution can be done by
  • Hobbs algorithm
  • Centering Algorithm

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Anaphora Resolution

LBRCE

NLP

9 of 16

  • Hobbs algorithm is a syntactic approach for resolving pronouns using parse trees.
  • Steps of the algorithm:
  • 1. Parse the sentences to generate the syntactic trees
  • 2. Start at the anaphor and traverse the syntactic tree in BFS manner
  • 3. Check each potential antecedent for compatability (example: gender, age, number, syntactic role)
  • 4. Select the most suitable antecedent

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Hobbs Algorithm

LBRCE

NLP

10 of 16

  • Example: Jack is an engineer. Jill likes him.
  • S1-> Jack is an engineer.
  • S2->Jill likes him.
  • Step1: Create a parse tree for sentences
  • Identified pronoun him

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Implementation of Hobbs Algorithm

LBRCE

NLP

11 of 16

  • Step2: Move upto the tree to the first NP or S (Give some names to them for reference)
  • At this point we observe that him is not suitable for Jill
  • Step3: Check to the left of the current NP or S if there exists another NP. If yes then consider that as the reference pronoun of that noun (Grammar riles must satisfy). If no NP found to left repeat the process until you get a NP
  • At this point we have another NP to the left referring to Jack
  • Final Conclusion: The pronoun him referring to Jack

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Implementation of Hobbs Algorithm

LBRCE

NLP

12 of 16

  • The centering algorithm is a technique used to ensure coherence in a discourse by analysing how entities (people, objects etc) are reference across the sentences.
  • It helps to identify the most important subject (called the center) of a sentence and how it is connected to next sentence.
  • It helps computers to figure out which noun or pronoun is refering to which of the entitites.

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Centering Algorithm

LBRCE

NLP

13 of 16

  •  

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Steps of centering algorithm

LBRCE

NLP

14 of 16

  •  

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Steps of Centering algorithm

LBRCE

NLP

15 of 16

  •  

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Steps of Centering algorithm

LBRCE

NLP

16 of 16

  •  

S.V.V.D.Jagadeesh

Wednesday, April 1, 2026

Steps of centering algorithm

LBRCE

NLP