HasSemanticModel()
Upgrades text similarity from lexical bag-of-words to true MEANING via a runtime neural model (load one process-wide with StzNeuralModelQ(path)). With no model loaded these degrade gracefully to the lexical path, so code keeps working and auto-improves once a model is present. TRUE if a runtime embedding model is loaded and ready.
also written: IsSemanticModelReady
Basic examples (1)
o = new stzText("The cat sits on the mat")
# no model loaded here
? o.HasSemanticModel()
# Embedding() is empty without a model
? len(o.Embedding())
# SemanticSimilarityWith falls back to a lexical score in [-1,1]
? o.SemanticSimilarityWith("A kitten rests on the rug") >= 0
# identical text is maximally similar (lexical)
? o.SemanticSimilarityWith("The cat sits on the mat") > 0.99
# a non-string comparand is rejected
? o.SemanticSimilarityWith(123)
# IsSemanticallySimilarTo respects the threshold
? o.IsSemanticallySimilarTo("The cat sits on the mat", 0.5)0 0 1 1 0 1
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from text_query_layer_narrated.ring(opens in a new tab)
The extensions of this method
Each extension, and whether it exists for this method; an extension that exists combines with the others (FindSTCS).
Every example is a test file of the library, run inside the library for this page; only those whose output kept every promise their file wrote are shown.
See also
- The class stzText
- The area's reference: NLP & linguistics
- The other methods in these examples: stzText.Embedding · stzText.IsSemanticallySimilarTo · stzText.SemanticSimilarityWith

