Skip to main content

Module concept_graph

Module concept_graph 

Source
Expand description

§Concept Graph Builder

A semantic concept graph that extracts concepts from text, builds weighted relationships, and enables concept-based navigation and similarity search.

The graph supports:

  • Automatic concept extraction via tokenization
  • Co-occurrence-based edge weighting
  • Explicit semantic relation tagging (synonym, hierarchical, antonym, related)
  • BFS shortest-path computation
  • Embedding-based or graph-topology-based similarity search
  • Pruning by frequency and edge weight

Structs§

CgConcept
A node in the concept graph.
CgConceptEdge
A directed (but treated as undirected for traversal) weighted edge.
CgGraphConfig
Build-time configuration.
ConceptGraphBuilder
Builds and queries a semantic concept graph.
ConceptGraphStats
Snapshot statistics about the concept graph.
ConceptId
Opaque concept index newtype.

Enums§

CgConceptRelation
Semantic relation between two concepts.

Functions§

cosine_similarity
Cosine similarity between two equal-length vectors.
tokenize
Split text on whitespace and ASCII punctuation; lowercase; keep tokens with at least 3 characters.