Spaces:
Sleeping
Sleeping
| ''' | |
| Phase 2 Graded Challenge 1 | |
| Nama : Achmad Dhani | |
| Batch : HCK-009 | |
| Objective : Creating a page for emotion classification | |
| ''' | |
| from functions import get_wordnet_pos, preprocess_text, prediction | |
| import streamlit as st | |
| import pandas as pd | |
| import joblib | |
| from PIL import Image | |
| def run(): | |
| ''' | |
| This function is for running the page for predictions | |
| ''' | |
| st.title('What are you feeling right now ?') | |
| user_input = st.text_input(label='Enter some text', | |
| value='default text', | |
| max_chars=50, | |
| key='text_input_key', | |
| type='default', | |
| help='Try not to think, and let your heart speak', | |
| autocomplete=None, | |
| on_change=None, | |
| args=None, | |
| kwargs=None, | |
| placeholder='Please Type here...', | |
| disabled=False, | |
| label_visibility='visible') | |
| st.write('You entered:', user_input) | |
| # button | |
| if st.button(label='Predict'): | |
| X= preprocess_text(user_input) | |
| prediction([X]) | |