import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
import logging
from victorinox import victorinox
import pickle
from sklearn.svm import SVC
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
import numpy as np
import time
from scipy import spatial
import math
import os
from sklearn.linear_model import SGDClassifier
from sklearn.calibration import CalibratedClassifierCV
import heapq
from sklearn.neighbors import KNeighborsClassifier
from sklearn import metrics



#enable logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)

class MyIter(object):
    path=""
    def __init__(self,fp):
        self.path=fp

    def __iter__(self):
        # path = datapath(self.path)
        with open(self.path, 'r', encoding='utf-8') as fin:
            for line in fin:
               yield line

tool=victorinox()



datapath_staffs=r"data/dataset_lower_clean_stem_group_staffs.csv"
datapath_sentences=r"data/dataset_lower_clean_stem_group_staffs_sentences.csv"
tfidf_vectors=r"data/tfidf_group_vectors.csv"
tfidf_model=r"data/tfidf_group_model.pkl"
knn_model=r"data/knn_group_model.pkl"
csvsummary=r"data/dataset_lower_clean_stem_staff_group_with_periods_summary.csv"



# corpus=MyIter(datapath_sentences)
# vectorizer = CountVectorizer(decode_error="replace")
# vec_train = vectorizer.fit_transform(corpus)
# pickle.dump(vectorizer.vocabulary_,open(tfidf_model,"wb"))
# print("tfidf model saved to %s"%tfidf_model)
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# print("tfidf model loaded from %s"%tfidf_model)
# df=pd.read_csv(datapath_staffs,sep=";")
# dfpegawai=df.ID_PEGAWAI
# res=[]
# with open(datapath_sentences,"r") as f:
#     lines=f.read().splitlines()
#     for x in range(len(lines)):
#         vec=transformer.fit_transform(loaded_vec.fit_transform(np.array([lines[x]]))).toarray()[0].tolist()#tfidf_model.transform([lines[x]]).toarray()[0].tolist()
#         id=[dfpegawai.iloc[x]]
#         res.append(vec+id)
# dfres=pd.DataFrame(res)
# dfres.to_csv(tfidf_vectors,sep=";",index=None,header=None)
# print("tfidf vectors saved to %s"%tfidf_vectors)


# tfidf_model=r"data/tfidf_group_model.pkl"
# tfidf_vectors=r"data/tfidf_group_vectors.csv"
# datapath_staffs=r"data/dataset_lower_clean_stem_group_staffs.csv"
# sentence0="komitmen layan kendali gratifikasi sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang upacara bendera ingat hari ulang tahun 74 merdeka republik indonesia tahun 2019 tanggal 17 agustus 2019 laksana cuti tahun hari libur nasional dan cuti sama hari raya natal tahun 2019 sampai tetap unit kerja predikat wbk tahun 2019 tingkat menteri uang selenggara rapat kerja raker rapat koordinasi rakor bina mental asn integritas sampai instruksi menteri uang nomor 595 imk 01 2019 tanggal 29 juli 2019 selenggara rapat kerja raker rapat koordinasi rakor mohon dukung video converence keikutsertaan pegawai kptik bmn giat pmo informal meeting tahun 2019 himbauan laksana wajib masuk kerja taat jam kerja lingkung sekretariat jenderal menteri uang himbauan laksana wajib masuk kerja taat jam kerja lingkung sekretariat jenderal menteri uang kuesioner minat beasiswa kumpul berkas ppkpns dp3 lingkung pusintek se tentu tega disiplin atas langgar tentu jam kerja langkah langkah strategis laksana anggar lingkup unit eselon i sekretariat jenderal menteri uang ta 2020 himbauan kait sampai lapor harta kaya pajak pajak pribadi lalu alpha se tentu tega disiplin atas langgar tentu jam kerja upacara bendera rangka ingat hari sumpah pemuda hari oeang republik indonesia 73 tahun 2019 disposisi sekretaris jenderal sampai arah presiden menteri kabinet indonesia maju sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang sampai surat edar menteri uang laksana pelihara data sumber daya manusia hris seluruh pegawai lingkung menteri uang sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang surat tugas latih bppk pekan 3 bulan september 2019 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 imbau laksana isi lapor harta kaya lhk lapor pajak pajak pribadi lp2p lalu alpha tawar seleksi sesuai inpassing jabat fungsional pranata uang anggar dapat belanja negara apbn imbau laksana isi lapor harta kaya lhk lapor pajak pajak pribadi lp2p lalu alpha monitoring evaluasi efektivitas organisasi lingkung menteri uang"
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# df=pd.read_csv(datapath_staffs,sep=";")
# sentence_ori=df.iloc[0,1]
# veccorpus0=[0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.2775396528207745,0.10674602031568248,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.10674602031568248,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0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136495,0.0,0.0,0.06404761218940949,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.04269840812627299,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.10674602031568248,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.17079363250509197,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.10674602031568248,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.40563487719959346,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.021349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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.17079363250509197,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.04269840812627299,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0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0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08539681625254598,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.10674602031568248,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.06404761218940949,0.0,0.0,0.19214283656822848,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.1494444284419555,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.021349204063136496,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04269840812627299,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0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form(np.array([sentence_ori]))).toarray()[0].tolist()
# vec=transformer.fit_transform(loaded_vec.fit_transform(np.array([sentence0]))).toarray()[0].tolist()
# print(vec_ori==vec)
# print(vec_ori==vec==veccorpus0)



