Keyword Set Similarity

No algorithm description given

Determines similarity between sets of weighted keywords.  How it works: Each keyword set is represented as a Map<String,Double>, where the String is the keyword and the Double is it's weight. The similarity of two sets is the sum of the products of the weights of their shared keywords, for instance, if set A has keywords "dog", "cat", and "mouse" with weights 1,2, and 2, respectively and set B has keywords "dog", "cat", and "moose" with weights 1.5,3, and 4, their similarity by this metric is 1*1.5 + 2*3 = 7.5. This can be thought of as the inner product of word vectors. Input format: [{id1:{word1:weight1, word2:weight2}, id2:{word3:weight3}}, 2] The most convenient input format for a set of keyword sets is  Map<String,Map<String,Double>>, where the first String key is an identifier for the keyword set, and its value, a Map<String,Double>, is the set of keywords with their respective weights as values. The algorithm also requires an int that determines the maximum number of similar sets to return for each keyword set.  You do not have to name the sets, if you just provide a List<Map<String,Double>>, the algorithm takes the index of each set as the id and returns the output accordingly. Output format: The output is a Map from Strings to Set<String>'s, where the Set<String> value is the set of most similar keyword sets (denoted by a  String identifier ).

(no tags)

Cost Breakdown

0 cr
royalty per call
1 cr
usage per second
avg duration
This algorithm has permission to call other algorithms which may incur separate royalty and usage costs.

Cost Calculator

API call duration (sec)
API calls
Estimated cost
per calls
for large volume discounts
For additional details on how pricing works, see Algorithmia pricing.

Calls other algorithms

This algorithm has permission to call other algorithms. This allows an algorithm to compose sophisticated functionality using other algorithms as building blocks, however it also carries the potential of incurring additional royalty and usage costs from any algorithm that it calls.

To understand more about how algorithm permissions work, see the permissions documentation.

1. Type your input

2. See the result

Running algorithm...

3. Use this algorithm

curl -X POST -d '{{input | formatInput:"curl"}}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY'
View cURL Docs
algo auth
algo run algo://nlp/KeywordSetSimilarity/0.1.4 -d '{{input | formatInput:"cli"}}'
View CLI Docs
import (
  algorithmia ""

input := {{input | formatInput:"go"}}

var client = algorithmia.NewClient("YOUR_API_KEY", "")
algo, _ := client.Algo("algo://nlp/KeywordSetSimilarity/0.1.4")
resp, _ := algo.Pipe(input)
response := resp.(*algorithmia.AlgoResponse)
View Go Docs
import com.algorithmia.*;
import com.algorithmia.algo.*;

String input = "{{input | formatInput:"java"}}";
AlgorithmiaClient client = Algorithmia.client("YOUR_API_KEY");
Algorithm algo = client.algo("algo://nlp/KeywordSetSimilarity/0.1.4");
AlgoResponse result = algo.pipeJson(input);
View Java Docs
import com.algorithmia._
import com.algorithmia.algo._

val input = {{input | formatInput:"scala"}}
val client = Algorithmia.client("YOUR_API_KEY")
val algo = client.algo("algo://nlp/KeywordSetSimilarity/0.1.4")
val result = algo.pipeJson(input)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
           .then(function(output) {
View Javascript Docs
using Algorithmia;

var input = "{{input | formatInput:"cs"}}";
var client = new Client("YOUR_API_KEY");
var algorithm = client.algo("algo://nlp/KeywordSetSimilarity/0.1.4");
var response = algorithm.pipe<object>(input);
View .NET/C# Docs
var input = {{input | formatInput:"javascript"}};
           .then(function(response) {
View NodeJS Docs
import Algorithmia

input = {{input | formatInput:"python"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('nlp/KeywordSetSimilarity/0.1.4')
print algo.pipe(input)
View Python Docs

input <- {{input | formatInput:"r"}}
client <- getAlgorithmiaClient("YOUR_API_KEY")
algo <- client$algo("nlp/KeywordSetSimilarity/0.1.4")
result <- algo$pipe(input)$result
View R Docs
require 'algorithmia'

input = {{input | formatInput:"ruby"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('nlp/KeywordSetSimilarity/0.1.4')
puts algo.pipe(input).result
View Ruby Docs
use algorithmia::Algorithmia;

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo("nlp/KeywordSetSimilarity/0.1.4");
let response = algo.pipe(input);
View Rust Docs
import Algorithmia

let input = "{{input | formatInput:"swift"}}";
let client = Algorithmia.client(simpleKey: "YOUR_API_KEY")
let algo = client.algo(algoUri: "nlp/KeywordSetSimilarity/0.1.4") { resp, error in
View Swift Docs
  • {{comment.username}}