postgresml
postgresml · Exposes tsvector lexemes and position counts for an experimental naive Bayes text-classification demo.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100493 | postgresml | postgresml | 1.0 | RAG | Unknown | C |
Usage
Sources:
- Official README
- Extension control file
- Installed extension SQL
- Separate naive Bayes demonstration
- Build manifest
postgresml 1.0 is not a general machine-learning platform. The installed extension exposes one helper, ts_lexemes(tsvector), while the repository’s binary naive Bayes spam classifier is a separate demonstration script that is not installed by CREATE EXTENSION.
Core Workflow
ts_lexemes returns one row per lexeme in the input tsvector. Its n field is the number of stored positional entries for that lexeme. It is useful for expanding a text-search vector into relational rows, but positional counts can be absent or altered when a vector was stripped or constructed differently; do not assume n is always the original raw-token frequency.
Demonstration Script Boundary
The README’s test_naive_bayes(0.3) workflow belongs to naive_bayes.sql, not the extension install script listed by the Makefile. That demonstration creates generic tables and functions, expects the tablefunc crosstab facility, uses psql file-loading commands, and expects an external SMS Spam Collection data file that is not present in the pinned repository. It also chooses a random training split, so results are not deterministic.
Review and adapt the demonstration explicitly rather than assuming it appears after extension installation. Use controlled schemas, versioned data, a deterministic split, held-out evaluation, and application-specific privacy and retention controls for any experiment. The C helper accesses PostgreSQL full-text-search internals and the pinned source dates from 2013, so current-major compatibility is not established; compile, test, and verify dump/restore against the exact server major. No preload is required.