examples/char-lstm-classification.py
def build_category_lines(all_filenames, all_letters):
    r"""
    Build the category_lines dictionary, a list of names per language
    Returns the dataset dict, list of languages, and number of classes
    """
    category_lines = {}
    all_categories = []

    for filename in all_filenames:
        category = filename.stem
        all_categories.append(category)
        lines = read_lines(filename, all_letters)
        category_lines[category] = lines

    n_categories = len(all_categories)
    return category_lines, all_categories, n_categories
r"""
    Build the category_lines dictionary, a list of names per language
    Returns the dataset dict, list of languages, and number of classes
    
r"""
Build the category_lines dictionary, a list of names per language
Returns the dataset dict, list of languages, and number of classes
r " " " Build the category_lines dictionary a list of names per language Returns the dataset dict list of languages and number of classes
def build_category_lines(all_filenames, all_letters):
    category_lines = {}
    all_categories = []
    for filename in all_filenames:
        category = filename.stem
        all_categories.append(category)
        lines = read_lines(filename, all_letters)
        category_lines[category] = lines
    n_categories = len(all_categories)
    return category_lines, all_categories, n_categories
def build_category_lines ( all_filenames , all_letters ) : category_lines = { } all_categories = [ ] for filename in all_filenames : category = filename . stem all_categories . append ( category ) lines = read_lines ( filename , all_letters ) category_lines [ category ] = lines n_categories = len ( all_categories ) return category_lines , all_categories , n_categories
r"""
Build the category_lines dictionary, a list of names per language
Returns the dataset dict, list of languages, and number of classes
r " " " Build the category_lines dictionary a list of names per language Returns the dataset dict list of languages and number of classes
r"""
    Build the category_lines dictionary, a list of names per language
    Returns the dataset dict, list of languages, and number of classes
    """
all_filenames
all_letters