PRIYANSHUDHAKED commited on
Commit
f826efc
·
verified ·
1 Parent(s): 43984b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -21,7 +21,10 @@ def extract_text_with_gemini(image):
21
  Include all visible text, headings, and any important information.
22
  """
23
  response = model.generate_content([prompt, image])
24
- return response.text
 
 
 
25
 
26
  def search_and_highlight(full_text, keyword):
27
  pattern = re.compile(re.escape(keyword), re.IGNORECASE)
 
21
  Include all visible text, headings, and any important information.
22
  """
23
  response = model.generate_content([prompt, image])
24
+ text = response.text
25
+ # Remove HTML tags from the extracted text
26
+ text = re.sub(r'<[^>]+>', '', text)
27
+ return text
28
 
29
  def search_and_highlight(full_text, keyword):
30
  pattern = re.compile(re.escape(keyword), re.IGNORECASE)