Superface

Keyword Extraction

language/keyword-extraction@1.0.0
1 provider

Extract Keywords

Identify and extract the most important words or phrases from a text document

Input
Text
Text Language
Result
keywords

1.Choose a provider

2.Use ExtractKeywords with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

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

  // Use the profile
  const result = await profile
    .getUseCase('ExtractKeywords')
    .perform({
      text: 'Artificial Intelligence (AI) is making its way into everyday developer life, but the use of AI along the API lifecycle is yet to be improved'
    }, {
      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 extract the keywords 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": "Artificial Intelligence (AI) is making its way into everyday developer life, but the use of AI along the API lifecycle is yet to be improved"
}

Result (object)

keywords
text
The keyword or phrase extracted from the given text.
importance
A number between 0 and 1 indicating importance of the keyword within the given text.

Example

{
  "keywords": [
    {
      "text": "Artificial Intelligence",
      "importance": 0.999628
    }
  ]
}

Implementation details

Provider
mock
Use case
ExtractKeywords
Author
@superface
Source
Verified