File size: 560 Bytes
9735286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b29c475
9735286
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.secrets['api_key']
        st.write('Extracted Text:')
        st.write(extracted_text)
    else:
        st.warning('Please enter some text before extracting.')