Language Processing Api


Language Processing api is also Natural Langugage Processing Api allow you to extract meaningful part of human language by the means of NLP algorithm.

nlp

Languages

Currently this api is only supported for ENGLISH language, but soon we will be adding multiple languages

Endpoint

POST - /ml/language-processing

Parameters

  • file

    • required
    • Type: String text
    • Details: english language text is required to extract data.
  • param

    • optional
    • Type: label, lemma, pos, dep, is_stop, is_alpha, is_email, ent_type, ent_loc, morph
    • Default: default value is , seperated these ent_type,pos,is_stop
    • Details: You can pass more than these value by comma separator
  • remove_stop

    • optional
    • Type: true or false
    • Default: false
    • Details: Stop words are those words which don't have any particular meaning inside the sentence

Example

Request

curl --form "text=`i used to go for Taj mahal but now i dont go there.`&params=label,lemma,pos,dep,is_stop,is_alpha,is_email,ent_type,ent_loc,morph  $BASE_ROUTE/ml/language-processing

Info

Here we have passed all the available param type for demo purpose. You can pass according to your need.

Response

{
  "data": [
    {
      "dep": "nsubj",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "I",
      "morph": "Case=Nom|Number=Sing|Person=1|PronType=Prs",
      "pos": "PRON",
      "text": "i"
    },
    {
      "dep": "ROOT",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "use",
      "morph": "Tense=Past|VerbForm=Fin",
      "pos": "VERB",
      "text": "used"
    },
    {
      "dep": "aux",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "to",
      "morph": "",
      "pos": "PART",
      "text": "to"
    },
    {
      "dep": "xcomp",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "go",
      "morph": "VerbForm=Inf",
      "pos": "VERB",
      "text": "go"
    },
    {
      "dep": "prep",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "for",
      "morph": "",
      "pos": "ADP",
      "text": "for"
    },
    {
      "dep": "compound",
      "ent_loc": "B",
      "ent_type": "GPE",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "Taj",
      "morph": "Number=Sing",
      "pos": "PROPN",
      "text": "Taj"
    },
    {
      "dep": "pobj",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "mahal",
      "morph": "Number=Sing",
      "pos": "NOUN",
      "text": "mahal"
    },
    {
      "dep": "cc",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "but",
      "morph": "ConjType=Cmp",
      "pos": "CCONJ",
      "text": "but"
    },
    {
      "dep": "advmod",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "now",
      "morph": "",
      "pos": "ADV",
      "text": "now"
    },
    {
      "dep": "nsubj",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "I",
      "morph": "Case=Nom|Number=Sing|Person=1|PronType=Prs",
      "pos": "PRON",
      "text": "i"
    },
    {
      "dep": "aux",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "do",
      "morph": "Mood=Ind|Tense=Pres|VerbForm=Fin",
      "pos": "AUX",
      "text": "do"
    },
    {
      "dep": "neg",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "not",
      "morph": "",
      "pos": "PART",
      "text": "nt"
    },
    {
      "dep": "ROOT",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "go",
      "morph": "VerbForm=Inf",
      "pos": "VERB",
      "text": "go"
    },
    {
      "dep": "advmod",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": true,
      "label": null,
      "lemma": "there",
      "morph": "PronType=Dem",
      "pos": "ADV",
      "text": "there"
    },
    {
      "dep": "punct",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": false,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": ".",
      "morph": "PunctType=Peri",
      "pos": "PUNCT",
      "text": "."
    }
  ],
  "status": "done"
}
{
  "data": [
    {
      "dep": "compound",
      "ent_loc": "B",
      "ent_type": "GPE",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "Taj",
      "morph": "Number=Sing",
      "pos": "PROPN",
      "text": "Taj"
    },
    {
      "dep": "pobj",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "mahal",
      "morph": "Number=Sing",
      "pos": "NOUN",
      "text": "mahal"
    },
    {
      "dep": "neg",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": true,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": "not",
      "morph": "",
      "pos": "PART",
      "text": "nt"
    },
    {
      "dep": "punct",
      "ent_loc": "O",
      "ent_type": "",
      "is_alpha": false,
      "is_email": false,
      "is_stop": false,
      "label": null,
      "lemma": ".",
      "morph": "PunctType=Peri",
      "pos": "PUNCT",
      "text": "."
    }
  ],
  "status": "done"
}

Contributors: coder9118