UniquePratham commited on
Commit
7da5361
Β·
verified Β·
1 Parent(s): 55c903d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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"Correct and clean the following text: '{cleaned_text}' and make it meaningful."
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 meaningful sentence pedantic, you remove extra spaces in between words and word to make the sentence meaningful in English/Hindi/Hinglish according to the sentence."
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.title("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
 
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