Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
from ocr_cpu import extract_text_got,
|
3 |
import json
|
4 |
|
5 |
# --- UI Styling ---
|
@@ -46,8 +46,8 @@ if uploaded_file is not None:
|
|
46 |
if not extracted_text.strip():
|
47 |
st.warning("No text extracted from the image.")
|
48 |
else:
|
49 |
-
# Clean the extracted text
|
50 |
-
cleaned_text =
|
51 |
st.success("Text extraction and cleaning successful.")
|
52 |
except Exception as e:
|
53 |
st.error(f"Error during text extraction: {str(e)}")
|
|
|
1 |
import streamlit as st
|
2 |
+
from ocr_cpu import extract_text_got, clean_text_with_ai # Import OCR and AI cleaning functions
|
3 |
import json
|
4 |
|
5 |
# --- UI Styling ---
|
|
|
46 |
if not extracted_text.strip():
|
47 |
st.warning("No text extracted from the image.")
|
48 |
else:
|
49 |
+
# Clean the extracted text using AI
|
50 |
+
cleaned_text = clean_text_with_ai(extracted_text)
|
51 |
st.success("Text extraction and cleaning successful.")
|
52 |
except Exception as e:
|
53 |
st.error(f"Error during text extraction: {str(e)}")
|