# Rubix ML - Text Sentiment Analyzer

A worked tutorial that trains a multilayer perceptron neural network in PHP to classify movie review sentiment, using the Rubix ML library and 25,000 labeled IMDB reviews.

This example project walks through building a text sentiment classifier with Rubix ML, a PHP machine learning library, training a multilayer feed-forward neural network on 25,000 IMDB movie reviews labeled positive or negative and testing it on a further 25,000 held-out reviews. It demonstrates turning raw text files into feature vectors as well as the deep learning classifier itself, and is rated as a hard-difficulty, hours-long tutorial.

Installation is through Composer, and training benefits from Rubix ML's optional Tensor extension for faster numeric computation. The walkthrough covers reading labeled text files from folders into arrays before feature extraction and training, with the full code available in the project's train.php file.

It requires PHP 7.4 or newer and at least 16GB of memory.

Website: https://rubixml.github.io/ML
