Skip to main content

A python module that utilizes AI to classify natural language into categories for processing with other models.

Project description

Classy

How to use

Install:

pip install Classy-AI

Setup: Only do this if you plan to run the model locally

import Classy
Classy.download()

Downloads "data.pth" to your working directory.

Usage (Complete version for a server):

import Classy
Classy.init('/path/to/data.pth','OpenAI api key')
primary, secondary, stemmed, organized = Classy.server("hello, how are you?")

Usage (Just the classifier)

import Classy
intent, certainty = Classy.classify("hello, how are you?",'/path/to/data.pth')

API

Usage

import Classy
intent, certainty = Classy.classify_api("hello, how are you?")

Go to http://app.chat314.com/api to learn about how to use the api yourself.

Other tools

GPT:

Classy.chat_gpt(input,model,api_key)
DALL-E:
Classy.dall_e(input,model,size,api_key)
Search:
Classy.search(input,model,api_key)
Personal:
Classy.personal(input)

Example:

import Classy
api_key='sk-proj-api-key'
while True:
    var=input(': ')
    output,prob= Classy.classify_api(var)
    final=''
    secondary=''
    if output == 'GPT' and prob >= 0.7:
        final=Classy.chat_gpt(var,"gpt-4o-mini",api_key)
    elif output == 'Dall-e' and prob >= 0.7:
        final=Classy.dall_e(var,"dall-e-3","1024x1024",api_key)
    elif output == 'Search' and prob >= 0.7:
        final=Classy.search(var,"gpt-4o-mini",api_key)
    elif output == 'Personal' and prob >= 0.7:
        final,secondary,x,y=Classy.personal(var)
    print(final)
    if secondary:
        print(secondary)

I need more training data

Open a pull request if you have some and put it in unorganized data. I will format it. If you have organized data, put it directly in the intents.json file.

An easy way to contribute is by scrolling through your ChatGPT conversations/Google searches/DALL-E inputs and pasting some of your own data into the unformatted data file.

Deployed here:

https://chat314.com

Uses models gpt-4o-mini and dall-e-3.

I can add a custom password for you on the website if you add training data. Message me at 123scoring@gmail.com. Put in the description of the pull request that you want a custom password for your Openai key.

Thanks

Thanks to Patrick Loeber for teaching me PyTorch

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

classy_ai-0.0.15.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

classy_ai-0.0.15-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file classy_ai-0.0.15.tar.gz.

File metadata

  • Download URL: classy_ai-0.0.15.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for classy_ai-0.0.15.tar.gz
Algorithm Hash digest
SHA256 da48081546585c0ba7c1e76bf287c88885290ad10b6834c458749646ff0faf09
MD5 6b241a8154622266af2672517551319f
BLAKE2b-256 6580a6f008db49d64e85e1171fbe380624b96798aa11ee17a7364292aeb81a04

See more details on using hashes here.

File details

Details for the file classy_ai-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: classy_ai-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for classy_ai-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 98a76c54bd51cdc6f1947974954ba31c686e5a5f08f469cb1a72a2f0e77c4eeb
MD5 a3e0aaf436df73a922db95b8d8d34773
BLAKE2b-256 bb935f1df996fb894baaa5a580c50aa37d3cd04f6b9350ae3ae550d633a0e960

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