PHPackages                             permafrost-dev/text-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. permafrost-dev/text-classifier

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

permafrost-dev/text-classifier
==============================

Assigns input text a category based on a training model

1.2.0(4y ago)215MITPHPPHP ^7.3|^8.0CI failing

Since May 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/permafrost-dev/text-classifier)[ Packagist](https://packagist.org/packages/permafrost-dev/text-classifier)[ RSS](/packages/permafrost-dev-text-classifier/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

text-classifier
===============

[](#text-classifier)

Performs basic text classification using algorithms such as Naive-Bayes.

---

##### Installation:

[](#installation)

You may install text-classifier using composer:

> `composer require permafrost-dev/text-classifier`

Note: The higher-quality and more complete training data used to train the model, the more accurate the classifications will be.

---

#### Example - Email Address Classification

[](#example---email-address-classification)

A common use-case for classifying text is to determine whether or not an email is spam or not spam. While that's beyond the scope of this example, we can try to determine if a given email address is spam or not spam based on its features. *Note: all email addresses used for training/examples were randomly generated. If your email address somehow ended up within the sample data, please contact  and it will be promptly removed.*

```
