Part-Of-Speech Tagging

Part-Of-Speech Tagging

Part-Of-Speech tagging is the process of identifying the part of speech in the given input based on the definition and it's context; allowing the identification of words such as nouns, verbs, adjectives, adverbs, etc.

Parameter NameDefault ValueRequiredDescription
inputNULLTrueThe given input to process, the size of the input is limited by your subscription
languageenFalseThe language the input is based in, if the given language is not english then CoffeeHouse will attempt to translate the input to english before processing
sentence_split0FalseSplits the results into sentences

Example Success Response (Without sentence_split)

The results has been shortened for demonstration purposes.
{
  "success": true,
  "response_code": 200,
  "results": {
    "text": "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness.",
    "source_language": "en",
    "tags": [
      {
        "text": "But",
        "offset_begin": 0,
        "offset_end": 3,
        "tag_value": "CC"
      },
      {
        "text": "I",
        "offset_begin": 4,
        "offset_end": 5,
        "tag_value": "PRP"
      },
      ...
      {
        "text": "happiness",
        "offset_begin": 254,
        "offset_end": 263,
        "tag_value": "NN"
      },
      {
        "text": ".",
        "offset_begin": 263,
        "offset_end": 264,
        "tag_value": "."
      }
    ]
  }
}

Example Success Response (With sentence_split)

The results has been shortened for demonstration purposes.
{
  "success": true,
  "response_code": 200,
  "results": {
    "text": "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system. expound the actual teachings of the great explorer of the truth, the master-builder of human happiness.",
    "source_language": "en",
    "sentences": [
      {
        "text": "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system.",
        "offset_begin": 0,
        "offset_end": 156,
        "tags": [
          {
            "text": "But",
            "offset_begin": 0,
            "offset_end": 3,
            "tag_value": "CC"
          },
          {
            "text": "I",
            "offset_begin": 4,
            "offset_end": 5,
            "tag_value": "PRP"
          },
          ...
          {
            "text": "system",
            "offset_begin": 149,
            "offset_end": 155,
            "tag_value": "NN"
          },
          {
            "text": ".",
            "offset_begin": 155,
            "offset_end": 156,
            "tag_value": "."
          }
        ]
      },
      {
        "text": "expound the actual teachings of the great explorer of the truth, the master-builder of human happiness.",
        "offset_begin": 157,
        "offset_end": 260,
        "tags": [
          {
            "text": "expound",
            "offset_begin": 157,
            "offset_end": 164,
            "tag_value": "VB"
          },
          {
            "text": "the",
            "offset_begin": 165,
            "offset_end": 168,
            "tag_value": "DT"
          },
          ...
          {
            "text": "happiness",
            "offset_begin": 250,
            "offset_end": 259,
            "tag_value": "NN"
          },
          {
            "text": ".",
            "offset_begin": 259,
            "offset_end": 260,
            "tag_value": "."
          }
        ]
      }
    ]
  }
}

Response Structure

NameTypeDescription
textstringThe text of the input, or the translation results if the input is from another language
source_languagestringThe original language source
tagsPosTag[]Array of Part-Of-Speech tags, this won't be returned if you use sentence_split
sentencesPosTagSentence[]Array of Part-Of-Speech sentence splits, this will be returned if you use sentence_split

PosTag Object Structure

NameTypeDescription
textstringThe text value that is being processed
offset_beginintThe character offset begin of the tag
offset_endintThe character offset end of the tag
tag_valuestringThe Part-Of-Speech tag

PosTagSentence Object Structure

NameTypeDescription
textstringThe text of the sentence
offset_beginintThe character offset begin of the sentence
offset_endintThe character offset end of the sentence
tagsPosTag[]Array of Part-Of-Speech tags for this sentence

Part-Of-Speech Tags

Tag Value Description
CC Coordinating conjunction
CD Cardinal Number
DT Determiner
EX Existential there
FW Foreign word
IN Preposition of subordinating conjunction
JJ Adjective
JJR Adjective, comparative
JJS Adjective, superlative
LS List item marker
MD Modal
NN Noun, singular or mass
NNS Noun, plural
NNP Proper noun, singular
NNPS Proper noun, plural
PDT Predeterminer
POS Possessive ending
PRP Personal pronoun
PRP$ Possessive noun
RB Adverb
RBR Adverb, superlative
RBS Adverb, superlative
RP Particle
SYM Symbol
TO To
UH Interjection
VB Verb, base form.
VBD Verb, past tense
VBG Verb, gerund or present participle
VBG Verb
VBN Verb, past particple
VBP Verb, non3rd personal singular present
VBZ Verb, 3rd person singular present
WDT Whdeterminer
WP Whpronoun
WP$ Possessive whpronoun
WRB Whadverb

Invalid Language Code Response

This response is given when the parameter language contains an invalid value.
{
  "success": false,
  "response_code": 400,
  "error": {
    "error_code": 7,
    "type": "CLIENT",
    "message": "The given language 'not a real language' cannot be identified"
  }
}

Invalid Language Code Response

This response is given when the parameter language contains an invalid value.
{
  "success": false,
  "response_code": 400,
  "error": {
    "error_code": 7,
    "type": "CLIENT",
    "message": "The given language 'not a real language' cannot be identified"
  }
}

Unsupported Language Response

This response is given when the requested language is unsupported by the method
{
  "success": false,
  "response_code": 400,
  "error": {
    "error_code": 23,
    "type": "CLIENT",
    "message": "The given language 'nr' is not supported"
  }
}