API Reference


The DSaS API is organized around REST. Our API is designed to have predictable, resource-oriented URLS, to use HTTP response codes to indicate API errors, and to use built-in HTTP features. JSON will be returned in all responses from the API, including errors.

Learn More

Library available here, need to be built as .WAR and deployed on Tomcat 6.xx.

Available here, just add web-method name and parameters.

  • Description
  •     a simple method to see if the service is awake and access to the DB has been reached
  • Parameters
  •     none
  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/pingDB
  • Sample Response
  •     processing request at: 2012-06-05T08:48:32.795-04:00

        DawidSkene object with id=1234512345 has been inserted to the DB...

        DawidSkene object with id=1234512345 has been removed from the DB...successfully

  • Description
  •     a simple method to see if the service is awake
  • Parameters
  •     none
  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/ping
  • Sample Response
  •     "processing request at: 2012-03-27T22:06:06.619Z"
  • Description
  •     resets the ds model
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/reset?id=1
  • Sample Response
  •     nullified the ds object, and deleted ds with id 1
  • Description
  •     checks if BatchDawidSkene/IncrementalDawidSkene object with specified identefier exists in database (and cache)
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/exists?id=7
  • Sample Response
  •     true
  • Description
  •     load Categories and saves BatchDawidSkene/IncrementalDawidSkene object with specified identefier exists to the database (and cache)
  • Parameters
  •     [JSON Array]

        [any sequence of characters]

        [number]

  • Sample Request
  •     [{"name":"name1","prior":-1.0,"misclassification_cost":{}},{"name":"name2","prior":-1.0,"misclassification_cost":{}}]

        2

        10

  • Sample Response
  •     built a ds with 2 categories[{"name":"name1","prior":0.0,"misclassification_cost":{"name1":0.0,"name2":1.0}},{"name":"name2","prior":0.0,"misclassification_cost":{"name1":1.0,"name2":0.0}}]
  • Description
  •     Loads a json set of misclassification cost objects
  • Parameters
  •     [JSON Array]

        [any sequence of characters]

  • Sample Request
  •     [{"categoryFrom":"name1","categoryTo":"name2","cost":0.9},{"categoryFrom":"name1","categoryTo":"name2","cost":0.1},{"categoryFrom":"name2","categoryTo":"name1","cost":0.4}]

        2

  • Sample Response
  •     adding 3 new misclassification costs
  • Description
  •     add a worker-assigned label to the model
  • Parameters
  •     [JSON Array]

        [any sequence of characters]

  • Sample Request
  •     {"workerName":"workerName","objectName":"objectName","categoryName":"name1"}

        2

  • Sample Response
  •     adding {"workerName":"workerName","objectName":"objectName","categoryName":"name1"}
  • Description
  •     add a worker-assigned label to the model
  • Parameters
  •     [JSON Array]

        [any sequence of characters]

  • Sample Request
  •     [{"workerName":"workerName","objectName":"objectName","categoryName":"name1"},{"workerName":"workerName2","objectName":"objectName2","categoryName":"name2"}]

        2

  • Sample Response
  •     adding 2 labels
  • Description
  •     add a gold label to the model
  • Parameters
  •     [JSON Object]

        [any sequence of characters]

  • Sample Request
  • {"objectName":"objectName2","correctCategory":"name1"}    

    2    

  • Sample Response
  •     adding gold label: {"objectName":"objectName2","correctCategory":"name1"}
  • Description
  •     add gold labels to the model
  • Parameters
  •     [JSON Object]

        [any sequence of characters]

  • Sample Request
  •     [{"objectName":"objectName2","correctCategory":"name1"}, {"objectName":"objectName","correctCategory":"name2"}]

        2

  • Sample Response
  •     adding 2 gold labels
  • Description
  •     computes majority votes for objects
  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     2

        [objectName,objectName2]

  • Sample Response
  •     {"objectName":"name2","objectName2":"name1"}
  • Description
  •     computes majority votes for objects
  • Parameters
  •     [any sequence of characters]

        [JSON Array]

  • Sample Request
  •     2

        [objectName,objectName2]

  • Sample Response
  •     {"objectName":"name2","objectName2":"name1"}
  • Description
  •     computes majority votes for objects
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     2
  • Sample Response
  •     {"objectName":"name2","objectName2":"name1"}
  • Description
  •     computes class probs objects
  • Parameters
  •     [any sequence of characters]

        [JSON Array]

  • Sample Request
  •     2

        [objectName,objectName2]

  • Sample Response
  •     {"objectName2":{"name1":1.0,"name2":0.0},"objectName":{"name1":0.0,"name2":1.0}}
  • Description
  •     computes class probs objects
  • Parameters
  •     [any sequence of characters]

        [JSON Object]

  • Sample Request
  •     2

        ObjectName2

  • Sample Response
  •     {"name1":1.0,"name2":0.0}
  • Description
  •     runs the algorithm, iterating the specified number of times
  • Parameters
  •     [number]

        [any sequence of characters]

  • Sample Request
  •     2

        10

  • Sample Response
  •     performed ds iteration 10 times, took: 1ms.
  • Description
  •     print Worker`s info
  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     no matter

        2

  • Sample Response
  •     Worker: workerName

        Error Rate: 46.0%

        Quality (Expected): 41%

        Quality (Optimized): 5%

        Number of Annotations: 1

        Number of Gold Tests: 1

        Confusion Matrix:

        P[name1->name1]=90.0%

        P[name1->name2]=10.0%

        P[name2->name1]=55.0%

        P[name2->name2]=45.0%

        

        Worker: workerName2

        Error Rate: 19.0%

        Quality (Expected): 42%

        Quality (Optimized): 0%

        Number of Annotations: 1

        Number of Gold Tests: 1

        Confusion Matrix:

        P[name1->name1]=45.0% P[name1->name2]=55.0%

        P[name2->name1]=10.0% P[name2->name2]=90.0%

  • Description
  •     calculates and prints object`s probabilities
  • Parameters
  •     [number with floating point]

        [any sequence of characters]

  • Sample Request
  •     2

        0.5

  • Sample Response
  •     Object Pr[name1] Pr[name2] Pre-DS Majority Label Pre-DS Min Cost Label Post-DS Majority Label Post-DS Min Cost Label
  • Description
  •     calculates and prints object`s probabilities
  • Parameters
  •     [any sequence of characters]

        [number with floating point]

        [any sequence of characters]

  • Sample Request
  •     ObjectName2

        2

  • Sample Response
  •     null
  • Description
  •     prints priors by given id
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     2
  • Sample Response
  •     Prior[name1]=0.5

        Prior[name2]=0.5

  • Description
  •     prints the list of the category/priority relations
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     2
  • Sample Response
  •     {"name1":0.5,"name2":0.5}
  • Description
  •     prints BatchDawidSkene or IncrementalDawidSkene by given identifier
  • Parameters
  •     [any sequence of characters]
  • Sample Request
  •     2
  • Sample Response
  •     {"dsmethod":"UPDATEWORKERS","priorDenominator":2.0,"objects":{"objectName":{"name":"objectName","isGold":true,"correctCategory":"name2","categoryProbability":{"name1":0.0,"name2":1.0},"labels":[{"workerName":"workerName","objectName":"objectName","categoryName":"name1"}]},"objectName2":{"name":"objectName2","isGold":true,"correctCategory":"name1","categoryProbability":{"name1":1.0,"name2":0.0},"labels":[{"workerName":"workerName2","objectName":"objectName2","categoryName":"name2"}]}},"workers":{"workerName":{"name":"workerName","cm":{"categories":["name1","name2"],"matrix":{"{\"to\":\"name1\",\"from\":\"name2\"}":1.1,"{\"to\":\"name2\",\"from\":\"name1\"}":0.1,"{\"to\":\"name2\",\"from\":\"name2\"}":0.9,"{\"to\":\"name1\",\"from\":\"name1\"}":0.9},"rowDenominator":{"name1":0.9999999999999999,"name2":2.0}},"labels":[{"workerName":"workerName","objectName":"objectName","categoryName":"name1"}]},"workerName2":{"name":"workerName2","cm":{"categories":["name1","name2"],"matrix":{"{\"to\":\"name1\",\"from\":\"name2\"}":0.1,"{\"to\":\"name2\",\"from\":\"name1\"}":1.1,"{\"to\":\"name2\",\"from\":\"name2\"}":0.8999999999999999,"{\"to\":\"name1\",\"from\":\"name1\"}":0.9},"rowDenominator":{"name1":2.0,"name2":1.0}},"labels":[{"workerName":"workerName2","objectName":"objectName2","categoryName":"name2"}]}},"categories":{"name1":{"name":"name1","prior":1.0,"misclassification_cost":{"name1":0.0,"name2":0.1}},"name2":{"name":"name2","prior":1.0,"misclassification_cost":{"name1":0.4,"name2":0.0}}},"fixedPriors":false,"id":"2"}
  • Example of the Request
  •   <form  method="post"
             action="http://23.21.128.180:8080/GetAnotherLabel/rest/loadCategories"
             name="formOne"
             enctype="application/json;
             charset=utf-8">
             
          <input name="id" value="2"/>
          
          <input name="incremental" value="10"/>
          
          <textarea name="categories">
            [{"name":"name1","prior":-1.0,"misclassification_cost":{}},
             {"name":"name2","prior":-1.0,"misclassification_cost":{}}]
          </textarea>
          
          <button type="submit">
            Compute
          </button>
          
      </form>

  • Description
  •     load Categories and saves BatchDawidSkene/IncrementalDawidSkene object with specified identefier exists to the database (and cache)

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [number]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadCategories

        name1, name2, name3

        12

        10

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadCategories returned a response status of 200 OK

  • Description
  •     Loads a json set of misclassification cost objects

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadCosts

        name1,name1,name2

        name2,name2,name1

        0.9,0.1,0.4

        2

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadCosts returned a response status of 200 OK

  • Description
  •     add a worker-assigned label to the model

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadWorkerAssignedLabels

        workerName11

        objectName22

        name1

        2

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadWorkerAssignedLabel returned a response status of 200 OK

  • Description
  •     add a worker-assigned labels to the model

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadWorkerAssignedLabels

        workerName11,workerName12

        objectName22,objectName23

        name1,name2

        2

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadWorkerAssignedLabels returned a response status of 200 OK

  • Description
  •     add a gold label to the model

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadGoldLabel

        objectName2

        name1

        2

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadGoldLabel returned a response status of 200 OK

  • Description
  •     add gold labels to the model

  • Parameters
  •     [any sequence of characters]

        [any sequence of characters]

        [any sequence of characters]

  • Sample Request
  •     http://23.21.128.180:8080/GetAnotherLabel/rest/notjson/loadGoldLabels

        objectName2, on3

        name1,name2

        2

  • Sample Response
  •     POST http://23.21.128.180:8080/GetAnotherLabel/rest/loadGoldLabels returned a response status of 200 OK