supernlp
TypeScript icon, indicating that this package has built-in type declarations

0.1.1-b • Public • Published


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"
]
*/

Package Sidebar

Install

npm i supernlp

Weekly Downloads

2

Version

0.1.1-b

License

MIT

Unpacked Size

30 kB

Total Files

9

Last publish

Collaborators

  • supernlp