Skip to main content

Module semantic

Module semantic 

Source
Expand description

Semantic coordinate encoding — Tantivy TF-IDF bridge.

Replaces the SHA-256 hash-based Coordinate5D::encode() with semantically meaningful coordinates derived from anchor-based term frequency analysis.

Three semantic axes (ported from v2’s anchor embedding + PCA concept):

  • x: Logic ↔ Emotion
  • y: Micro ↔ Macro
  • z: Time ↔ Space

For each axis, two poles of anchor terms are defined. The encoder tokenizes the input text using Tantivy’s SimpleTokenizer + LowerCaser (consistent with the search index), computes term frequencies, and projects to [0, 1] per axis using a smoothed ratio of pole scores.

Structs§

SemanticEncoder
Semantic encoder using Tantivy tokenization and anchor-based TF projection.
SemanticScores
Semantic scores for the three content-derived axes.