Skip to main content

Crate megahal_keywords

Crate megahal_keywords 

Source
Expand description

MegaHAL keyword extraction: two-pass algorithm with swap table, banned/auxiliary word lists.

Keywords drive MegaHAL’s reply generation by biasing the Markov walk toward topically relevant symbols. Extraction works in two passes:

  1. Primary: select words from input (after swap substitution) that are in the model dictionary, start with an alphanumeric character, and are neither banned nor auxiliary.
  2. Auxiliary: if at least one primary keyword was found, also add words from the auxiliary list (pronouns, possessives) that appear in input.

Structs§

KeywordConfig
Configuration for keyword extraction.
SwapTable
Perspective-swapping substitution table.

Functions§

extract_keywords
Extract keywords from tokenized input per the MegaHAL two-pass algorithm.
word_in_dict
Check if a given string exists in the model dictionary.