Skip to content

Commit

Permalink
Only call extractor pipeline if the input queue has data, closes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Mar 29, 2023
1 parent 6fc00a4 commit e9a3320
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/python/paperai/report/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ def calculate(self, uid, metadata):
fields[name] = ""

# Add extraction fields
for name, value in self.extractor(extractions, texts):
# Resolves the full value based on column parameters
fields[name] = (
self.resolve(params, sections, uid, name, value) if value else ""
)
if extractions:
for name, value in self.extractor(extractions, texts):
# Resolves the full value based on column parameters
fields[name] = (
self.resolve(params, sections, uid, name, value) if value else ""
)

# Add question fields
names, qa, contexts, snippets = [], [], [], []
Expand Down

0 comments on commit e9a3320

Please sign in to comment.