strukt/owl

dev-master 2025-04-05 09:00 UTC

This package is not auto-updated.

Last update: 2025-04-19 20:18:25 UTC


README

AI package. Mostly text analysis. More to come...

Usage

Sentiment Analysis: Vader Score

$text = "From Oasis' first ever single to the name of Noel and Liam's long-suffering mother, just how well do YOU know the band? Take MailOnline's ultimate quiz";

probe($text);

Tags: Ranking

// use tags function
tags($text); //get all tags

// get to 10 tags above 0.9 ranking
arr(tags($text))->each(fn($k,$v)=>number($v)->gt(0.9)?$k:null)->filter()->values()->yield()

Summarize

$text = fs()->cat("news.txt");

summary($text);

Highlights

$text = fs()->cat("news.txt");

highlights($text);

Credits

- TextRank https://github.com/davmixcool/php-sentiment-analyzer
- PHP Sentiment Analyzer https://github.com/DavidBelicza/PHP-Science-TextRank