Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified els parser to use 'author' abstract as default #124

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions adsingestp/parsers/elsevier.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,19 @@ def _parse_title_abstract(self):
for abs in abs_all:
if abs.get("class", None) == "author":
abs_text_all = abs.find_all("ce:simple-para")
break
elif abs.find("ce:section-title"):
if abs.find("ce:section-title").get_text().lower() == "abstract":
abs_text_all = abs.find_all("ce:simple-para")
break
elif abs.find("ce:section-title").get_text().lower() == "highlights":
abs_text_all = abs.find_all("p")

abstract = ""
for abs_text in abs_text_all:
abstract = (
abstract
+ " "
+ self._detag(abs_text, self.HTML_TAGSET["abstract"]).strip()
)

if abstract:
self.base_metadata["abstract"] = abstract
break
abstract = ""
for abs_text in abs_text_all:
abstract = (
abstract + " " + self._detag(abs_text, self.HTML_TAGSET["abstract"]).strip()
)

if abstract:
self.base_metadata["abstract"] = self._clean_output(abstract)
Expand Down
Loading
Loading