Liking cljdoc? Tell your friends :D

This repository contains the official Sight API Clojure client. The Sight API is a text recognition service.

Quickstart

  1. Add the Leiningen dependency:
TODO
  1. Grab an API key from the Sight dashboard.
  2. Create a client, passing your API key into the constructor, and recognize text:
(def client (->Client "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"))

(def pages (recognize client (list "invoice.pdf" "receipt.png")))

pages looks like this:

{
      "Pages": [
        {
          "Error": "",
          "FileIndex": 0,
          "PageNumber": 1,
          "NumberOfPagesInFile": 3,
          "RecognizedText": [ ... ]
        },
        ...
      ]
}

FileIndex is the index of this file in the original request's "files" array.

RecognizedText looks like this:

    "RecognizedText": [
        {
          "Text": "Invoice",
          "Confidence": 0.22863210084975458
          "TopLeftX": 395,
          "TopLeftY": 35,
          "TopRightX": 449,
          "TopRightY": 35,
          "BottomLeftX": 395,
          "BottomLeftY": 47,
          "BottomRightX": 449,
          "BottomRightY": 47,
        },
        ...
      ]

Word-Level Bounding Boxes

TODO

recognize has an additional signature with a third parameter, word-level-bounding-boxes. If it's true then word-level bounding boxes are returned instead of sentence-level bounding boxes. E.g.,

(recognize client (list "invoice.pdf" "receipt.png") true)

Official API Documentation

Here is the official documentation for the Sight API.

Apache V2 License

This code is licensed under Apache V2.0. The full text of the license can be found in the "LICENSE" file.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close