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.4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

pangram_sdk-0.1.4-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pangram_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 2.8 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.4.tar.gz
Algorithm Hash digest
SHA256 d8577ed2b32f8692f367aafeaeb6c839a19002ad29c6a4264dc828e9642a2465
MD5 bc3bb4602d099a451571f885281358bd
BLAKE2b-256 39c0b1a084aa8d594975ba1987e58b3901cddc577ad283b02a77113ecddefe3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pangram_sdk-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4a959196a3da175a3ec695b3f296377d70875badce86320872a7e509209b0006
MD5 f02537f43e0da0708a95d1e743d38499
BLAKE2b-256 bcffc0aa530ac201f95abcda4cecb5a18ba9e2da534891a90642a3d68502a323

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