Helem-Gibberish / app.py
menimeni123's picture
latest
5670da9
raw
history blame contribute delete
643 Bytes
import gradio as gr
import joblib
# Load the pipeline (which includes both the vectorizer and the classifier)
pipeline = joblib.load('gibberish_detector_pipeline.joblib')
# Prediction function
def predict(text):
prediction = pipeline.predict([text])[0]
return "Gibberish" if prediction == 1 else "Good English"
# Create a Gradio interface
iface = gr.Interface(fn=predict,
inputs="text",
outputs="text",
title="Gibberish Detector",
description="Enter a string to check if it's gibberish or good English.")
# Launch the interface
iface.launch()