import data_handle.DataProcessing
import AttBiLSTM_FK
import AttHBiLSTM_FK
import EAttBiLSTM_FK
import SAttBiLSTM_FK
import ESAttBiLSTM_FK
import EAttHBiLSTM_FK
import CNN_FK
import CRNN_FK
import RCNN_FK

if(__name__ == "__main__"):
    batchSize = 331
    numClasses = 2
    numDimensions = 200
    keepratio_cnn_ = 0.5
    input_keep_prob_ = 0.5
    output_keep_prob_ = 0.5
    cross_multiple = 5
    epoch = 60

    wordModel = data_handle.DataProcessing.DataProcessing('D:/SemEval2019-Task6/workspace/wordModel/glove.twitter.27B.200d.txt',
                                                          'D:/SemEval2019-Task6/workspace/data/train/offenseval-training-v1.tsv',
                                                          'D:/SemEval2019-Task6/workspace/wordModel/emoji2vec200.txt',
                                                          'D:/SemEval2019-Task6/workspace/wordModel/SwearWord2vec.txt',
                                                          numDimensions, eab=2, sab=False)
    # wordModel = data_handle.DataProcessing.DataProcessing('/home/yjzhang_xu/workspace/WordVecModel/dataset/glove.twitter.27B.200d.txt',
    #                                                       '/home/yjzhang_xu/workspace/SE2019T6WS/data/train/offenseval-training-v1.tsv',
    #                                                       '/home/yjzhang_xu/workspace/WordVecModel/dataset/emoji2vec200.txt',
    #                                                       '/home/yjzhang_xu/workspace/WordVecModel/dataset/SwearWord2vec.txt',
    #                                                       numDimensions, eab=2, sab=False)

    # EAttBiLSTM_FK.EAttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, 0, epoch)
    # with open("../trained_model/log_eattbilstm.txt", "a", encoding="utf-8") as f:
    #     f.write("\r\n")
    #     f.close()
    # EAttBiLSTM_FK.EAttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, 4, epoch)
    # with open("../trained_model/log_eattbilstm.txt", "a", encoding="utf-8") as f:
    #     f.write("\r\n")
    #     f.close()

    for i in range(cross_multiple):
        # AttBiLSTM_FK.AttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_attbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # AttHBiLSTM_FK.AttHBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_atthbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # EAttBiLSTM_FK.EAttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_eattbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # SAttBiLSTM_FK.SAttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_sattbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # ESAttBiLSTM_FK.ESAttBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_esattbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # EAttHBiLSTM_FK.EAttHBiLSTMRun(wordModel, numClasses, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_eatthbilstm.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        # CRNN_FK.CRNNRun(wordModel, batchSize, numClasses, numDimensions, keepratio_cnn_, input_keep_prob_, output_keep_prob_, i, epoch)
        # with open("../trained_model/log_crnn.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
        CNN_FK.CNNRun(wordModel, batchSize, numClasses, numDimensions, keepratio_cnn_, i, epoch)
        with open("../trained_model/log_cnn.txt", "a", encoding="utf-8") as f:
            f.write("\r\n")
            f.close()
        # RCNN_FK.RCNNRun(wordModel, batchSize, numClasses, input_keep_prob_, output_keep_prob_, keepratio_cnn_, i, epoch)
        # with open("../trained_model/log_rcnn.txt", "a", encoding="utf-8") as f:
        #     f.write("\r\n")
        #     f.close()
