OmidSakaki commited on
Commit
7ea3e69
·
verified ·
1 Parent(s): adbe621

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -16,7 +16,7 @@ class OCRProcessor:
16
 
17
  class PersianQAModel:
18
  def __init__(self):
19
- model_name = "m3hrdadfi/bert2bert-fa-question-answering"
20
  try:
21
  self.qa_pipeline = pipeline(
22
  "question-answering",
@@ -42,9 +42,7 @@ ocr_processor = OCRProcessor()
42
  qa_model = PersianQAModel()
43
 
44
  def pipeline_fn(image, question):
45
- # استخراج متن از تصویر
46
  context = ocr_processor.extract_text(image)
47
- # پاسخ به سوال بر اساس متن
48
  answer = qa_model.answer_question(context, question)
49
  return context, answer
50
 
 
16
 
17
  class PersianQAModel:
18
  def __init__(self):
19
+ model_name = "HooshvareLab/bert-fa-qa"
20
  try:
21
  self.qa_pipeline = pipeline(
22
  "question-answering",
 
42
  qa_model = PersianQAModel()
43
 
44
  def pipeline_fn(image, question):
 
45
  context = ocr_processor.extract_text(image)
 
46
  answer = qa_model.answer_question(context, question)
47
  return context, answer
48