コード例 #1
0
ファイル: prediksi.py プロジェクト: lufias69/mycode
def save_kata ():
    pps.savek()
    
# def prediksi_SVM_list_nopps(x):
#     # new_x = list()
#     # #print("Praproses ->")
#     # for ix, i in enumerate(x):
#     #     new_x.append(pps.praposes(i))
        
#     #     if ix%100==0 and ix != 0:
#     #         print(ix, end=" ")
#     #     else:
#     #         print(".", end="")
#     print("|")
#     print("<<Masuk Proses Prediksi>>")
#     hasil_prediksi_list = SVM.predict(tfidf.transform(x).toarray())
#     dixt = {
#         "prediksi":list(hasil_prediksi_list),
#         "komentar":x
#     }
    # return pd.DataFrame.from_dict(dixt)



# def prediksi_cnb_single(x):
#     return cnb.predict(tfidf_cnb.transform([pps.praposes(x)]).toarray())[0]

# def prediksi_cnb_list(x):
#     new_x = list()
#     #print("Praproses ->")
#     for ix, i in enumerate(x):
#         new_x.append(pps.praposes(i))
        
#         if ix%100==0 and ix != 0:
#             print(ix, end=" ")
#         else:
#             print(".", end="")
#     print("|")
#     print("<<Masuk Proses Prediksi>>")
#     hasil_prediksi_list = cnb.predict(tfidf.transform(new_x).toarray())
#     dixt = {
#         "prediksi":list(hasil_prediksi_list),
#         "komentar":new_x
#     }
#     return pd.DataFrame.from_dict(dixt)

# def prediksi2_single(x):
#     return SVM2.predict(tfidf2.transform([pps.praposes(x)]).toarray())[0]

# def prediksi2_list(x):
#     new_x = list()
#     #print("Praproses ->")
#     for ix, i in enumerate(x):
#         new_x.append(pps.praposes(i))
        
#         if ix%100==0 and ix != 0:
#             print(ix, end=" ")
#         else:
#             print(".", end="")
#     print("|")
#     print("<<Masuk Proses Prediksi>>")
#     hasil_prediksi_list = SVM2.predict(tfidf2.transform(new_x).toarray())
#     dixt = {
#         "prediksi":list(hasil_prediksi_list),
#         "komentar":new_x
#     }
#     return pd.DataFrame.from_dict(dixt)
コード例 #2
0
ファイル: prediksi.py プロジェクト: lufias69/Koding
def save_kata():
    pps.savek()