Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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)
|