0.1.1-b • Published 3 years ago

supernlp v0.1.1-b

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Natural Language Processing, but easy.

Get your free API key at supernlp.co.

Example

import { SuperNLPClient } from "supernlp";

const client = new SuperNLPClient("my-api-key");

const analysis = await client.parse(`The sky above the port was the color of television, tuned to a dead channel. "It's not like I'm using," Case heard someone say, as he shouldered his way through the crowd around the door of the Chat.`);

console.log(analysis.sentencesText);
/*
[
    'The sky above the port was the color of television, tuned to a dead channel.',
    '"It's not like I'm using," Case heard someone say, as he shouldered his way through the crowd around the door of the Chat.'
]
*/

console.log(analysis.entities);
/*
{
  "ent-ce8f3203": {
    "text": "Case",
    "lemma": "Case",
    "sentenceId": "sent-e68e3eee",
    "charOffset": 104,
    "length": 4,
    "tokenIds": [
      "tok-95053c6c"
    ],
    "tokens": [
        ...
    ],
    "entityId": "ent-ce8f3203",
    "type": "PERSON",
    "meta": {
      "parsedNumberValue": null,
      "parsedDatetime": null
    }
  }
}
*/

console.log(analysis.nounPhrasesText);
/*
[
  "the sky",
  "the port",
  "the color",
  "television",
  "a dead channel",
  "it",
  "I",
  "Case",
  "someone",
  "he",
  "his way",
  "the crowd",
  "the door",
  "the Chat"
]
*/