nlp

nlp / LDAMapper / 0.1.1

LDA Mapper

2 Credit Royalty API Calls - 6,279
Maps LDA topics to documents
Language
Python 2.x
Permissions
The Algorithm Platform License is the set of terms that are stated in the Software License section of the Algorithmia Application Developer and API License Agreement. It is intended to allow users to reserve as many rights as possible without limiting Algorithmia's ability to run it as a service. Learn More

Run an Example

Input
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.7500000000000001,
        "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.6000000000000001,
        "3": 0.2
      }
    },
    {
      "doc": "superintelligent AI will takeover and rise",
      "freq": {
        "0": 0,
        "1": 0,
        "2": 0.6666666666666666,
        "3": 0.3333333333333333
      }
    }
  ]
}

Install and Use

Install

Install the Algorithmia CLI client by running:

curl -sSLf https://algorithmia.com/install.sh | sh

Then authenticate by running:

algo auth
# Enter API Key: YOUR_API_KEY
CLI Install Docs

Use



algo run nlp/LDAMapper/0.1.1 -d '{
  "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"
  ]
}' --timeout 300
  
CLI Docs