Please help me improve my Streamlit code

Hello all,
I created a simple streamlit app that does basic text analysis and I deployed it on huggingface spaces. Please check my code and tell me how I can improve the code.
here is the link to the code:

Thank you.