# tfidf_vectors=r"data/tfidf_group_vectors.csv"
# svc_model=r"data/svc_model.pkl"
# df=pd.read_csv(tfidf_vectors,sep=";")
# print('Training classifier')
# model = SVC(kernel='linear', probability=True)
# X=df.iloc[:,:-1]
# y=df.iloc[:,-1]
# model.fit(X, y)
# with open(svc_model, 'wb') as outfile:
#     pickle.dump((model, y), outfile)
# print('Saved classifier model to file "%s"' %svc_model)


# svc_model=r"data/svc_model.pkl"
# tfidf_model=r"data/tfidf_group_model.pkl"
# tfidf_vectors=r"data/tfidf_group_vectors.csv"
# datapath_staffs=r"data/dataset_lower_clean_stem_group_staffs.csv"
# sentence0="komitmen layan kendali gratifikasi sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang upacara bendera ingat hari ulang tahun 74 merdeka republik indonesia tahun 2019 tanggal 17 agustus 2019 laksana cuti tahun hari libur nasional dan cuti sama hari raya natal tahun 2019 sampai tetap unit kerja predikat wbk tahun 2019 tingkat menteri uang selenggara rapat kerja raker rapat koordinasi rakor bina mental asn integritas sampai instruksi menteri uang nomor 595 imk 01 2019 tanggal 29 juli 2019 selenggara rapat kerja raker rapat koordinasi rakor mohon dukung video converence keikutsertaan pegawai kptik bmn giat pmo informal meeting tahun 2019 himbauan laksana wajib masuk kerja taat jam kerja lingkung sekretariat jenderal menteri uang himbauan laksana wajib masuk kerja taat jam kerja lingkung sekretariat jenderal menteri uang kuesioner minat beasiswa kumpul berkas ppkpns dp3 lingkung pusintek se tentu tega disiplin atas langgar tentu jam kerja langkah langkah strategis laksana anggar lingkup unit eselon i sekretariat jenderal menteri uang ta 2020 himbauan kait sampai lapor harta kaya pajak pajak pribadi lalu alpha se tentu tega disiplin atas langgar tentu jam kerja upacara bendera rangka ingat hari sumpah pemuda hari oeang republik indonesia 73 tahun 2019 disposisi sekretaris jenderal sampai arah presiden menteri kabinet indonesia maju sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang sampai surat edar menteri uang laksana pelihara data sumber daya manusia hris seluruh pegawai lingkung menteri uang sampai salin surat edar menteri uang laksana pelihara data sumber daya manusia human resources information system seluruh pegawai lingkung menteri uang surat tugas latih bppk pekan 3 bulan september 2019 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 tindak lanjut hasil one on one meeting kait najam anggar menteri uang ta 2019 ta 2020 imbau laksana isi lapor harta kaya lhk lapor pajak pajak pribadi lp2p lalu alpha tawar seleksi sesuai inpassing jabat fungsional pranata uang anggar dapat belanja negara apbn imbau laksana isi lapor harta kaya lhk lapor pajak pajak pribadi lp2p lalu alpha monitoring evaluasi efektivitas organisasi lingkung menteri uang"
# sentence1="sql server"
# print('Testing classifier')
# with open(svc_model, 'rb') as infile:
#     (model, class_names) = pickle.load(infile)
# print('Loaded classifier model from file "%s"' % svc_model)
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# vec=transformer.fit_transform(loaded_vec.fit_transform([sentence0])).toarray()[0].tolist()
# dim=len(loaded_vec.vocabulary)
# vec=np.array(vec).reshape(-1, dim)
# predictions = model.predict_proba(vec)
# pred = model.predict(vec)
# best_class_indices = np.argmax(predictions, axis=1)
# best_class_probabilities = predictions[np.arange(len(best_class_indices)), best_class_indices]
# print("pred:%s"%str(pred))
# print("prediction:%s"%str(predictions))
# print("best_class_indices:%s"%str(best_class_indices))
# print("best_class_probabilities:%s"%str(best_class_probabilities))
# print("employee:%s"%str(class_names[best_class_indices[0]]))



