Spaces:
Runtime error
Runtime error
Al John Lexter Lozano
Initial commit-make model as importable module and add simple gradio interface
ead2dcb
#!/usr/bin/python | |
import pickle | |
import gib_detect_train | |
model_data = pickle.load(open('gib_model.pki', 'rb')) | |
def detect(text): | |
model_mat = model_data['mat'] | |
threshold = model_data['thresh'] | |
return gib_detect_train.avg_transition_prob(text, model_mat) > threshold | |