Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -7,6 +7,8 @@ import fitz
|
|
7 |
from transformers import pipeline
|
8 |
import requests
|
9 |
from typing import List
|
|
|
|
|
10 |
|
11 |
app = FastAPI()
|
12 |
|
@@ -45,7 +47,7 @@ async def perform_document_qa(
|
|
45 |
# Perform document question answering for each question using BERT-based model
|
46 |
answers_dict = {}
|
47 |
for question in question_list:
|
48 |
-
result =
|
49 |
'question': question,
|
50 |
'context': text_content
|
51 |
})
|
|
|
7 |
from transformers import pipeline
|
8 |
import requests
|
9 |
from typing import List
|
10 |
+
from pytesseract import pytesseract
|
11 |
+
|
12 |
|
13 |
app = FastAPI()
|
14 |
|
|
|
47 |
# Perform document question answering for each question using BERT-based model
|
48 |
answers_dict = {}
|
49 |
for question in question_list:
|
50 |
+
result = nlp({
|
51 |
'question': question,
|
52 |
'context': text_content
|
53 |
})
|