1.0.0 • Published 8 years ago

idibon v1.0.0

Weekly downloads
5
License
-
Repository
github
Last release
8 years ago

Nodejs SDK for Idibon

Samples of usage are located in the samples/api/ subdirectory.

A full test suite is located in the test/ subdirectory. You can run it by calling jasmine-node test/* from the main folder.

Sample Apps

NameDescription
listCollectionsLists all collections
createCollectionCreates a new collection
deleteCollectionDeletes an existing collection
createDocumentsUploads a set of documents to a collection
fetchDocumentsFetches multiple documents from a collection
deleteDocumentDeletes a document from a collection
createTaskCreate a new task to start assigning labels
addTaskLabelsAdd label possibilities to an existing task
createAnnotationAdd an annotation for a task to a document
createClassificationGenerate predictions for unstored text

listCollections Sample App

This application lists all collections that are available using your API key. To Use:

cd samples/api
node listCollections.js $API_KEY

createCollection Sample App

This application creates a brand new collection. To Use:

cd samples/api
node createCollection.js $API_KEY $COLLECTION $DESCRIPTION
  • $COLLECTION should be a String specifying the new collection's name.

  • $DESCRIPTION should be a String, and contain a description of the new collection.

deleteCollection Sample App

This application deletes an existing collection. To avoid accidental bulk deletes, the collection must be empty of all documents before it can be deleted. The collection is assumed to exist. To Use:

cd samples/api
node deleteCollection.js $API_KEY $COLLECTION
  • $COLLECTION should be a String specifying the doomed collection's name.

createDocuments Sample App

This application adds a set of new documents to a currently existing collection. It is assumed that the collection already exists. To Use:

cd samples/api
node createDocument.js $API_KEY $COLLECTION $UPLOAD_FILE
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $UPLOAD FILE should be a String specifying the file containing the documents to be uploaded. New lines should separate each individual document. Each line can specify the name, the content, and the metadata. The name is optional, if it's not provided then the API will assign an internally-generated name:

{"name": "Document name1", "content": "Document content1", "metadata": { ... } }
{"name": "Document name2", "content": "Document content2", "metadata": { ... } }
{"name": "Document name3", "content": "Document content3", "metadata": { ... } }
...

fetchDocuments Sample App

This application fetches all documents from an existing collection. To Use:

cd samples/api
node fetchDocuments.js $API_KEY $COLLECTION $TASK
  • $COLLECTION should be a String specifying the collection. Only documents that are a part of this collection will be returned.

  • $TASK should be a String specifying the task. Only documents associated with this task will be returned.

deleteDocument Sample App

This application deletes a single document from a collection. To Use:

cd samples/api
node deleteDocument.js $API_KEY $COLLECTION $DOC_NAME
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $DOC_NAME should be a String specifying the documents name.

createTask Sample App

This application creates a new task within a currently existing collection. The collection must already exist. To Use:

cd samples/api
node createTask.js $API_KEY $COLLECTION $TASK_NAME $DESCRIPTION $SCOPE
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $TASK_NAME should be a String naming the task.

  • $DESCRIPTION should be a String and should be a description of the task.

addTaskLabels Sample App

This application adds a possible label to an existing task. Both the relevant collection and the relevant task must already exist. To Use:

cd samples/api
node addTaskLabels.js $API_KEY $COLLECTION $TASK $LABEL_NAME $LABEL_DESCRIPTION
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $TASK should be a String naming the task that will contain this label.

  • $LABEL_NAME should be a String specifying the name of the new label.

  • $LABEL_DESCRIPTION should be a String containing the description of the new label.

createAnnotation Sample App

This application adds an annotation to an existing document. The document and relevant collection must already exist. To Use:

cd samples/api
node createAnnotation.js $API_KEY $COLLECTION $DOCUMENT $TASK $LABEL
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $DOCUMENT should be a String specifying the document to which the annotation will be attached.

  • $TASK should be a String naming the task that will contain this annotation.

  • $LABEL should be a String and should specify the label of the annotation.

createClassification Sample App

Generates a classification for a document. This requires that the relevant task has a trained model associated with it. The task, collection, and document are assumed to exist. To Use:

cd samples/api
node createClassification.js $API_KEY $COLLECTION $TASK $DOCUMENT
  • $COLLECTION should be a String specifying the name of the relevant collection.

  • $TASK should be a String specifying the task used to generate the classification.

  • $DOCUMENT should be a String specifying the document on which the classification will be made.