Spaces:
Sleeping
Sleeping
File size: 1,183 Bytes
293544d d2f8330 293544d 498e7f1 bfb596c d2f8330 498e7f1 cd894fd 9539bbe cd894fd 9539bbe bfb596c 293544d bfb596c cccfa43 430b23d f84a1c9 cccfa43 cd894fd cccfa43 cbe3bb1 97c1efd bfb596c 97c1efd bfb596c |
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 29 30 31 32 |
from camel_tools.utils.charmap import CharMapper
import os
import gradio as gr
ar2bw = CharMapper.builtin_mapper('ar2bw')
bw2ar = CharMapper.builtin_mapper('bw2ar')
Secret_token = os.getenv('token')
title = """# Transliterate using Buckwalter Scheme"""
description = """
This app converts transliterated arabic text to Arabic using Buckwalter Scheme. Use the following image to familiarize yourself with the conversion system.
"""
example = [["*hbt <lY Almktbp."]]
def getArabic(transliteration):
return bw2ar(transliteration)
with gr.Blocks() as demo:
gr.Markdown(title)
gr.Markdown(description)
with gr.Row():
gr.Image('https://huggingface.co/spaces/FDSRashid/Camel_tools_Test/resolve/main/Buckwalter-transliteration-for-Arabic-language.jpg', width = 300, height = 900)
with gr.Column():
name = gr.Textbox(label="English Transliteration (Using Buckwalter System )")
output = gr.Textbox(label="Arabic Form of Text")
greet_btn = gr.Button("Get Arabic")
examples = gr.Examples(examples = example, inputs = [name])
greet_btn.click(fn=getArabic, inputs=name, outputs=output)
demo.launch() |