gibberish_detector / gib_detect_module.py
Al John Lexter Lozano
Initial commit-make model as importable module and add simple gradio interface
ead2dcb
raw
history blame contribute delete
279 Bytes
#!/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