jeffreyvanrossum/contextr-for-laravel

contextr for laravel

dev-main 2025-03-16 22:10 UTC

This package is auto-updated.

Last update: 2025-03-16 22:10:59 UTC


README

contextr logo

contextr

Total Downloads Latest Stable Version License

AI-driven text analysis for spam, sentiment, moderation, and more.

Installation

You can install the package via composer:

composer require jeffreyvanrossum/contextr-for-laravel

You can publish the config file with:

php artisan vendor:publish --tag="contextr-config"

Usage

Contextr::spam()
    ->text('Buy cheap viagra now!!! Click here: shady.link')
    ->context([
        'topic' => 'Health Forum Discussion',
        'user_history' => 'First time poster'
    ])
    ->withReasoning()
    ->analyze();

$check->data();         // full result array
$check->spam();         // true (boolean)
$check->confidence();   // 0.95 (float)
$check->reasoning();    // "Contains promotional content and suspicious link"

For more examples, see:

https://github.com/jeffreyvr/contextr?tab=readme-ov-file#examples

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.