UniquePratham commited on
Commit
5217ecf
·
verified ·
1 Parent(s): 9919fac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- from ocr_cpu import extract_text_got, clean_text # Import OCR and text cleaning functions
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 to remove extra spaces
50
- cleaned_text = clean_text(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)}")
 
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)}")