Skip to main content

No project description provided

Project description

AISquared

This package contains utilities to interact with the AI Squared technology stack, particularly with developing and deploying models to the AI Squared Browser Extension.

Installation

This package is available through Pypi and can be installed by running the following command:

pip install aisquared

Alternatively, the latest version of the software can be installed directly from GitHub using the following command

pip install git+https://github.com/AISquaredInc/aisquared

Capabilities

This package is currently in a state of constant development, so it is likely that breaking changes can be made at any time. We will work diligently to document changes and make stable releases in the future.

The aisquared package currently contains one subpackage, the aisquared.config package. This package holds objects for building the configuration files that need to be included with converted model files for use within the AI Squared Extension. The contents of the config subpackage contain both pre- and postprocessing steps to use with the model. The following will explain the functionality of the config package:

Config

The aisquared.config subpackage contains the following objects:

  • ModelConfiguration
    • The ModelConfiguration object is the final object to be used to create the configuration file. It takes as input a list of preprocessing steps, a list of postprocessing steps, a list of input shapes for all inputs within the model, an optional MLFlow URI, an optional MLFlow user, and an optional MLFlow token
  • ImagePreprocessor
    • The ImagePreprocessor class takes in preprocessing steps (defined below) which define preprocessing steps for images.
  • TabularPreprocessor
    • The TabularPreprocessor class takes in preprocessing steps (defined below) which define preprocessing steps for tabular data.
  • TextPreprocessor
    • The TextPreprocessor class takes in preprocessing steps (defined below) which define preprocessing steps for text data.
  • Regression
    • The Regression object is a postprocessing class for models which perform regression. Since it is common to train regression models by scaling regression outputs to values between 0 and 1, this class is designed to convert output values between 0 and 1 to their original values, corresponding to min and max when the class is instantiated.
  • BinaryClassification
    • The BinaryClassification object is a postprocessing class for models which perform binary classification. The class is instantiated with a label map and a cutoff value used to identify when the positive class (class 1) is identified.
  • MulticlassClassification
    • The MulticlassClassification object is a postprocessing class for models which perform multiclass classification. The class is instantiated with a label map only.
  • ObjectDetection
    • The ObjectDetection object is a postprocessing class for models which perform object detection. The class is instantiated with a label map and a cutoff value for identification.

Preprocessing Steps

The aisquared.config.preprocessing subpackage contains PreProcStep objects, which are then fed into the ImagePreprocessor, TabularPreprocessor, and TextPreprocessor classes. The PreProcStep classes are:

  • ZScore
    • This class configures standard normalization procedures for tabular data
  • MinMax
    • This class configures Min-Max scaling procedures for tabular data
  • OneHot
    • This class configures One Hot encoding for columns of tabular data
  • AddValue
    • This class configures adding values to pixels in image data
  • SubtractValue
    • This class configures subtracting values to pixels in image data
  • MultiplyValue
    • This class configures multiplying pixel values by a value in image data
  • DivideValue
    • This class configures dividing pixel values by a value in image data
  • ConvertToColor
    • This class configures converting images to the specified color scheme
  • Resize
    • This class configures image resize procedures
  • Tokenize
    • This class configures how text will be tokenized
  • RemoveCharacters
    • This class configures which characters should be removed from text
  • ConvertToCase
    • This class configures which case - upper or lower - text should be converted to
  • ConvertToVocabulary
    • This class configures how text tokens should be converted to vocabulary integers
  • PadSequences
    • This class configures how padding should occur given a sequence of text tokens converted to a sequence of integers

These step objects can then be placed within the TabularPreprocessor, ImagePreprocessor, or TextPreprocessor objects. For the TabularPreprocessor, the ZScore, MinMax, and OneHot Steps are supported. For the ImagePreprocessor, the AddValue, SubtractValue, MultiplyValue, DivideValue, ConvertToColor, and Resize Steps are supported. For the TextPreprocessor, the Tokenize, RemoveCharacters, ConvertToCase, ConvertToVocabulary, and PadSequences Steps are supported

Final Configuration and Model Creation

Once preprocessing and postprocessing objects have been created, these objects can then be passed to the aisquared.config.ModelConfiguration class. This class utilizes the objects passed to it to build the entire model configuration automatically.

Finally, the aisquared.create_air_model takes in a ModelConfiguration class and an existing Keras model to create a model file compatible with the AI Squared extension and with the .air file extension.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aisquared-0.0.1.tar.gz (86.0 kB view details)

Uploaded Source

Built Distribution

aisquared-0.0.1-py3-none-any.whl (88.4 kB view details)

Uploaded Python 3

File details

Details for the file aisquared-0.0.1.tar.gz.

File metadata

  • Download URL: aisquared-0.0.1.tar.gz
  • Upload date:
  • Size: 86.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for aisquared-0.0.1.tar.gz
Algorithm Hash digest
SHA256 19b85b2f8e4aa4e0c6e5added793385d73536d14696ae6c502ad1b1ded5534e7
MD5 b0d3b35720d8900568edd10284e7d8b3
BLAKE2b-256 686ab897d96b7b05443290d4ad021dfb671366fbdf3b186be6086f67c01f139e

See more details on using hashes here.

File details

Details for the file aisquared-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aisquared-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 88.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for aisquared-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 217707409a6ffbf8112c29bc0117deae3f37c1285c456a6a59fa4cd4090e2c2d
MD5 82c160d4144ceb8c82eaa3360b7dcf99
BLAKE2b-256 cc3e4c3b7b24d67b2930222cf84b50387940f2d731516c47cf1122755c4bf6af

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page