Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from ai4bharat.transliteration import XlitEngine
|
3 |
+
|
4 |
+
def main():
|
5 |
+
st.title("English to Kashmiri Transliteration")
|
6 |
+
|
7 |
+
# Create an instance of the transliteration engine
|
8 |
+
e = XlitEngine(src_script_type="en", beam_width=10, rescore=False)
|
9 |
+
|
10 |
+
# Get user input
|
11 |
+
user_input = st.text_input("Enter the sentence in English:")
|
12 |
+
|
13 |
+
# Perform transliteration when the user submits input
|
14 |
+
if user_input:
|
15 |
+
out = e.translit_sentence(user_input, lang_code="ks")
|
16 |
+
st.write("Transliterated Output (Kashmiri):", out)
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
main()
|