Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pickle | |
| from text_preprocessor import TextPreprocessor | |
| # Load the pickle model | |
| with open('text_preprocessor_model.pkl', 'rb') as f: | |
| preprocessor = pickle.load(f) | |
| # Streamlit app | |
| st.title('Text Preprocessing App') | |
| # Text input from user | |
| text = st.text_area('Enter text to preprocess:', '') | |
| if st.button('Preprocess Text'): | |
| if text: | |
| # Preprocess the input text | |
| cleaned_text = preprocessor.preprocess(text) | |
| st.write('Preprocessed Text: \n \t', cleaned_text) | |
| else: | |
| st.write('Please enter some text.') | |