File size: 705 Bytes
3d7c786
d0e28a6
3d7c786
a98aff0
3d7c786
 
 
d0e28a6
 
3d7c786
 
 
d0e28a6
 
5cf785f
d0e28a6
47f3322
d0e28a6
47f3322
 
 
 
d0e28a6
 
3d7c786
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)")