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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Classy-AI-0.0.12.tar.gz.
File metadata
- Download URL: Classy-AI-0.0.12.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c37f2ac04503458c914e9b0beab9227f88706b8b23556ae80a13c44ea2803b7c
|
|
| MD5 |
eb8a6bda3e8d1399463826c676fa6a5d
|
|
| BLAKE2b-256 |
efbf0bacb0f5ae8fbc8ecd4addf366fdcecdbea33ebb0ddeb36536632456512c
|
File details
Details for the file Classy_AI-0.0.12-py3-none-any.whl.
File metadata
- Download URL: Classy_AI-0.0.12-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a035e9c0930ae66a69cebb8780ab7e3b01ad1230dc3c890a7414693e72829221
|
|
| MD5 |
7190c763767a9701e48c6a3cdcbfcb3a
|
|
| BLAKE2b-256 |
6823541f37f0e1905878c15aea8b954f053cec03461bbaa1205510e5a67eec3b
|