Skip to main content

No project description provided

Project description

Pangram Labs Python Package

Installation

pip install pangram-sdk

Add your API key

Either export it as a variable.

export PANGRAM_API_KEY=<your API key>

Or pass it in to the constructor:

my_api_key = ''  # Fill this in with your API key.
classifier = PangramText(api_key=my_api_key)

Make a request

from pangram import PangramText

classifier = PangramText()
result = classifier.predict(text)
# Score in range [0, 1] where 0 is human-written and 1 is AI-generated.
score = result['ai_likelihood']

Make a batch request

from pangram import PangramText

text_batch = ["abc", "def"]

classifier = PangramText()
results = classifier.batch_predict(text_batch)
for result in results:
    text = result['text']
    score = result['ai_likelihood']

Questions? Email me at max@pangramlabs.com!

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

pangram_sdk-0.1.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

pangram_sdk-0.1.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pangram_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: pangram_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pangram_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5945e3a4375752073d12d68ee8cc0bebbb8c07159378be409a9adf15f7411ce8
MD5 0d0dce1a5500a816c71fa68ae99322be
BLAKE2b-256 915b2266f4a7006572ca4cecc34b29b96a70ffadab8d0531b69cdd61531a47e4

See more details on using hashes here.

File details

Details for the file pangram_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pangram_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pangram_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 790db4e5eeaa39125cd5745bcb17135b68750398b05e19feae52e2f8dcc0184d
MD5 a2693cc6dee70ab7e3978021d72ae83d
BLAKE2b-256 bb7b32c0c4112e53578763157c1917ec687e1e5984ea437089454458c62b698a

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