RapidAPI logo

ESA Semantic Relatedness

FREEMIUM
By amtera
Updated 4 months ago
Other
-/10
Popularity Score
-
Latency
-
Success Rate

ESA Semantic Relatedness API Overview

Calculates the semantic relatedness/similarity between pairs of text excerpts based on the likeness of their meaning or semantic content.

Contact API Provider
star-blueRate

Overview

ESA Semantic Relatedness

Welcome to the ESA Semantic Relatedness API. This implementation is based on Explicit Semantic Analysis which describes a method for calculating semantic similarities between linguistic items based on their distributional semantic properties over Wikipedia. Distributional semantic models such as ESA are based on the Distributional Hypothesis, which states that words co-occurring in similar contexts tend to have similar meaning.

For further information, please visit us at amtera.solutions.

Using the API

To use the API you must:

  • append the language code to the endpoint URL:

    /relatedness/en
    
  • provide a JSON payload with the following structure:

    {
      "t1": "Chris Froome wins Tour de France",
      "t2": "Wikinews interviews Spanish Paralympic track and field athlete David Casinos"
    }
    

or

    {
      "t1": "Chris Froome wins Tour de France",
      "t2": "Queensland government not doing enough on water: Poll"
    }

Each text must be 120 char. max.

  • get the results:

    {
      "t1": "Chris Froome wins Tour de France",
      "t2": "Wikinews interviews Spanish Paralympic track and field athlete David Casinos",
      "v": 0.0038747663
    }
    

or

    {
      "t1": "Chris Froome wins Tour de France",
      "t2": "Queensland government not doing enough on water: Poll",
      "v": 0.0007662044
    }

showing that the first pair of texts is closer in meaning than the second one.

Billing

You will be charged based on the number of compared pairs. Currently, it's only possible to submit one pair per request, but this may not be the case in the future.

Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://amtera.p.rapidapi.com/relatedness/en")
.header("X-RapidAPI-Host", "amtera.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"t1":"car","t2":"engine"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication