similarityScore
To get the semantic similarity between two texts
/similarityscore
Usage and SDK Samples
curl -X POST -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/anise-text/similarityscore?first_text=&second_text="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SemanticSimilarityApi;
import java.io.File;
import java.util.*;
public class SemanticSimilarityApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apieco-key
ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
apieco-key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.setApiKeyPrefix("Token");
SemanticSimilarityApi apiInstance = new SemanticSimilarityApi();
String apiecoKey = apiecoKey_example; // String |
String firstText = firstText_example; // String | First text to be compared with the second text
String secondText = secondText_example; // String | Second text to be compared with the first text
try {
inline_response_200_1 result = apiInstance.similarityScore(apiecoKey, firstText, secondText);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SemanticSimilarityApi#similarityScore");
e.printStackTrace();
}
}
}
import io.swagger.client.api.SemanticSimilarityApi;
public class SemanticSimilarityApiExample {
public static void main(String[] args) {
SemanticSimilarityApi apiInstance = new SemanticSimilarityApi();
String apiecoKey = apiecoKey_example; // String |
String firstText = firstText_example; // String | First text to be compared with the second text
String secondText = secondText_example; // String | Second text to be compared with the first text
try {
inline_response_200_1 result = apiInstance.similarityScore(apiecoKey, firstText, secondText);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SemanticSimilarityApi#similarityScore");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];
String *apiecoKey = apiecoKey_example; //
String *firstText = firstText_example; // First text to be compared with the second text
String *secondText = secondText_example; // Second text to be compared with the first text
SemanticSimilarityApi *apiInstance = [[SemanticSimilarityApi alloc] init];
//
[apiInstance similarityScoreWith:apiecoKey
firstText:firstText
secondText:secondText
completionHandler: ^(inline_response_200_1 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AniseTextAnalyzerApiDocumentation = require('anise_text_analyzer_api_documentation');
var defaultClient = AniseTextAnalyzerApiDocumentation.ApiClient.instance;
// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"
var api = new AniseTextAnalyzerApiDocumentation.SemanticSimilarityApi()
var apiecoKey = apiecoKey_example; // {String}
var firstText = firstText_example; // {String} First text to be compared with the second text
var secondText = secondText_example; // {String} Second text to be compared with the first text
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.similarityScore(apiecoKey, firstText, secondText, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class similarityScoreExample
{
public void main()
{
// Configure API key authorization: apieco-key
Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");
var apiInstance = new SemanticSimilarityApi();
var apiecoKey = apiecoKey_example; // String |
var firstText = firstText_example; // String | First text to be compared with the second text
var secondText = secondText_example; // String | Second text to be compared with the first text
try
{
//
inline_response_200_1 result = apiInstance.similarityScore(apiecoKey, firstText, secondText);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling SemanticSimilarityApi.similarityScore: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');
$api_instance = new Swagger\Client\Api\SemanticSimilarityApi();
$apiecoKey = apiecoKey_example; // String |
$firstText = firstText_example; // String | First text to be compared with the second text
$secondText = secondText_example; // String | Second text to be compared with the first text
try {
$result = $api_instance->similarityScore($apiecoKey, $firstText, $secondText);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SemanticSimilarityApi->similarityScore: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SemanticSimilarityApi;
# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::SemanticSimilarityApi->new();
my $apiecoKey = apiecoKey_example; # String |
my $firstText = firstText_example; # String | First text to be compared with the second text
my $secondText = secondText_example; # String | Second text to be compared with the first text
eval {
my $result = $api_instance->similarityScore(apiecoKey => $apiecoKey, firstText => $firstText, secondText => $secondText);
print Dumper($result);
};
if ($@) {
warn "Exception when calling SemanticSimilarityApi->similarityScore: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.SemanticSimilarityApi()
apiecoKey = apiecoKey_example # String |
firstText = firstText_example # String | First text to be compared with the second text
secondText = secondText_example # String | Second text to be compared with the first text
try:
#
api_response = api_instance.similarity_score(apiecoKey, firstText, secondText)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemanticSimilarityApi->similarityScore: %s\n" % e)
Parameters
Header parameters
Name | Description |
---|---|
apieco-key* |
String
Required
|
Query parameters
Name | Description |
---|---|
first_text* |
String
First text to be compared with the second text
Required
|
second_text* |
String
Second text to be compared with the first text
Required
|