LDA Mapper

No algorithm description given

Introduction This is a simple topic mapper algorithm for the nlp/LDA algorithm. It gives you the topic distribution for any given set of documents. Input: (Required) : Topics. (Output of nlp/LDA) (Required) : Document list. Output: Topic distribution for given documents. Examples Example 1. Parameter 1: Topics. (Output of nlp/LDA) Parameter 2: Documents list. {
 "topics": [
 {"science": 1, "machine": 1},
 {"future": 1},
 {
 "taking": 1,
 "demand": 1,
 "human": 1,
 "students": 1,
 "takeover": 1,
 "names": 1,
 "computer": 1,
 "superintelligent": 1
 },
 {"rise": 1, "machines": 1, "overlords": 1}
 ],
 "docsList": [
 "machine intelligence is the future",
 "computer science students are in demand and they know it",
 "I for one welcome our new machine overlords",
 "the machines are taking over, and they’ve even got human names",
 "superintelligent AI will takeover and rise"
 ]
} Output: {
 "topic_distribution":[
 {
 "doc": "machine intelligence is the future",
 "freq": {
 "0": 0.5,
 "1": 0.5,
 "2": 0,
 "3": 0
 }
 },
 {
 "doc": "computer science students are in demand and they know it",
 "freq": {
 "0": 0.25,
 "1": 0,
 "2": 0.75,
 "3": 0
 }
 },
 {
 "doc": "I for one welcome our new machine overlords",
 "freq": {
 "0": 0.5,
 "1": 0,
 "2": 0,
 "3": 0.5
 }
 },
 {
 "doc": "the machines are taking over, and they’ve even got human names",
 "freq": {
 "0": 0.2,
 "1": 0,
 "2": 0.6,
 "3": 0.2
 }
 },
 {
 "doc": "superintelligent AI will takeover and rise",
 "freq": {
 "0": 0,
 "1": 0,
 "2": 0.6666666666666666,
 "3": 0.3333333333333333
 }
 }
 ]
}

Tags
(no tags)

Cost Breakdown

2 cr
royalty per call
1 cr
usage per second
avg duration

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.

No permissions required

This algorithm does not require any special permissions.


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' https://api.algorithmia.com/v1/algo/nlp/LDAMapper/0.1.1
View cURL Docs
algo auth
# Enter API Key: YOUR_API_KEY
algo run algo://nlp/LDAMapper/0.1.1 -d '{{input | formatInput:"cli"}}'
View CLI 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/LDAMapper/0.1.1");
AlgoResponse result = algo.pipeJson(input);
System.out.println(result.asJsonString());
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/LDAMapper/0.1.1")
val result = algo.pipeJson(input)
System.out.println(result.asJsonString)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://nlp/LDAMapper/0.1.1")
           .pipe(input)
           .then(function(output) {
             console.log(output);
           });
View Javascript Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://nlp/LDAMapper/0.1.1")
           .pipe(input)
           .then(function(response) {
             console.log(response.get());
           });
View NodeJS Docs
import Algorithmia

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

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

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

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo('nlp/LDAMapper/0.1.1');
let response = algo.pipe(input);
View Rust Docs
Discussion
  • {{comment.username}}