Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,13 +50,13 @@ def clean_extracted_text(text):
|
|
50 |
|
51 |
# Polish the text using a model
|
52 |
def polish_text_with_ai(cleaned_text):
|
53 |
-
prompt = f"
|
54 |
client = Groq(api_key="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")
|
55 |
chat_completion = client.chat.completions.create(
|
56 |
messages=[
|
57 |
{
|
58 |
"role": "system",
|
59 |
-
"content": "You are a
|
60 |
},
|
61 |
{
|
62 |
"role": "user",
|
@@ -96,7 +96,7 @@ def highlight_text(text, search_term):
|
|
96 |
|
97 |
# Title and UI
|
98 |
st.title("DualTextOCRFusion - π")
|
99 |
-
st.
|
100 |
st.write("Upload an image for OCR using various models, with support for English, Hindi, and Hinglish.")
|
101 |
|
102 |
# Sidebar Configuration
|
|
|
50 |
|
51 |
# Polish the text using a model
|
52 |
def polish_text_with_ai(cleaned_text):
|
53 |
+
prompt = f"Remove unwanted spaces between and inside words to join incomplete words, creating a meaningful sentence in either Hindi, English, or Hinglish without altering any words from the given extracted text. Then, return the corrected text with adjusted spaces, keeping it as close to the original as possible, along with relevant details or insights that an AI can provide about the extracted text. Extracted Text : {cleaned_text}"
|
54 |
client = Groq(api_key="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")
|
55 |
chat_completion = client.chat.completions.create(
|
56 |
messages=[
|
57 |
{
|
58 |
"role": "system",
|
59 |
+
"content": "You are a pedantic sentence corrector. Remove extra spaces between and within words to make the sentence meaningful in English, Hindi, or Hinglish, according to the context of the sentence, without changing any words."
|
60 |
},
|
61 |
{
|
62 |
"role": "user",
|
|
|
96 |
|
97 |
# Title and UI
|
98 |
st.title("DualTextOCRFusion - π")
|
99 |
+
st.header("OCR Application - Multimodel Support")
|
100 |
st.write("Upload an image for OCR using various models, with support for English, Hindi, and Hinglish.")
|
101 |
|
102 |
# Sidebar Configuration
|