Example #1
0
def load_markdown_data(filename):
    # type: (Text) -> TrainingData
    """Loads training data stored in markdown data format."""
    from rasa_nlu.utils.md_to_json import MarkdownToJson
    data = MarkdownToJson(filename)
    return TrainingData(data.get_common_examples(),
                        get_entity_synonyms_dict(data.get_entity_synonyms()))
def load_markdown_data(filenames):
    # type: (List[Text]) -> TrainingData
    """Loads training data stored in markdown data format."""
    from rasa_nlu.utils.md_to_json import MarkdownToJson

    common_examples = list()
    known_synonyms = {}
    for filename in filenames:
        data = MarkdownToJson(filename)
        common_examples += data.common_examples
        known_synonyms = get_entity_synonyms_dict(data.entity_synonyms,
                                                  known_synonyms)
    return TrainingData(common_examples, known_synonyms)