Op24's picture
Create app.py
54067af
raw
history blame contribute delete
No virus
512 Bytes
import gradio as gr
def score_comment(comment):
vectorized_comment = vectorizer([comment])
results = model.predict(vectorized_comment)
text = ''
for idx, col in enumerate(df.columns[2:]):
text += '{}: {}\n'.format(col, results[0][idx]>0.5)
return text
interface = gr.Interface(fn = score_comment, inputs=gr.Textbox(lines=2, placeholder='Comment to score'), outputs = 'text', title='Comment Toxicity', description='Check comment, how much is it toxic:')
interface.launch(share=True)