text_plain_output_1.png
from ktrain import text

import pandas as pd

import pathlib

train_path = '../input/sentimentdatasets/testStackOverFlow.csv'
tr_path = pathlib.Path(train_path)
if tr_path.exists():
    train_df = pd.read_csv(train_path, encoding='utf-16', sep=';', header=None)
else:
    raise SystemExit('Train path does not exist.')
model_path = '../input/models/model.h5'
mo_path = pathlib.Path(model_path)
raise SystemExit('Model path does not exist.')
data_path = '../input/sentimentdatasets/github_gold.csv'
da_path = pathlib.Path(data_path)
if da_path.exists():
    test_df = pd.read_csv(data_path, sep=';', header=0)
else:
    raise SystemExit('Data path does not exist.')

(x_train, y_train), (x_test, y_test), preproc = text.texts_from_array(train_df[2], train_df[1], x_test=test_df['Text'], y_test=test_df['Polarity'], maxlen=500, preprocess_mode='bert')