# Path: tag.py
# IDENT = {u'ADV': 0,
#          u'NOUN': 1,
#          u'ADP': 2,
#          u'PRON': 3,
#          u'DET': 4,
#          u'.': 5,
#          u'PRT': 6,
#          u'VERB': 7,
#          u'X': 8,
#          u'NUM': 9,
#          u'CONJ': 10,
#          u'ADJ': 11}


import os
import pickle
import theano
import theano.tensor as T
import numpy as np
import logging
from collections import OrderedDict
from tag import IDENT

if __name__ == "__main__":
    logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
                        level=logging.DEBUG)
    # Load the OCT27 test dataset
    with open('Data/TweeboOct27.pkl', 'r') as fp:
        data = pickle.load(fp)

    # Find the maximum word-length
    wl = max([len(t.word) for t in data])

    # Specify embedding depth
    d = 26

    # Specify context size
    csize = 6

    # Build the number of distinct letters in the set
    dictionary = {}
    for t in data:
        for c in t.word:
            if c not in dictionary:
                dictionary[c] = len(dictionary)+1

    # +1 for the "unknown character" (0)
    num_chars = len(dictionary) + 1

    # Create the thing
    net = RNN(
        nh = 100, # hidden units

# Path: tag.py
# IDENT = {u'ADV': 0,
#          u'NOUN': 1,
#          u'ADP': 2,
#          u'PRON': 3,
#          u'DET': 4,
#          u'.': 5,
#          u'PRT': 6,
#          u'VERB': 7,
#          u'X': 8,
#          u'NUM': 9,
#          u'CONJ': 10,
#          u'ADJ': 11}


# Path: train.py
import os
import pickle
import theano
import theano.tensor as T
import numpy as np
import logging
from collections import OrderedDict
from tag import IDENT


if __name__ == "__main__":
    logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
                        level=logging.DEBUG)
    # Load the OCT27 test dataset
    with open('Data/TweeboOct27.pkl', 'r') as fp:
        data = pickle.load(fp)

    # Find the maximum word-length
    wl = max([len(t.word) for t in data])

    # Specify embedding depth
    d = 26

    # Specify context size
    csize = 6

    # Build the number of distinct letters in the set
    dictionary = {}
    for t in data:
        for c in t.word:
            if c not in dictionary:
                dictionary[c] = len(dictionary)+1

    # +1 for the "unknown character" (0)
    num_chars = len(dictionary) + 1

    # Create the thing
    net = RNN(
        nh = 100, # hidden units

        nc = len(IDENT), # class count