Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,10 @@ import io
|
|
6 |
from ocr_utils import extract_text
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
9 |
# Streamlit app layout
|
10 |
st.title("OCR Text Extraction from Images")
|
11 |
|
@@ -29,8 +33,6 @@ if uploaded_file is not None:
|
|
29 |
keyword = st.text_input("Enter Keyword to Search")
|
30 |
# Display highlighted content if a keyword is entered
|
31 |
|
32 |
-
|
33 |
-
|
34 |
if keyword:
|
35 |
if keyword in full_text:
|
36 |
highlighted_text = full_text.replace(
|
@@ -42,4 +44,4 @@ if uploaded_file is not None:
|
|
42 |
st.write(f"The keyword '{keyword}' was not found in the text.")
|
43 |
else:
|
44 |
st.subheader("Highlighted Search Results")
|
45 |
-
st.write("No keyword entered for highlighting.")
|
|
|
6 |
from ocr_utils import extract_text
|
7 |
|
8 |
|
9 |
+
|
10 |
+
from ocr_utils import extract_text
|
11 |
+
# from ocr_utils import highlight_content
|
12 |
+
|
13 |
# Streamlit app layout
|
14 |
st.title("OCR Text Extraction from Images")
|
15 |
|
|
|
33 |
keyword = st.text_input("Enter Keyword to Search")
|
34 |
# Display highlighted content if a keyword is entered
|
35 |
|
|
|
|
|
36 |
if keyword:
|
37 |
if keyword in full_text:
|
38 |
highlighted_text = full_text.replace(
|
|
|
44 |
st.write(f"The keyword '{keyword}' was not found in the text.")
|
45 |
else:
|
46 |
st.subheader("Highlighted Search Results")
|
47 |
+
st.write("No keyword entered for highlighting.")
|