Team Ai
Apppublic

afroz14/AuthentiCheck

sourceHugging Facemitupdated 4y agoView on Hugging Face
0likes
app.py28 linesDownload Raw Back to root
1import os2import gradio as gr3from transformers import pipeline4 5auth_token = os.environ.get("access_token")6pipeline_en = pipeline(task="text-classification", model="afroz14/demomodel")7 8 9def predict_en(text):10    res = pipeline_en(text)[0]11    return res['label'],res['score']12 13 14 15with gr.Blocks() as demo:16    with gr.Tab("English"):17        gr.Markdown("""18                    Note: Providing more text to the `Text` box can make the prediction more accurate!19                    """)20        t1 = gr.Textbox(lines=5, label='Text',value="There are a few things that can help protect your credit card information from being misused when you give it to a restaurant or any other business:\n\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored. This means that the information is transformed into a code that is difficult for anyone to read without the right key.")21        button1 = gr.Button("๐Ÿค– Predict!")22        label1 = gr.Textbox(lines=1, label='Predicted Label ๐ŸŽƒ')23        score1 = gr.Textbox(lines=1, label='Prob')24 25    button1.click(predict_en, inputs=[t1], outputs=[label1,score1])26 27 28demo.launch()