How to Part-of-Speech Tag a String & Filter to Verbs (Only) using Node.js

Our NLP API endpoint offers a variety of options to analyze, parse and categorize unstructured text. With our Verb POS-tagger API iteration, you can quickly filter an input text string into a JSON containing only the verbs within that sentence (clearly labeled as such). With this information, you can inform linguistic/statistical models with greater context and therefore greater accuracy.

Below, we’ll walk through how to structure your API call using Node.js code snippets. First, however, you should register a free account on our website if you don’t have one — this will give you the API key you need to authenticate the operation (which comes with 800 free uses per month).

To begin, let’s install the Node.js SDK:

Next, let’s include the following two snippets (your API key must be included in the latter of the two):

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';

Now let’s wrap up by calling the function:

var request = new CloudmersiveNlpApiClient.PosRequest(); // PosRequest | Input stringvar callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.posTaggerTagVerbs(request, callback);

Just like that, you’re all done — no more code required!

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.