Featured Posts
Huement - Blog & News Aggregator
Latest Article
The power of TransformersPHP - Annihilate tasks and problems that once would have destroyed you
At its core, TransformersPHP is crazy simple simple.simple.simple. Its a high-level pipeline() function that handles everything: downloading the model, preprocessing your input, running inference, and post-processing the output. One or two lines of code, and you're done.
Here's a quick example for sentiment analysis. By Sentiment analysis btw, I mean is this a happy or sad string of text. That’s a simple question to ask, but much more complicated to answer. Before having an AI toolkit to answer that, it would have been a lot more than 2 simple lines. So lets see how we are doing that today.
use function Codewithkyrian\Transformers\Pipelines\pipeline;
$pipe = pipeline('sentiment-analysis');
$result = $pipe("I love TransformersPHP!");
// Returns: ['label' => 'POSITIVE', 'score' => 0.9998...]
Now pay close attention, because that is incredibly modular. You can swap in any compatible model, like a multilingual one or a quantized version for speed, and do WAAAY more than setting a boolean isHappy. TransformersPHP supports tons of tasks: text classification (I. E. From this list of categories where does this belong?, translation, summarization, question answering, zero-shot classification (aka making categories from nothing), text generation (yes, even small Llama models), image-to-text, object detection, and more.
Now, the cool part—what's under the hood? TransformersPHP doesn't reinvent the wheel. It runs models in the ONNX format (Open Neural Network Exchange), a universal standard that works no matter if the model was originally trained in PyTorch, TensorFlow, or JAX.
Inference happens through ONNX Runtime, a blazing-fast engine optimized for CPU and hardware acceleration. The PHP side connects to it using the PHP FFI extension (Foreign Function Interfa...
TrendForge Preview
TrendForge is an upcoming intelligence suite designed to isolate market trends and dictate strategic execution. It deploys native widgets for ecosystems like WordPress alongside a live dashboard monitoring real-time market signals, semantic clustering, and advanced sentiment analysis. Sign up for early access.
