Skip to main content

A Python client for interacting with SlashML servicesDeveloped by SlashML.

Project description

SlashML Python client

SlashML

One API for all your machine learning needs.

Installation guide

pip install slashml

Quickstart

Convert text to audio

from slashml import TextToSpeech

# Replace `API_KEY` with your SlasML API token. This example still runs without
# the API token but usage will be limited
model = TextToSpeech(api_key=None)

input_text = "to be or not to be, that is the question!"

# Submit request
job = model.execute(text=input_text, service_provider=TextToSpeech.ServiceProvider.AWS)

print (f"\n\n\n You can access the audio file here: {job.audio_url}")

Transcribe an audio file

from slashml import SpeechToText

# Replace `API_KEY` with your SlasML API token. This example still runs without
# the API token but usage will be limited
model = SpeechToText(api_key=None)

response = model.execute(
    upload_url='https://slashml.s3.ca-central-1.amazonaws.com/695c711f-9f5d-4ff1-ae4f-4439842eef5f', 
    service_provider=SpeechToText.ServiceProvider.WHISPER
)

print(f"\n\n\n\nTranscription = {response.transcription_data.transcription}")

Summarize a text input

from slashml import TextSummarization

model = TextSummarization(api_key=None)

input_text = """A good writer doesn't just think, and then write down what he thought, as a sort of transcript. A good writer will almost always discover new things in the process of writing. And there is, as far as I know, no substitute for this kind of discovery. Talking about your ideas with other people is a good way to develop them. But even after doing this, you'll find you still discover new things when you sit down to write. There is a kind of thinking that can only be done by writing."""

response = model.execute(text=input_text, service_provider=TextSummarization.ServiceProvider.OPENAI)

print(f"Summary = {response.summarization_data}")

View the list of service providers available

from slashml import TextToSpeech

print(TextToSpeech.ServiceProvider.choices())

# you can repeat the same thing for all services 
# print(TextSummarization.ServiceProvider.choices())
# print(SpeechToText.ServiceProvider.choices())

Introduction

Overview

This is the Python client (SDK) for SlashML. It allows users to use the endpoints available and active https://docs.slashml.com.

Set up and usage

There is a daily limit (throttling) on the number of calls the user performs. The code can run without specifying the API key. The throttling kicks in and prevents new jobs after exceeding 10 calls per minute.

If the user intends on using the service more frequently, it is recommended to generate an token or API key from https://www.slashml.com/settings/api-key. You can pass the API key when creating a model, if you don't the api will still work but you will be throttled.

from slashml import TextToSpeech

# Initialize model
text_to_speech = TextToSpeech(api_key="YOUR_API_KEY")

# summarizer = TextSummarization(api_key="YOUR_API_KEY")
# speech_to_text = SpeechToText(api_key="YOUR_API_KEY")

If the user preferes using the API calls directly, the documentation is available here.

Available service providers

Speech-to-text

For transcription, SlashML supports the following service providers:

Summarization

For text summarization, SlashML supports the following service providers:

Text-to-Speech

For speechification, SlashML supports the following service providers:

Documentation

For production ready use cases, look at the examples folder

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

slashml-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

slashml-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file slashml-0.1.0.tar.gz.

File metadata

  • Download URL: slashml-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for slashml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b889b8bde062cc4aeee33626bee2c78b323aaef1945e80c62025a2569051abe
MD5 a9f90bed870659f65e6f3b76e5be00ae
BLAKE2b-256 8e9e18fab81c7c8a4176685b71be6cab4e406b170f7707992753060727785a23

See more details on using hashes here.

File details

Details for the file slashml-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: slashml-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for slashml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06de147b504b5a7152c54c5ed8a5df1389fba189793b8b9582e9212ce2cf0500
MD5 d4c133906aff1f3b2a0125c05c5736b9
BLAKE2b-256 6cc6ce968814f72110d073de2782131ed1a36c8322c4ad452960a7d06bb87923

See more details on using hashes here.

Supported by

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