PHPackages                             medansoftware/naive-bayes-text-classification - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. medansoftware/naive-bayes-text-classification

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

medansoftware/naive-bayes-text-classification
=============================================

1.0.0(4y ago)223MITPHPPHP &gt;=5.6.0

Since May 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/medansoftware/naive-bayes-text-classification)[ Packagist](https://packagist.org/packages/medansoftware/naive-bayes-text-classification)[ RSS](/packages/medansoftware-naive-bayes-text-classification/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Naive Bayes - Text Classification | PHP Algorithm
=================================================

[](#naive-bayes---text-classification--php-algorithm)

Installation
------------

[](#installation)

Through [Composer](https://getcomposer.org)
-------------------------------------------

[](#through-composer)

```
composer require medansoftware/naive-bayes-text-classification
```

Standalone File
---------------

[](#standalone-file)

You can download standalone file [here](https://github.com/medansoftware/naive-bayes-text-classification/releases/download/1.0.0/standalone.zip)

Usage
-----

[](#usage)

```
require ('vendor/autoload.php');

$data = array(
	array(
		'text' => 'Hello, Good morning',
		'class' => 'greeting'
	),
	array(
		'text' => 'Hello, Good afternoon',
		'class' => 'greeting'
	),
	array(
		'text' => 'Hello, Good night',
		'class' => 'greeting'
	),
	array(
		'text' => 'How are you?',
		'class' => 'about-me'
	),
	array(
		'text' => 'How old are you?',
		'class' => 'about-me'
	),
	array(
		'text' => 'Where are you',
		'class' => 'about-me'
	),
	array(
		'text' => 'What\'s the time now?',
		'class' => 'information-time'
	),
	array(
		'text' => 'What\'s day today?',
		'class' => 'information-time'
	),
	array(
		'text' => 'What\'s day today?',
		'class' => 'information-time'
	)
);

$naive_bayes = new Algorithm\Naive_Bayes\Text_Classification;

$naive_bayes->training($data);

echo $naive_bayes->predict('Hello sir What\'s time now'); // information-time
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

1463d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24e8e95a612ecb77482b7ba9f36439d1edcb2509205a84cc0f71b53fad2eeaca?d=identicon)[agoenks29D](/maintainers/agoenks29D)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/medansoftware-naive-bayes-text-classification/health.svg)

```
[![Health](https://phpackages.com/badges/medansoftware-naive-bayes-text-classification/health.svg)](https://phpackages.com/packages/medansoftware-naive-bayes-text-classification)
```

###  Alternatives

[mottie/tablesorter

tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.

2.6k223.5k](/packages/mottie-tablesorter)[amasty/module-mage-248-fix

Fix several issues on Magento 2.4.8 version by Amasty

11138.7k](/packages/amasty-module-mage-248-fix)

PHPackages © 2026

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