adil9858 commited on
Commit
5a602c3
1 Parent(s): 5ed4822

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
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()