def parse_fn(line_words, line_tags):
    """Encodes words into bytes for tensor

    :param line_words: one line with words (aka sentences) with space between each word/token
    :param line_tags: one line of tags (one tag per word in line_words)
    :return: (list of encoded words, len(words)), list of encoded tags
    """

    words = [w.encode() for w in line_words.strip().split()]
    tags = [t.encode() for t in line_tags.strip().split()]
    assert len(words) == len(tags), "Number of words {} and Number of tags must be the same {}".format(len(words), len(tags))
    return (words, len(words)), tags