Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Design

A Fast Q&A System


Manu, a consultant working on open-source text-mining software, is the author of Text Mining Application Programming (Charles River Media, 2006). He can be contacted at [email protected].


For over a decade, search engines have been the most popular tools with which to find information on the Web. The almost instant access to information and ease of use has been the main reason for their popularity. Yet there are drawbacks to using search engines. For instance, it is more natural to express an information need in the form of a question than a set of keywords and operators. The choice of keywords strongly influences the relevance of the results, and the use of a keyword that does not match the author's choice of keywords may not result in a relevant hit. This occurs more often than you would assume. Slang words can have as many as 10 or more synonyms, while other common words may have at least two or three synonyms. For example, the word "bought" has several synonyms, among them, "purchased" and "acquired."

A search engine doesn't give an answer in response to a query. Instead, users need to scan the text of a ranked list of documents to find answers. Most question/answering systems address both of these problems. In this article, I describe the design and implementation of one such question/answering (Q&A) system. Other Q&A systems include those at www.brainboost.com, www.answerbus.com, and start.csail.mit.edu.

Design

Most of the initial Q&A system designs were built on existing search engines with preprocessing and postprocessing modules, like those depicted in Figure 1. The preprocessing module consisted of parsing a natural-language question into a search-engine query. But the translation of a question into a search-engine query is imprecise in nature due to the infinite possibilities in posing questions. However, you can categorize a factoid question using a set of patterns and question words into one of several defined categories with reasonable accuracy. Examples of question words include single words and phrases such as "who," "what," "when," "how much," "how long," and so on.

Figure 1: Q&A system architecture.

The postprocessing module extracted the text from the top n hits for the generated query, segmented the text into passages, and assigned ranks to passages based on a measure of "closeness" to the original question. Each passage was scored based on the degree of overlap between query words and passage words, as well as a density measure of the occurrence of query words in the passage.

Factoid questions are among the easier types of questions to answer. The two other types—opinion and summary questions—are more complex and may involve compiling, analyzing, and synthesizing text to generate answers. Most answers to factoid questions can be found by extracting the most appropriate sentence verbatim from the text. Therefore, the challenge to find answers for factoid questions is to look for the most likely passage that answers a question.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.