def load_tag_dict(filename):
    tag_dict = {}
    with open(filename, 'rb') as f:
        code = 0
        for tag in f:
            tag = unicode(tag, 'utf-8').strip()
            if tag:
                tag_dict[tag] = code
                code += 1
    
    return tag_dict
Load a tag dictionary from a file containing one tag
dataset/ETHPy150Open erickrf/nlpnet/nlpnet/reader.py/load_tag_dict