# df=pd.read_csv(tfidf_vectors,sep=";",header=None)
# q="application software level 1 symfoni php framework knowledge update tools itsm sipelantik knowledge update itsm awareness latih data services knowledge update tools itsm sipelantik knowledge update itsm awareness latih data services seminar enterprise architecture cross platform mobile development with xamarin scrum project management workshop syncfusion framework workshop tata kelola tik bas cobit 5 international public service forum 2018 workshop mas atur presiden nomor 16 tahun 2018 ada barang jasa perintah training administrasi manajemen sdm latih uji nasional sertifikasi ahli ada barang jasa perintah"
# q2="application software level 1 symfoni php framework knowledge update tools itsm sipelantik knowledge update itsm awareness latih data services knowledge update tools itsm sipelantik knowledge update itsm awareness latih data services seminar enterprise architecture cross platform mobile development with xamarin scrum project management workshop syncfusion framework workshop tata kelola tik BERbasis cobit 5 international public service forum 2018 workshop mas PERaturAN presiden nomor 16 tahun 2018 PENGadaAN barang jasa pEMerintahAN training administrasi manajemen sdm PElatihAN ujiAN nasional sertifikasi ahli PENGadaAN barang jasa pEMerintahAN "
# q3="oracle"
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# t1=time.time()
# qv=transformer.fit_transform(loaded_vec.fit_transform(np.array([q2]))).toarray()[0].tolist()
# scores=[]
# for idx,row in df.iterrows():
#     v=row[:-1].tolist()
#     score=1 - spatial.distance.cosine(qv,v)
#     scores.append(score)
# print(scores)
# top5=heapq.nlargest(5, range(len(scores)), scores.__getitem__)
# res=df.iloc[top5,-1]
# elapsed=time.time()-t1
# print(res)
# print([scores[x] for x in top5])
# print("elapsed:%f"%elapsed)
# print("########################################")
# print("train KNN")
# t1=time.time()
# knn = KNeighborsClassifier(n_neighbors=len(df))
# knn.fit(df.iloc[:,:-1], df.iloc[:,-1])
# print("train KNN DONE in %f"%(time.time()-t1))
# with open(knn_model,"wb") as f:
#     pickle.dump(knn,f)



# with open(knn_model,"rb") as f:
#     knn_saved=pickle.load(f)
# q3=tool.preprocess_sentence(q3)
# qv=transformer.fit_transform(loaded_vec.fit_transform([q3])).toarray()[0].tolist()
# (distances, indices)=knn_saved.kneighbors([qv],n_neighbors=5)
# indices=indices.tolist()[0]
# res=df.iloc[indices,-1]
# print(res.tolist())
# print(distances.tolist())





#########################################################################################################

# datapath_all=r"data/dataset_lower_clean_stem.csv"
# datapath_staffs=r"data/dataset_lower_clean_stem_staff.csv"
# datapath_staff_sentences=r"data/dataset_lower_clean_stem_staff_sentences.csv"
# tfidf_vectors=r"data/tfidf_per_sentence_vectors.csv"
# tfidf_model=r"data/tfidf_per_sentence_model.pkl"
# leader_csv=r"data/leaders.csv"
# svc_model=r"data/svc_per_sentence_model.pkl"
# dataset_vector=r"data/tfidf_per_sentence_vectors.csv"
# dataset_vector_nip=r"data/tfidf_per_sentence_vectors_nip.csv"
# dataset_vector_idseq=r"data/tfidf_per_sentence_vectors_idseq.csv"
# staff_dictionary=r"data/staff_dictionary.pkl"
# staff_dictionary_by_sequence=r"data/staff_dictionary_by_sequence.pkl"
# staff_dictionary_by_sequence_reveresed=r"data/staff_dictionary_by_sequence_reversed.pkl"
# with open(leader_csv,"r") as f:
#     leaders=f.read().splitlines()
# df=pd.read_csv(datapath_all,sep=";")
# X=[]
# y=[]
# for idx,row in df.iterrows():
#     id=row["ID_PEGAWAI"]
#     nip=str(id).split("_")[0]
#     if nip in leaders:
#         continue
#     else:
#         y.append(id)
#         X.append(row["KOMPETENSI"])
# dct_staff={"KOMPETENSI":X,"ID_PEGAWAI":y}
# dct_staff_sentences={"KOMPETENSI":X}
# df_staff=pd.DataFrame(dct_staff)
# df_staff.to_csv(datapath_staffs,sep=";",index=None)
# print("saved %d records to %s"%(len(df_staff),datapath_staffs))
# df_staff_sentences=pd.DataFrame(dct_staff_sentences)
# df_staff_sentences.to_csv(datapath_staff_sentences,sep=";",index=None,header=None)
# print("saved %d sentences to %s"%(len(df_staff_sentences),datapath_staff_sentences))

