specless.automaton.mps.postprocess_MPS
- specless.automaton.mps.postprocess_MPS(mps_symbols: Iterable[int], mps_prob: float, viable_strings: List[Tuple[float, Tuple[Iterable[Hashable], Iterable[float]]]], idx_to_symbol: Callable, use_BMPS_exact: bool, allow_empty_symbol: bool, backwards_search: bool) Tuple[Iterable[Hashable], float, List[Tuple[float, Tuple[Iterable[Hashable], Iterable[float]]]]] [source]
Post-processes the results from both MPS routines.
- Parameters:
mps_symbols – The symbols for the MPS
mps_prob – The probability of the MPS
viable_strings – Max heap containing all “viable” MPS candididates
idx_to_symbol – The mapping from symbol index to symbol
use_BMPS_exact – whether to use BMPS_exact
allow_empty_symbol – Indicates if the empty symbol is allowed to be considered the MPS
backwards_search – Whether to search from the with final probability back to the start state. Often will improve performance.
- Returns:
most probable string, probability of producing the most probable string, num_strings_to_find (their probs., viable strings) ranked by each string’s probability