Spaces:
Runtime error
Runtime error
# Hint: this cheatsheet is magic! https://cheat-sheet.streamlit.app/ | |
import streamlit as st | |
import pandas as pd | |
from franco_arabic_transliterator.franco_arabic_transliterator import FrancoArabicTransliterator | |
def load_model(): | |
return FrancoArabicTransliterator() | |
transliterator = load_model() | |
sent = st.text_input( | |
"Franco Arabic (Arabizi) Sentence:", placeholder="Enter an Arabizi sentence.", on_change=None | |
) | |
# TODO: Check if this is needed! | |
clicked = st.button("Submit") | |
if sent: | |
lexicon_transliteration = transliterator.transliterate(sent, method="lexicon") | |
lm_transliteration = transliterator.transliterate(sent, method="language-model") | |
df = pd.DataFrame( | |
{"method": ["Lexicon", "Language Model"], | |
"transliteration": [lexicon_transliteration, lm_transliteration]}) | |
st.table( | |
df, | |
) | |
print(sent) | |