Document Similarity

FREEMIUM
By textanalysis
Updated 5 months ago
Data
-/10
Popularity Score
-
Latency
-
Success Rate

Document Similarity API Documentation

Document Similarity API is based on advanced Natural Language Processing and Machine Learning technologies, and it belongs to text analysis and can be used to analysis the semantic similarity of two text document that user provided. The result is cosine similarity from 0 to 1, 0 means absolute different, 1 means absolute same.

View API Details
POSTDocument Similarity
POSTDocument Similarity

Document Similarity for two text document,give the cosine similarity from 0 to 1, 0 means absolute different, 1 means absolute same.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
text1STRING
REQUIREDText document one
text2STRING
REQUIREDText document two
Code Snippet
unirest.post("https://textanalysis-document-similarity-v1.p.rapidapi.com/document-similarity")
.header("X-RapidAPI-Host", "textanalysis-document-similarity-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("text1=Deep learning is a set of algorithms in machine learning that attempt to model high-level abstractions in data by using model architectures composed of multiple non-linear transformations.")
.send("text2=Machine learning is a scientific discipline that explores the construction and study of algorithms that can learn from data.")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://textanalysis-document-similarity-v1.p.rapidapi.com/document-similarity
Request Method: POST
Response Headers
Response Body

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://textanalysis-document-similarity-v1.p.rapidapi.com/document-similarity")
.header("X-RapidAPI-Host", "textanalysis-document-similarity-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("text1=Deep learning is a set of algorithms in machine learning that attempt to model high-level abstractions in data by using model architectures composed of multiple non-linear transformations.")
.send("text2=Machine learning is a scientific discipline that explores the construction and study of algorithms that can learn from data.")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication