# Path: lxmls/data.py
# def find(filename):


from lxmls import data
import readers.pos_corpus as pcc
import sequences.extended_feature as exfc
import sequences.structured_perceptron as spc
        'government',
        'hobbies',
        'humor',
        'learned',
        'lore',
        'mystery',
        'news',
        'religion',
        'reviews',
        'romance',
        'science_fiction']
    for cat in categories:
        brown_seq = corpus.read_sequence_list_brown(categories=cat)
        brown_pred = model.viterbi_decode_corpus_log(brown_seq.seq_list)
        brown_eval = model.evaluate_corpus(brown_seq.seq_list, brown_pred)
        print("Accuracy on Brown cat %s: %f" % (cat, brown_eval))


def load_model():
    corpus = pcc.PostagCorpus()
    corpus.load_corpus(MODEL_DIR)
    features = exfc.ExtendedFeatures(corpus)
    features.load_features(MODEL_DIR + "features.txt", corpus)
    model = spc.StructuredPercetron(corpus, features)
    model.load_model(MODEL_DIR)
    return corpus, features, model


def main():
    print("Building corpus")

# Path: lxmls/data.py
# def find(filename):


# Path: lxmls/pos_tagging/train_pos_tag.py
from lxmls import data
import readers.pos_corpus as pcc
import sequences.extended_feature as exfc
import sequences.structured_perceptron as spc

        'government',
        'hobbies',
        'humor',
        'learned',
        'lore',
        'mystery',
        'news',
        'religion',
        'reviews',
        'romance',
        'science_fiction']
    for cat in categories:
        brown_seq = corpus.read_sequence_list_brown(categories=cat)
        brown_pred = model.viterbi_decode_corpus_log(brown_seq.seq_list)
        brown_eval = model.evaluate_corpus(brown_seq.seq_list, brown_pred)
        print("Accuracy on Brown cat %s: %f" % (cat, brown_eval))


def load_model():
    corpus = pcc.PostagCorpus()
    corpus.load_corpus(MODEL_DIR)
    features = exfc.ExtendedFeatures(corpus)
    features.load_features(MODEL_DIR + "features.txt", corpus)
    model = spc.StructuredPercetron(corpus, features)
    model.load_model(MODEL_DIR)
    return corpus, features, model


def main():
    print("Building corpus")

    corpus, features = build_corpus_features()