Download the PHP package garryrodriguez/php-ai-classifier without Composer
On this page you can find all versions of the php package garryrodriguez/php-ai-classifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download garryrodriguez/php-ai-classifier
More information about garryrodriguez/php-ai-classifier
Files in garryrodriguez/php-ai-classifier
Download garryrodriguez/php-ai-classifier
More information about garryrodriguez/php-ai-classifier
Files in garryrodriguez/php-ai-classifier
Vendor garryrodriguez
Package php-ai-classifier
Short Description Native PHP text classification library
License MIT
Package php-ai-classifier
Short Description Native PHP text classification library
License MIT
Please rate this library. Is it a good library?
Informations about the package php-ai-classifier
PHP AI Classifier
A lightweight, native PHP text classification library. Categorize support tickets, blog posts, or user feedback instantly without needing expensive external APIs like OpenAI or Python microservices.
Features
- 100% Native PHP: No dependencies, no Python, no C++ extensions.
- Fast & Private: All data stays on your server. Zero latency.
- Easy Integration: Built for Composer and modern PSR-4 standards.
- Naive Bayes Logic: Uses probability-based classification for reliable sorting.
Usage Example
use garryRodriguez\PhpAiClassifier\Classifier;
$ai = new Classifier();
// 1. Train the AI
$ai->train('billing', 'I need my invoice for last month');
$ai->train('billing', 'Where is my receipt?');
$ai->train('support', 'The app is crashing on my iPhone');
$ai->train('support', 'I cannot log in to my account');
// 2. Predict categories
$category = $ai->predict('Can you send me my bill?');
echo $category; // Outputs: billing
******
$ai = new Classifier();
// Only train if we don't have a saved model yet
if (!file_exists('my_model.json')) {
$ai->train('billing', 'I need my invoice');
$ai->saveModel('my_model.json');
} else {
$ai->loadModel('my_model.json');
}
echo $ai->predict('Where is my bill?');
Installation
Install the package via Composer:
zsh composer require garryrodriguez/php-ai-classifier
All versions of php-ai-classifier with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
The package garryrodriguez/php-ai-classifier contains the following files
Loading the files please wait ...