wbtools 3.0.4__tar.gz → 3.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wbtools-3.0.4 → wbtools-3.0.6}/PKG-INFO +1 -1
- {wbtools-3.0.4 → wbtools-3.0.6}/setup.py +1 -1
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/paper.py +13 -7
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/PKG-INFO +1 -1
- {wbtools-3.0.4 → wbtools-3.0.6}/LICENSE +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/README.md +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/setup.cfg +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/config_reader.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_afp.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_antibody.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_expression.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_generic.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_email_addresses.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_generic.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_new_variations.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_literature_index.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_scraping.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_text_preprocessing.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_text_similarity.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/test_corpus.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/test_paper.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/abstract_manager.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/afp.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/antibody.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/dbmanager.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/expression.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/gene.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/generic.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/paper.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/person.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/email/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/email/generic.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/common.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/email_addresses.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/ntt_extractor.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/variations.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/abstract_index.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/textpresso.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/text_preprocessing.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/text_similarity.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/scraping.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/timeout.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/corpus.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/person.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/utils/__init__.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/utils/okta_utils.py +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/SOURCES.txt +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/dependency_links.txt +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/requires.txt +0 -0
- {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="wbtools",
|
|
8
|
-
version="3.0.
|
|
8
|
+
version="3.0.6",
|
|
9
9
|
author="Valerio Arnaboldi",
|
|
10
10
|
author_email="valearna@caltech.edu",
|
|
11
11
|
description="Interface to WormBase (www.wormbase.org) curation data, including literature management and NLP "
|
|
@@ -49,13 +49,19 @@ def convert_pdf_to_txt(file_path):
|
|
|
49
49
|
r = process_fulltext_document.sync_detailed(client=client, multipart_data=form)
|
|
50
50
|
if r.is_success:
|
|
51
51
|
article: Article = TEI.parse(r.content, figures=True)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
section.paragraphs[-1][0].text in ['\n', ' ']
|
|
58
|
-
|
|
52
|
+
sentences = []
|
|
53
|
+
for section in article.sections:
|
|
54
|
+
# skip sections that have three paragraph with the first and the last being empty. These are
|
|
55
|
+
# usually references
|
|
56
|
+
if (len(section.paragraphs) == 3 and section.paragraphs[0][0].text in ['\n', ' ']
|
|
57
|
+
and section.paragraphs[-1][0].text in ['\n', ' ']):
|
|
58
|
+
continue
|
|
59
|
+
# add section titles as sentences
|
|
60
|
+
if section.name:
|
|
61
|
+
sentences.append(section.name)
|
|
62
|
+
for paragraph in section.paragraphs:
|
|
63
|
+
for sentence in paragraph:
|
|
64
|
+
sentences.append(re.sub('<[^<]+>', '', sentence.text))
|
|
59
65
|
else:
|
|
60
66
|
return []
|
|
61
67
|
except:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|