Spaces:
Sleeping
Sleeping
import streamlit as st | |
def extract_text(text): | |
# Extract the first 100 characters | |
extracted_text = text[:100] | |
return extracted_text | |
# Streamlit UI | |
st.title('Text Extraction App') | |
# Text input | |
user_input = st.text_area('Enter your text here:', '') | |
# Button to trigger extraction | |
if st.button('Extract Text'): | |
if user_input: | |
extracted_text = extract_text(user_input) | |
st.write('Extracted Text:') | |
st.write(extracted_text) | |
else: | |
st.warning('Please enter some text before extracting.') | |