Spaces:
Runtime error
Runtime error
Increase model threshold and conservativeness
Browse files36 unmodified lines373839404136 unmodified linesdef predict_from_document(sentences):preprop = preprocess(sentences)prediction = model.predict(preprop)output = (prediction.flatten()[: len(sentences)] >= 0.5).astype(int)return output, prediction.flatten()[: len(sentences)]36 unmodified lines37383940414236 unmodified linesdef predict_from_document(sentences):preprop = preprocess(sentences)prediction = model.predict(preprop)# Set the prediction threshold to 0.8output = (prediction.flatten()[: len(sentences)] >= 0.8).astype(int)return output, prediction.flatten()[: len(sentences)]
functions/model_infer.py+2-1