Skip to content

A RESTful API for Natural Language Processing, wrapping functionality from the Standford Core NLP library.

License

Notifications You must be signed in to change notification settings

kaicode/nlp-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP REST API

A RESTful API for Natural Language Processing, wrapping functionality from the Standford Core NLP library.

Parse Text Endpoint

Request

POST /parse?text=<your-text>

Response

The response is a list of sentances each with:

  • text - the original text of the sentence
  • posTags - a list of POS tags identified in the sentence
  • constituencyParse - a Constituency Parse Tree where each node contains a label and list of children

Example

Request
curl -XPOST localhost:8080/parse?text=The%20quick%20brown%20fox%20jumped%20over%20the%20lazy%20dog

Response

[
  {
    "text": "The quick brown fox jumped over the lazy dog",
    "posTags": [
      "DT",
      "JJ",
      "JJ",
      "NN",
      "VBD",
      "IN",
      "DT",
      "JJ",
      "NN"
    ],
    "constituencyParse": {
      "category": "ROOT",
      "children": [
        {
          "category": "S",
          "children": [
            {
              "category": "NP",
              "children": [
                {
                  "tag": "DT",
                  "text": "The"
                },
                {
                  "tag": "JJ",
                  "text": "quick"
                },
                {
                  "tag": "JJ",
                  "text": "brown"
                },
                {
                  "tag": "NN",
                  "text": "fox"
                }
              ]
            },
            {
              "category": "VP",
              "children": [
                {
                  "tag": "VBD",
                  "text": "jumped"
                },
                {
                  "category": "PP",
                  "children": [
                    {
                      "tag": "IN",
                      "text": "over"
                    },
                    {
                      "category": "NP",
                      "children": [
                        {
                          "tag": "DT",
                          "text": "the"
                        },
                        {
                          "tag": "JJ",
                          "text": "lazy"
                        },
                        {
                          "tag": "NN",
                          "text": "dog"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
]

About

A RESTful API for Natural Language Processing, wrapping functionality from the Standford Core NLP library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages