Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

CarterMcClellan/supercontrast-legacy

Repository files navigation

supercontrast

supercontrast is a package for easily running machine learning models from a variety of providers in a unified interface. We're adding more tasks and providers all the time, and would love help from the community to add more!

We currently support the following Tasks:

  • OCR
  • Sentiment Analysis
  • Transcription
  • Translation
  • ...and more!

From some of the most popular Providers:

  • AWS
  • Azure
  • GCP
  • OpenAI
  • Anthropic
  • ...and more!

If you want the full list of supported tasks and providers, please reference our docs.

Installation

pip

pip install supercontrast

conda

conda env create -f environment.yml

Additional Requirements

Python Version

supercontrast is supported on Python 3.12 (other versions may be unstable)

PDF Processing

If you are processing pdfs, you will need to install poppler. We recommend using conda to install it:

conda install -c conda-forge poppler

Usage

from supercontrast import (
    Provider,
    SentimentAnalysisRequest,
    SuperContrastClient,
    Task,
)

# Sending a Sentiment Analysis Request to AWS
client = SuperContrastClient(task=Task.SENTIMENT_ANALYSIS, providers=[Provider.AWS])
input_text = "I love programming in Python!"
response, metadata = client.request(SentimentAnalysisRequest(text=input_text))

For more examples of how to use supercontrast, refer to examples.py in the examples folder.

Contributing

We welcome contributions to the project! To contribute, please follow these steps:

1. Clone the repo

git clone https://github.com/supercontrast/supercontrast.git

2. Install package in editable mode

pip install -e .

3. Run linting

black .
isort .

4. Run tests

pytest -k <test_name>

5. Submit a PR

Submit a PR to the main branch! We will review and merge your PR.

About

Find the best ML model for your use case | Y Combinator Fall 2024

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages