Skip to main content

ClarifaiPySpark

Introduction

This readme provides overview of the Software Development Kit (SDK) under development for integrating Clarifai with Databricks. The primary use case for this SDK is to facilitate the interaction between Databricks and Clarifai for tasks related to uploading client datasets, annotating data, and exporting and storing annotations in Spark DataFrames or Delta tables.

Screenshot 2023-11-17 at 5 21 04 PM

The initial use case for this SDK revolves around three main objectives:

Uploading Client Datasets into Clarifai App:

The SDK should enable the seamless upload of datasets into the Clarifai application, simplifying the process of data transfer from Databricks to Clarifai.

Annotate the Data:

It should provide features for data annotation, making it easier for users to add labels and metadata to their datasets within the Clarifai platform.

Export Annotations to Spark DataFrames/Delta Tables:

The SDK should offer functionality to export annotations and store them in Spark DataFrames or Delta tables, facilitating further data analysis within Databricks.

Requirements:

  • Databricks : Runtime 13.3 or later
  • Clarifai : pip install clarifai
  • Create your Clarifai account
  • Follow the instructions to get your own Clarifai PAT
  • Protocol Buffers : version 4.24.2 pip install protobuf==4.24.2

Setup:

Install the package and initialize the clarifaipyspark class to begin.

pip install clarifai-pyspark

Getting Started:

from clarifaipyspark.client import ClarifaiPySpark

Create a Clarifai-PySpark client object to connect to your app on Clarifai. You can also choose the dataset or create one in your clarifai app to upload the data.

claps_obj = ClarifaiPySpark(user_id=USER_ID, app_id=APP_ID, pat=CLARIFAI_PAT)
dataset_obj = claps_obj.dataset(dataset_id=DATASET_ID)

Examples:

Checkout these notebooks for various operations you can perform using clarifai-pyspark SDK.

Notebook Description GitHub
ClarifaiPyspark_Example_NB An extensive notebook which walks through the journey from data ingestion to exporting annotations GitHub
export_to_df_demo Explains the process of exporting annotations from clarifai app and storing it as dataframe in databricks GitHub

If you want to enhance your AI journey with workflows and leveraging custom models (programmatically) our Clarifai SDK might be good place to start with. Please refer below resources for further references.

Download files

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

Source Distribution

clarifai-pyspark-0.0.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

clarifai_pyspark-0.0.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file clarifai-pyspark-0.0.3.tar.gz.

File metadata

  • Download URL: clarifai-pyspark-0.0.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for clarifai-pyspark-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b84d19918a7b9bcfe7824552becf5f90c399331cdf5c460d0fe39df3d5506fab
MD5 6332addaaea0cf8a15dc05917de6b39d
BLAKE2b-256 2414bb47494d049f87e93eebdbd2b38df9acf5d9599413be6fa8601caa7c2e86

See more details on using hashes here.

File details

Details for the file clarifai_pyspark-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for clarifai_pyspark-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 62f86e0bb844dcd678a608e285b9d956ec874e7ae80963685c1fa2653e49b4d6
MD5 db0aefbf31df051869e0fd26967533c9
BLAKE2b-256 1db982ea16437a8151b77713fcc3222d7866a4636117c1e804e76ea788560b38

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 Sentry Error logging StatusPage Status page