def METHOD_NAME(
    training_data: TrainingData,
    use_only_entities: bool = False,
    use_word_boundaries: bool = True,
) -> List[Dict[Text, Text]]:
    r"""Convert the lookup tables from the training data to regex patterns.
    Args:
        training_data: The training data.
        use_only_entities: If True only regex features with a name equal to a entity
          are considered.
        use_word_boundaries: If True add `\b` around the regex expression
          for each lookup table expressions.
    Returns:
        A list of regex patterns.
    """
    patterns = []
    for table in training_data.lookup_tables:
        if use_only_entities and table["name"] not in training_data.entities:
            continue
        regex_pattern = _generate_lookup_regex(table, use_word_boundaries)
        lookup_regex = {"name": table["name"], "pattern": regex_pattern}
        patterns.append(lookup_regex)
    return patterns