PHPackages                             dog729/laravel-sklearnbot - 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. dog729/laravel-sklearnbot

ActiveLibrary

dog729/laravel-sklearnbot
=========================

laravel sklern bot

221PHP

Since Aug 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DOG729/laravel-sklearnbot)[ Packagist](https://packagist.org/packages/dog729/laravel-sklearnbot)[ RSS](/packages/dog729-laravel-sklearnbot/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LaravelSklearnBot
=================

[](#laravelsklearnbot)

LaravelSklearnBot is a Laravel package that allows you to parse data, create and train models, and use them to generate responses to requests.

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

[](#installation)

1. Install the required dependencies:

```
pip install flask scikit-learn python-dotenv

```

2. Add `LaravelSklearnBot` to your `composer.json` and run the following command:

```
composer require dog729/laravel-sklearnbot

```

Usage
-----

[](#usage)

### Example Method Calls

[](#example-method-calls)

To use the package, invoke the following methods from the `SklearnbotFacade`:

1. **Parse data with training**:

    ```
    \LaravelSklearnBot\SklearnbotFacade::parserHelpBotModel();
    ```
2. **Retrain the model from scratch**:

    ```
    \LaravelSklearnBot\SklearnbotFacade::trainModelFromScratch();
    ```
3. **Get a response from the model based on a query**:

    ```
    $result = \LaravelSklearnBot\SklearnbotFacade::getHelpBotResponse('hi');
    print_r($result);
    ```
4. **Fine-tune the model**:

    ```
    \LaravelSklearnBot\SklearnbotFacade::fineTuneModelHelpBot([
        [
            'id' => 8, 'type' => 'sw', 'title' => 'Darth Vader', 'text' => 'Anakin pam pam',
        ]
    ]);

    $result = \LaravelSklearnBot\SklearnbotFacade::getHelpBotResponse('Darth Vader');
    print_r($result); // Returns: Array ( [action] => Array ( ) [id] => 8 [text] => Anakin pam pam [type] => sw )
    ```

### Console Commands

[](#console-commands)

1. **Create a helpbot model handler file**:

    ```
    php artisan make:helpbotmodel {name}

    ```
2. **Install the package and generate necessary files**:

    ```
    php artisan helpbot:install

    ```

    This command will install the package, generate a token, and create the `helpbot.py` file.

### Configuration

[](#configuration)

The configuration file `config/sklearnbot.php` contains the following parameters:

```
return [
    /**
     * Logic for the operation of submodules
     */
    'helpbot' => 'python',
    'python' => [
        'run' => 'app.py',
         /**
         * host:port for the running Flask application
         */
        'helpbot_token' => ENV('HELPBOT_TOKEN'),
        'helpbot_host' => ENV('HELPBOT_FLASK_HOST',"127.0.0.1"),
        'helpbot_port' => ENV('HELPBOT_FLASK_PORT',"5729"),
        /**
         * The name of the model files
         */
        'helpbot_model' => 'helpbot',
        'helpbot_model_addtraining' => true, //auto further training of the model
        'helpbot_pkl' => ENV('HELPBOT_PKL','model.pkl'), //model helpbot
        'helpbot_output_pkl' => ENV('HELPBOT_OUTPUT_PKL','output.pkl'), //model helpbot database
    ],
];
```

### Running and Testing

[](#running-and-testing)

Examples for testing with `curl`:

1. **Create a model**:

    ```
    curl -X POST http://127.0.0.1:5729/create-model -H "Content-Type: application/json" -H "Authorization: your-secure-token"

    ```
2. **Reload the model**:

    ```
    curl -X POST http://127.0.0.1:5729/reload-model -H "Content-Type: application/json" -H "Authorization: your-secure-token"

    ```
3. **Fine-tune the model**:

    ```
    curl -X POST http://127.0.0.1:5729/fine-tune-model -H "Content-Type: application/json" -H "Authorization: your-secure-token" -d '[{"id":"3","title":"boba","text":"aboba"}]'

    ```
4. **Get a response**:

    ```
    curl -X POST http://127.0.0.1:5729/get-response -H "Content-Type: application/json" -d '{"text":"boba"}'

    ```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity17

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a24de560975c1d9ab16e479ed9e1d74f7998283484f2d5548811878ffbea254c?d=identicon)[DOG729](/maintainers/DOG729)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dog729-laravel-sklearnbot/health.svg)

```
[![Health](https://phpackages.com/badges/dog729-laravel-sklearnbot/health.svg)](https://phpackages.com/packages/dog729-laravel-sklearnbot)
```

PHPackages © 2026

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