Skip to main content

Python SDK for Humingbird!

Project description

Welcome to Humingbird

Humingbird is a Python framework for highly simplified machine learning classification. Using Humingbird allows you to build custom image and text classification systems with no data, no training and only 9 lines of code. Humingbird is intended for two types of developers:

  • Developers who are experienced in programming but not in machine learning
  • Developers experienced with machine learning but an extremely streamlined experience with little overhead.

Note: This package requires download of two models (one for image and one for text classification tasks). These models total approx 600 MB in storage.

Quickstart

First, we need to download the package. You can do this by running the following command in your terminal:

pip install humingbird

After installation, we can run a custom image classification job with no data or training!

import humingbird

# flexible creation + prediction in one call
prediction = humingbird.Image.predict(
       image_file="your_path.jpg",             # path to the image file for inference
       labels=["cat", "dog"]                   # supply potential labels that this image could be (i.e: allow the model to select the most probable)
)

print(prediction)

Which will yield something along the lines of:

[
    {
       "label": "cat",
       "score": 0.98
    },
    {
       "label": "dog",
       "score": 0.02
    }
]

It's as simple as providing the possible labels and a predicting image/text snippet.

Using Humingbird for Text classification

Much like the quickstart, Humingbird also allows for highly simplified text classification workflows.

import humingbird

# flexible creation + prediction in one call
prediction = humingbird.Text.predict(
       text="I love Humingbird! It's so easy.",        # inference text snippet
       labels=["toxic", "not toxic"]                   # supply potential labels that this text snippet could be (i.e: allow the model to select the most probable)
)

print(prediction)

Which will yield the same type of output as the quickstart.

How is this possible?

Recent advances in the Transformer architecture has allowed for unprecendented capabilities in machine learning. One of these areas that has been recently improved in the area of zero-shot-learning.

A very basic way to think about zero-shot-learning is we train a model on lots of data for the task of predicting the most probable set of labels given an input. This may sound exactly like traditional classification, but where is differs is that we are finding the relationships between label -> input, similar to an image captioning problem.

After training these models in this fashion, what we get is a model that can do zero-shot-learning relatively well. This opens up the possibility to get rid of long training cycles, big data collection and complex setup for basic tasks.

Limitations

This package can only do image and text classification. If I can get to it, I would love to support other modes of zero-shot-classification like object detection, entity recognition etc.

Humingbird API

For those interested, a REST API for enhanced models may be on the roadmap. This would be for developers who don't have the hardware to run the models in the open source package, or would like a fully managed experience with premium features.

For more info, please check out https://www.humingbird.co

Project details


Download files

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

Source Distribution

humingbird-0.5.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

humingbird-0.5.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file humingbird-0.5.1.tar.gz.

File metadata

  • Download URL: humingbird-0.5.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for humingbird-0.5.1.tar.gz
Algorithm Hash digest
SHA256 d4f353435ae83d5e7caf4456a84add8ec0e15656debded3d48f6b88bd69459a2
MD5 d65b03c1f5a6c09a388334261a7b5b84
BLAKE2b-256 f76a3b8a7a78027d2f2f9eac17477cd628a5fc2bd1f197652c11a7eb5e0440b4

See more details on using hashes here.

File details

Details for the file humingbird-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: humingbird-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for humingbird-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49c6fe8c168c9435795c86f945445b797d234cce8f8b083e0807cc5127934bbd
MD5 a7494133a4399559a26f71e60c476ffe
BLAKE2b-256 0449fe160ee694cc0df3f8bf49560a9ca7636020555f091385da786a987c0fb3

See more details on using hashes here.

Supported by

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