strukt / owl
AI stuff
dev-master
2024-08-31 15:24 UTC
Requires
- davmixcool/php-sentiment-analyzer: ^1.2
- php-science/textrank: ^1.2
- strukt/commons: dev-master
This package is not auto-updated.
Last update: 2025-01-11 19:11:36 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