# corpus=MyIter(datapath_staff_sentences)
# vectorizer = CountVectorizer(decode_error="replace")
# vec_train = vectorizer.fit_transform(corpus)
# pickle.dump(vectorizer.vocabulary_,open(tfidf_model,"wb"))
# print("tfidf model saved to %s"%tfidf_model)
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# print("tfidf model loaded from %s"%tfidf_model)
# df=pd.read_csv(datapath_staffs,sep=";")
# dfpegawai=df.ID_PEGAWAI
# dfcompetence=df.KOMPETENSI
# total=len(dfcompetence)
# res=[]
# batchsize=20000
# it=0
# with open(tfidf_vectors,"a+") as f:
#     for line in corpus:#dfcompetence[it:it+batchsize]:
#         vec=transformer.fit_transform(loaded_vec.fit_transform([line])).toarray()[0].tolist()#tfidf_model.transform([lines[x]]).toarray()[0].tolist()
#         id=[dfpegawai.iloc[it]]
#         l=vec + id
#         f.write(";".join([str(x) for x in l]))
#         f.write("\n")
#         print('\r%d/%d'%(it,total), end="", flush=True)
#         it+=1
#
#


#
#
#
#
#

# with open(staff_dictionary_by_sequence,"rb") as f:
#     kamus=pickle.load(f)
# ids=[int(k) for k,v in kamus.items()]
# corpus=MyIter(dataset_vector_idseq)
# print('Training classifier')
# #model = SVC(kernel='linear', probability=True)
# clf = SGDClassifier()
# batchsize=5000
# i=0
# X=[]
# y=[]
# #y_all=[]
# for line in corpus:
#     if i%batchsize==0:
#         if i!=0:
#             clf.partial_fit(X, y, classes=ids)
#             print('\r partial train on batch %d' % (math.floor(i/batchsize)), end="", flush=True)
#         X=[]
#         y=[]
#     else:
#         parts=line.split(";")
#         vec=parts[0:-1]
#         id=parts[-1].replace("\n","")
#         X.append(vec)
#         y.append(int(id))
#         #y_all.append(id)
#     i+=1
# clf.partial_fit(X, y, classes=ids)
# print('\r partial train on batch %d' % (math.floor(i/batchsize)), end="", flush=True)
# with open(svc_model, 'wb') as outfile:
#     pickle.dump(clf, outfile)
# print('Saved classifier model to file "%s"' %svc_model)
#
#
#
#
#
# sentence0="sampai surat edar menteri uang nomor se 29 mk 1 2019 lapor dialog kerja individu periode i tahun 2020 lingkung menteri uang"
# with open(staff_dictionary_by_sequence,"rb") as f:
#     kamus=pickle.load(f)
# sentence1="sql server"
# print('Testing classifier')
# with open(svc_model, 'rb') as infile:
#     model = pickle.load(infile)
# print('Loaded classifier model from file "%s"' % svc_model)
# transformer = TfidfTransformer()
# loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
# vec=transformer.fit_transform(loaded_vec.fit_transform([sentence0])).toarray()[0].tolist()
# dim=len(loaded_vec.vocabulary)
# vec=np.array(vec).reshape(-1, dim)
# # predictions = model.predict_proba(vec)
# pred = model.predict(vec)
# # best_class_indices = np.argmax(predictions, axis=1)
# # best_class_probabilities = predictions[np.arange(len(best_class_indices)), best_class_indices]
# print("pred:%s"%str(kamus[pred[0]]))
# # print("prediction:%s"%str(predictions))
# # print("best_class_indices:%s"%str(best_class_indices))
# # print("best_class_probabilities:%s"%str(best_class_probabilities))


#####################################################################################


transformer = TfidfTransformer()
loaded_vec = CountVectorizer(decode_error="replace",vocabulary=pickle.load(open(tfidf_model, "rb")))
with open(knn_model,"rb") as f:
    knn_saved=pickle.load(f)
testcorpus=MyIter(csvsummary)
ytrue=[]
ypred=[]
truecount=0
for line in testcorpus:
    parts=line.split(";")
    id=parts[0]
    ytrue.append(id)
    X=parts[1].replace("."," ")
    # q3=tool.preprocess_sentence(q3)
    qv=transformer.fit_transform(loaded_vec.fit_transform([X])).toarray()[0].tolist()
    y_pred=knn_saved.predict([qv])
    ypred.append(y_pred)
    is_true=id==y_pred[0]
    if is_true:
        truecount+=1
    print("%r, accuracy:%f"%((is_true),truecount/411))

print(metrics.accuracy_score(ytrue,ypred))





