Spaces:
Running
Running
robertselvam
commited on
Commit
•
7d6ad3d
1
Parent(s):
95a7d16
Update contract_missing_clausses.py
Browse files
contract_missing_clausses.py
CHANGED
@@ -77,12 +77,13 @@ class ContractMissingClauses:
|
|
77 |
|
78 |
# Initialize pdfplumber
|
79 |
pdf = pdfplumber.open(pdf_file.name)
|
80 |
-
|
|
|
81 |
# Iterate through each page and extract text
|
82 |
for page in pdf.pages:
|
83 |
contract = page.extract_text()
|
84 |
-
self.get_missing_clauses(contract)
|
85 |
-
|
86 |
except Exception as e:
|
87 |
# If an error occurs during the key-value extraction process, log the error
|
88 |
LOGGER.error(f"Error occurred while extracting pdf page: {str(e)}")
|
|
|
77 |
|
78 |
# Initialize pdfplumber
|
79 |
pdf = pdfplumber.open(pdf_file.name)
|
80 |
+
|
81 |
+
result = ''
|
82 |
# Iterate through each page and extract text
|
83 |
for page in pdf.pages:
|
84 |
contract = page.extract_text()
|
85 |
+
result += self.get_missing_clauses(contract)
|
86 |
+
return result
|
87 |
except Exception as e:
|
88 |
# If an error occurs during the key-value extraction process, log the error
|
89 |
LOGGER.error(f"Error occurred while extracting pdf page: {str(e)}")
|