Pay only for what you use

prose ships two trained English models: a part-of-speech tagger (~3 MB) and an entity recognizer (~4 MB). Each lives in its own package, so the Go linker leaves out whatever you do not import.

Importing the root package links both. If you only need tags, import the tagger directly and the entity model never enters your binary, a 4.5 MB difference:

import "github.com/jdkato/prose/v3/tag"

tagger, err := tag.New()
if err != nil {
    log.Fatal(err)
}

for _, tok := range tagger.Tag([]string{"Kubernetes", "orchestrates", "containers"}) {
    fmt.Println(tok.Text, tok.Tag)
}

The same applies to languages: each one’s tagger and segmenter is its own package, between 0.6 and 1.8 MB, linked only when imported.

Models load once per process and are shared, so building many documents does not repeat the work.

Packages

Each component stands alone if you want just that piece:

PackageWhat it does
proseDocument, the whole pipeline
tokenizewords and punctuation
segmentsentences
tagpart-of-speech tags
tag/langtagging models, one package per language
segment/langsegmentation models, one package per language
nernamed entities
tokenthe shared token type
summarizereadability metrics
strcasetitle and sentence case