Commit
·
b36fd77
1
Parent(s):
2e38917
Add project files
Browse files- app.py +14 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
tashkel_url = "http://www.7koko.com/api/tashkil/index.php"
|
5 |
+
|
6 |
+
def add_tashkeel(text):
|
7 |
+
data = {"textArabic": text}
|
8 |
+
response = requests.post(tashkel_url, data=data)
|
9 |
+
response.encoding = 'utf-8'
|
10 |
+
text = response.text.strip()
|
11 |
+
return text
|
12 |
+
|
13 |
+
demo = gr.Interface(fn=add_tashkeel, inputs="text", outputs="text")
|
14 |
+
demo.queue().launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
requests
|
2 |
+
gradio
|