0% found this document useful (0 votes)
15 views17 pages

Knowledge Based Question Answering System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views17 pages

Knowledge Based Question Answering System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Knowledge based Question

answering System
Knowledge-based question answering (KB-QA)

• is a paradigm in question-answering systems where a natural language


question is answered by querying a structured database or knowledge base
(KB) instead of relying on unstructured text.

• This approach leverages the structured data in a knowledge base, which


typically contains entities (e.g., people, places, organizations) and
relationships (e.g., birthplace, located in, works for) in a format that the
system can interpret and retrieve answers from with high accuracy.
Entity Linking,

• It explains how to associate a mention in text with a real-world entity in


an ontology, like a structured database, which is essential for knowledge-
based question answering (QA).

• This section discusses how systems identify specific entities (like people,
locations, organizations) within text and link these mentions to
corresponding records in a database.

• For fact-based QA, Wikipedia is often the preferred ontology, where each
unique Wikipedia page acts as an identifier for a specific entity.
Entity linking in this context has two main parts

• Mention Detection: Identifying phrases or words (mentions) in


the text that may refer to real-world entities.

• Mention Disambiguation: Deciding which specific entity each


mention corresponds to, especially in cases where a mention may
refer to multiple entities (e.g., “Washington” could mean the U.S.
state, the capital city, or George Washington).
Linking Based on Anchor Dictionaries and Web Graph

• A classic method for entity linking uses anchor dictionaries and graph
structures from Wikipedia, as implemented in the TAGME algorithm.
Here’s how this approach works:
Anchor Dictionaries
• An anchor dictionary is created by analyzing hyperlinks within
Wikipedia articles, as hyperlinks often serve as anchors for referring to
other pages.

• For instance, the phrase “Stanford University” might serve as a


hyperlink text or anchor to Stanford’s Wikipedia page.

• By using all the phrases that hyperlink to each Wikipedia page, an


anchor dictionary is built.

• This dictionary lists each possible entity (Wikipedia page) and the
phrases commonly used to link to it.
Each anchor in this dictionary has:

• Frequency: The number of times it appears in Wikipedia as a link


(link frequency) or in any context (total frequency).

• Link Probability: Calculated as the ratio of link frequency to total


frequency. This probability indicates the likelihood that an anchor
refers to a specific entity when it appears in a text.
Mention Detection
• For a new text, all potential entity mentions are found by
looking up sequences of up to six tokens (words) in the anchor
dictionary.

• The mention detection step often eliminates low-probability


links (phrases with low link probabilities or high ambiguity).

• For example, “Ada Lovelace” would likely have a high link


probability to a Wikipedia page about the mathematician, while
“born” (from the query “When was Ada Lovelace born?”) would
likely be ignored as it has a very low link probability.
Mention Disambiguation
• If an anchor or mention points to only one entity, linking is
straightforward. However, many mentions are ambiguous, with
multiple possible meanings. TAGME uses two main factors for
resolving ambiguity:

• Prior Probability: The likelihood of an anchor referring to a particular


entity, calculated as the ratio of the anchor’s links to that entity over its
total link occurrences.
• Relatedness/Coherence: The relationship between an entity candidate and other
entities in the question or context.

• This coherence is measured by how many Wikipedia pages link to both entities,
indicating a strong connection.

• For instance, the word "Yuan" could refer to the Chinese currency, a dynasty, or a
person’s name.

• But in the context of “Chinese Dynasty,” the coherence score would prioritize
linking to the "Yuan Dynasty" page.
2. Neural Graph-Based Linking

• Modern methods use neural networks to perform entity linking by


encoding both the mention (a phrase in the text) and potential
entities as embeddings (dense vectors), then computing a
similarity score.

• This approach, exemplified by the ELQ linking algorithm,


includes several key steps:
• Above diagram shows the ELQ linking algorithm of

• which is given a question q and a set of candidate entities from


Wikipedia with associated Wikipedia text, and outputs tuples (e,ms
,me) of entity id, mention start, and mention end.
Mention Detection

• The system encodes each token in a question using a model like


BERT.

• Then, it computes probabilities for each potential span


(sequence of tokens) to determine if it’s an entity mention.

• Each token receives a start and end probability, which helps


identify entity spans within the question.
Entity Encoding and Linking

• Each Wikipedia entity is pre-encoded into a dense vector using its


page information (e.g., title and first 128 tokens).

• This encoding is stored, allowing the model to search through


these vectors when a question arises.
Entity Encoding and Linking

• For each mention span identified in the question, the system


computes an embedding by averaging the BERT embeddings of
each token in the span.

• It then calculates similarity scores (dot products) between the


span embedding and all pre-computed entity embeddings.

• This process results in a ranked list of entities, with the highest


similarity score indicating the most likely entity match.
Training and Loss Functions

• The ELQ algorithm is trained using datasets with questions


annotated with entity boundaries and links, such as
WebQuestionsSP.

• The loss function for training combines two parts:


• Mention Detection Loss: A binary cross-entropy loss indicating if
a span is an entity.

• Entity Linking Loss: This loss component penalizes incorrect


matches between detected mentions and entities.

You might also like