PHPackages                             garryrodriguez/php-ai-classifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. garryrodriguez/php-ai-classifier

ActiveLibrary

garryrodriguez/php-ai-classifier
================================

Native PHP text classification library

v0.1.0(3mo ago)03MITPHPPHP &gt;=8.2

Since Jan 31Pushed 3mo agoCompare

[ Source](https://github.com/garryRodriguez/php-ai-classifier)[ Packagist](https://packagist.org/packages/garryrodriguez/php-ai-classifier)[ RSS](/packages/garryrodriguez-php-ai-classifier/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

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
--------

[](#features)

- **100% Native PHP:** No dependencies, no Python, no C++ extensions.
- **Fast &amp; 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
-------------

[](#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
------------

[](#installation)

Install the package via Composer:

```
composer require garryrodriguez/php-ai-classifier

```zsh
composer require garryrodriguez/php-ai-classifier

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

102d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f680ae66884e73e276f5ea5a8f4b66b7995bd6ab46d969aa4072f8058485dcd?d=identicon)[garryRodriguez](/maintainers/garryRodriguez)

---

Top Contributors

[![garryRodriguez](https://avatars.githubusercontent.com/u/33311539?v=4)](https://github.com/garryRodriguez "garryRodriguez (1 commits)")

### Embed Badge

![Health badge](/badges/garryrodriguez-php-ai-classifier/health.svg)

```
[![Health](https://phpackages.com/badges/garryrodriguez-php-ai-classifier/health.svg)](https://phpackages.com/packages/garryrodriguez-php-ai-classifier)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
