Named-Entity Recognition

language/named-entity-recognition@1.0.0
1 provider

Named-Entity Recognition

Identify and classify named entities such as people, organizations, locations, dates, and other categories of words in a given text.

Input
Text
Text Language
Result
List of Entities

1.Choose a provider

2.Use NamedEntityRecognition with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('language/named-entity-recognition@1.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('NamedEntityRecognition')
    .perform({
      text: 'Houston Natural Gas, run by Kenneth Lay merges with InterNorth, a natural gas company in Omaha, Nebraska, to form an interstate and intrastate natural gas pipeline with approximately 37,000 miles of pipeline.'
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

text
The text you wish to identify and classify named entities from. Note that most providers require the text to be less than 1000 characters
languageCode
Optionally specify the exact language of the text. Useful for phrases that might be ambigous. Uses ISO 639-1 format (e.g. `en`, `fr`, `es`)

Example

{
  "text": "Houston Natural Gas, run by Kenneth Lay merges with InterNorth, a natural gas company in Omaha, Nebraska, to form an interstate and intrastate natural gas pipeline with approximately 37,000 miles of pipeline."
}

Result (object)

entities
Each entity refers to a specific real-world object or a finding, such as a person, place, organization, or product.

Example

{
  "entities": [
    {
      "text": "Houston Natural Gas",
      "category": "Organization",
      "importance": 0.954265
    }
  ]
}

Implementation details

Provider
mock
Use case
NamedEntityRecognition
Author
@superface
Source
Verified