Expand description
MegaHAL reply generation: babble, seeding, bidirectional generation, and surprise evaluation.
This crate implements the core MegaHAL reply generation algorithm:
- Seed a starting symbol from the keyword list.
- Run a forward phase from the seed to generate the rest of the sentence.
- Run a backward phase from the seed to generate the beginning.
- Evaluate candidates by surprise scoring.
- Select the highest-scoring candidate.
It implements MegaHAL’s keyword-biased random walk: keywords encountered during the walk are greedily selected, while non-keywords fall back to probability-weighted selection.
Enums§
- Generation
Limit - Controls how many candidate replies are generated before selecting the best.
Functions§
- capitalize
- Capitalize a token sequence per MegaHAL sentence-case rules.
- generate_
reply - Generate the best reply for given input tokens and keywords.