Entity Linking and Knowledge Graph Construction › Ranking: The Local Signal
Language AI HandbookAll chapters Entity Linking and Knowledge Graph Construction › Ranking: The Local SignalSection view · Sections in this chapter6 / 17 ↓
Reading tools Definitions, links & notes
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The local scorer below combines the alias prior with context-description similarity. The prior summarizes the reference corpus's linked uses of that alias. Context can distinguish candidates when their descriptions overlap differently with the surrounding words, but it may provide little useful evidence. Neither feature guarantees the correct referent. Their contributions depend on the scoring rule and its weights.
The prior
estimates how the reference corpus uses an alias. It favors whichever candidates receive more counts in that corpus, which need not be the intended referent in a new domain. A company-name prior estimated from technology reporting, for example, might differ from one estimated from a supplier catalog. Neither source establishes which reading fits a particular sentence.
Keep the prior-only argmax as a baseline. Adding context is useful only if it improves the decisions the application needs, so compare the combined ranker against that baseline on representative labeled examples.
Context similarity
Context can supply disambiguating evidence. Mercury orbits the Sun every 88 days shares orbits, 88, and days with the planet description below, whereas those tokens are absent from the element description. This overlap can favor the planet without the sentence saying "planet" or "element." Tokenization can change the similarity. Feature weighting can also change it by shifting a vector's direction. The prior contributes to the local score, and other candidates can change the ranking.
The classical implementation is a bag-of-words comparison. Represent the mention context (a window of surrounding tokens, or the whole sentence, or the whole document) as a sparse vector, represent each candidate entity by its KB description or by the text of its Wikipedia article, and take cosine similarity:
where:
- : the context vector for mention (for example, term counts or TF-IDF weights over the surrounding window)
- : the description vector for candidate entity , built the same way from its KB description or article text
- : the dot product, summing the weighted overlap of shared terms
- and : the Euclidean norms of the two vectors, normalizing away length differences
The vectors can use raw counts or TF-IDF weights. For nonzero real vectors, cosine lies in ; for the nonnegative count vectors here it lies in . The displayed ratio is undefined for a zero vector, so the code adopts a similarity of zero when either set is empty. IDF gives greater weight to terms found in fewer documents, but a rare word is not automatically relevant evidence for this mention. A term occurring in every description can still differ in frequency or normalized weight; ubiquity alone does not establish that every scoring scheme ignores it.
Explicit Semantic Analysis (Gabrilovich and Markovitch, 2007) represents text using Wikipedia-derived concepts rather than only word dimensions. A shared concept dimension can connect texts without a shared surface word. Applying that representation to linking would still require constructing the concept associations and evaluating the resulting mention-entity score.
Yamada et al. (2016) jointly embed words and entities in one vector space. Description-based bi-encoders and cross-encoders provide other ways to score mention-entity compatibility. A cross-encoder processes each pair jointly, while a bi-encoder can reuse separately encoded entity vectors. Pair evaluations can be batched; the relevant cost is the amount of pair computation, not a claim that each pair must occupy its own unbatched model call.
Putting them together
We use the following illustrative local score:
where:
- : the local score of candidate entity for mention
- : the empirical probability of target among recorded links with normalized alias in the reference corpus. In this score, abbreviates for mention occurrence
- : a vector representation of the mention context (surrounding window, sentence, or document)
- : a vector representation of the candidate entity's description or article text
- : the cosine similarity between context and entity description
- : weight on the log prior probability of the candidate entity given the alias in the reference corpus
- : weight on the context-similarity (local evidence) term
We restrict and to finite nonnegative values. For an evaluated system, select their values on development data; the toy uses hand-chosen weights to expose the mechanics. The weights depend on feature scale as well as usefulness. For positive priors, the difference between their contributions is . The logarithm tends to negative infinity as approaches zero from above. The weighted contribution has that limit when ; with it is zero for every positive . Logarithms do not by themselves prevent popularity from dominating context. The toy candidates all have positive priors.
Other features can include type compatibility, name similarity, and graph proximity to already linked entities. If a mention is known to denote a person under the annotation policy, a country candidate is incompatible. A predicted NER type can itself be wrong, however, and metonymic uses depend on the annotation convention. Use type predictions as fallible evidence, or justify any hard constraint with the task's rules.
The weighted local score is a ranking quantity. Its value of 0.9 would not imply a 90 percent chance of correctness. Interpreting a score probabilistically requires a suitable calibration procedure and validation on the relevant distribution. Margins can support an acceptance policy, but need their own evaluation.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!