Spaces:
Build error
Build error
File size: 694 Bytes
99dec5d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import gradio as gr
import pickle
# metin sınıflandırıcıyı ve vektörleştiriciyi ayrı ayrı kaydet
model=pickle.load(open('bnb_tc.pkl','rb'))
vect=pickle.load(open('vect.pkl','rb'))
def predict_spam(review):
#yorumu vektöre dönüştür
vect_text=vect.transform([review])
#tahmin yap
prediction=model.predict(vect_text)
return prediction[0]
# Ara yüz oluştur
interface=gr.Interface(
fn=predict_spam,
inputs=gr.Textbox(lines=2,
placeholder="Enter a review..."),
outputs='text',
title="YouTube Comment Spam Detector",
description="This tool detect whether YouTube comment a spam."
)
interface.launch(
share=True
) |