Classification System

We provide an API to access the Question Classification System that we described in our paper. The system achieved an accuracy of over 97% in the dataset TREC 10 dataset, which is the current state of the art.

We use the same multi-level classification as that provided by Xin Li and Dan Roth, with the following modifications:

  1. We add the fine class “extraterrestrial” to capture entities such as “planet”, “moon” and so on, and
  2. We add the fine class “indgr” to represent questions that cannot be classified into either the class individual or the class group without knowledge of the answer (an example of this is “Who won the Nobel Peace Prize in <year>?”)
  3. We modify the reasoning behind the classification to classify human made entities such as “bridge” and “building” under ENTY:other instead of the previous classification of LOC:other.

Our reported accuracy is based on a system that does not adapt these changes to the classification, however, we provide the modified version here as we found these changes to help with question answering.

The following is the list of all available classes that a question can be classified into

 

Coarse Fine
ABBRabbreviation; expansion
DESCdefinition; description; manner; reason
ENTYanimal; body; color; creation; currency; disease; event; food; instrument; language; letter; other; plant; product; religion; sport; substance; symbol; technique; term; vehicle; word; extraterrestrial
HUMdescription; group; individual; title; indgr
LOCcity; country; mountain; other; state
NUMcode; count; date; distance; money; order; other; percent; period; speed; temperature; size; weight

Your API key

Before you can use the API, you need an API key. We provide API keys for both commercial and noncommercial use FREE of charge. However, we retain the right to change this at any point in the future.

Please note that, should your requirements exceed our resources, we will request you to either scale back usage of the system or request you to pay a fee to expand our resources to meet your demand.

Please read our complete Terms of Use and Privacy Policy.

You can register for the API here: https://goo.gl/forms/CdWZhHOJhsaQ8vJL2

API Access Basics

The Question Classification API is a RESTful API and its endpoint is at:

http://qcapi.harishmadabushi.com/

API Access

It takes three arguments, the question that is to be classified, your auth key and an optional argument the change the output format to html:

http://qcapi.harishmadabushi.com/?question=What%20is%20the%20capital%20of%20the%20UK?&auth=AUTH_KEY&output=html

By default the “output” parameter is not required and is set to json. This parameter can be used for debugging and exploring the system.

API Response

The response is in JSON and contains the following elements:

{
    "status": "Success", 
    "major_type": "LOC", 
    "minor_type": "city",
    "question_text": "What is the capital of the UK?", 
    "syntactic_map": "
         wh_word : ('What', (0, 4))
         WHNP :
            NNP : None
         SQ :
            auxiliary_verb : ['is']
            NNP            : capital(PP) of PP-NN: UK
            main_verb      : None
    "
}

API Errors

Should there be an error of any kind, the “status” field will contain the text “Fail” and the response JSON will contain the element “error”, with details on what the error is.