amazon_en

Product sentiment

Desktop, Classication, Caffe

curl -X PUT http://localhost:8080/services/amazon_en -d '{
 "description": "Product sentiment",
 "model": {
  "repository": "/opt/models/amazon_en",
  "create_repository": true,
  "init":"https://deepdetect.com/models/init/desktop/text/amazon_polarity_vdcnn.tar.gz"
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "txt"
  }
 }
}'
curl -X POST 'http://localhost:8080/predict' -d '{
  "service": "amazon_en",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.3,
      "bbox": true
    },
    "mllib": {
      "gpu": true
    }
  },
  "data": [
    "good stuff!"
  ]
}'
from dd_client import DD
from dd_client import DD
host = 'localhost'
port = 8080
dd = DD(host,port)
dd.set_return_format(dd.RETURN_PYTHON)

parameters_input = {"confidence_threshold":0.3}
parameters_mllib = {}
parameters_output = {}
data = ["good stuff!"]
sname = 'amazon_en'
classif = dd.post_predict(sname,data,parameters_input,parameters_mllib,parameters_output)
// https://www.npmjs.com/package/deepdetect-js
var DD = require('deepdetect-js');

const dd = new DD({
  host: 'localhost',
  port: 8080
})

const postData = {
  "service": "amazon_en",
  "parameters": {
    "input": {
    },
    "output": {
      "confidence_threshold": 0.3
    },
    "mllib": {
      "gpu": true
    }
  },
  "data": [
    "good stuff!"
  ]
}

async function run() {
  const predict = await dd.postPredict(postData);
  console.log(predict);
}

run()
{
  "status": {
    "code": 200,
    "msg": "OK"
  },
  "head": {
    "method": "/predict",
    "service": "amazon_en",
    "time": 17
  },
  "body": {
    "predictions": [
      {
        "classes": [
          {
            "prob": 0.897,
            "last": true,
            "cat": "positive"
          }
        ],
        "uri": "0"
      }
    ]
  }
}