File size: 713 Bytes
d1b79e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from transformers import pipeline
import gradio as gr

# Load the model using pipeline
model = pipeline("text2text-generation", model="SuperSl6/Arabic-Text-Correction")

def correct_text(input_text):
    result = model(input_text)[0]['generated_text']
    return result

# Gradio Interface
interface = gr.Interface(
    fn=correct_text,
    inputs=gr.Textbox(lines=3, placeholder="أدخل النص العربي هنا..."),
    outputs=gr.Textbox(),
    live=True,  # Real-time processing
    title="تصحيح النص العربي",
    description="أداة لتصحيح النصوص العربية باستخدام نموذج SuperSl6/Arabic-Text-Correction."
)

# Launch the app
interface.launch(debug=True)