Spaces:
Runtime error
Runtime error
| import streamlit as st #Web App | |
| from main import classify | |
| #title | |
| st.title("Easy OCR - Extract Text from Images") | |
| #subtitle | |
| st.markdown("## Optical Character Recognition - Using `easyocr`, `streamlit` - hosted on 🤗 Spaces") | |
| input_sentences = st.text_area("Sentences", value="", height=200) | |
| data = input_sentences.split('\n') | |
| #if st.button("Classify"): | |
| for i in data: | |
| j = classify(i)[0] | |
| sentiment = j['label'] == 'POS' | |
| confidence = j['score'] | |
| st.write(f"{i} :: Classification - {'positive' if sentiment else 'negative'} with confidence {confidence}") | |
| st.markdown("Link to the app - [image-to-text-app on 🤗 Spaces](https://huggingface.co/spaces/Amrrs/image-to-text-app)") | |