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.
Files changed (62) hide show
  1. {wbtools-3.0.4 → wbtools-3.0.6}/PKG-INFO +1 -1
  2. {wbtools-3.0.4 → wbtools-3.0.6}/setup.py +1 -1
  3. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/paper.py +13 -7
  4. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/PKG-INFO +1 -1
  5. {wbtools-3.0.4 → wbtools-3.0.6}/LICENSE +0 -0
  6. {wbtools-3.0.4 → wbtools-3.0.6}/README.md +0 -0
  7. {wbtools-3.0.4 → wbtools-3.0.6}/setup.cfg +0 -0
  8. {wbtools-3.0.4 → wbtools-3.0.6}/tests/__init__.py +0 -0
  9. {wbtools-3.0.4 → wbtools-3.0.6}/tests/config_reader.py +0 -0
  10. {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/__init__.py +0 -0
  11. {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_afp.py +0 -0
  12. {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_antibody.py +0 -0
  13. {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_expression.py +0 -0
  14. {wbtools-3.0.4 → wbtools-3.0.6}/tests/db/test_generic.py +0 -0
  15. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/__init__.py +0 -0
  16. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/__init__.py +0 -0
  17. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_email_addresses.py +0 -0
  18. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_generic.py +0 -0
  19. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/entity_extraction/test_new_variations.py +0 -0
  20. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_literature_index.py +0 -0
  21. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_scraping.py +0 -0
  22. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_text_preprocessing.py +0 -0
  23. {wbtools-3.0.4 → wbtools-3.0.6}/tests/lib/test_text_similarity.py +0 -0
  24. {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/__init__.py +0 -0
  25. {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/test_corpus.py +0 -0
  26. {wbtools-3.0.4 → wbtools-3.0.6}/tests/literature/test_paper.py +0 -0
  27. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/__init__.py +0 -0
  28. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/__init__.py +0 -0
  29. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/abstract_manager.py +0 -0
  30. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/afp.py +0 -0
  31. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/antibody.py +0 -0
  32. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/dbmanager.py +0 -0
  33. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/expression.py +0 -0
  34. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/gene.py +0 -0
  35. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/generic.py +0 -0
  36. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/paper.py +0 -0
  37. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/db/person.py +0 -0
  38. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/__init__.py +0 -0
  39. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/email/__init__.py +0 -0
  40. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/email/generic.py +0 -0
  41. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/__init__.py +0 -0
  42. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/common.py +0 -0
  43. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/__init__.py +0 -0
  44. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/email_addresses.py +0 -0
  45. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/ntt_extractor.py +0 -0
  46. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/entity_extraction/variations.py +0 -0
  47. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/__init__.py +0 -0
  48. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/abstract_index.py +0 -0
  49. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/literature_index/textpresso.py +0 -0
  50. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/text_preprocessing.py +0 -0
  51. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/nlp/text_similarity.py +0 -0
  52. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/scraping.py +0 -0
  53. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/lib/timeout.py +0 -0
  54. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/__init__.py +0 -0
  55. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/corpus.py +0 -0
  56. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/literature/person.py +0 -0
  57. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/utils/__init__.py +0 -0
  58. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools/utils/okta_utils.py +0 -0
  59. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/SOURCES.txt +0 -0
  60. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/dependency_links.txt +0 -0
  61. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/requires.txt +0 -0
  62. {wbtools-3.0.4 → wbtools-3.0.6}/wbtools.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wbtools
3
- Version: 3.0.4
3
+ Version: 3.0.6
4
4
  Summary: Interface to WormBase (www.wormbase.org) curation data, including literature management and NLP functions
5
5
  Home-page: https://github.com/WormBase/wbtools
6
6
  Author: Valerio Arnaboldi
@@ -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.4",
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
- return [re.sub('<[^<]+>', '', sentence.text) for section in article.sections for paragraph
53
- in section.paragraphs for sentence in paragraph if not sentence.text.isdigit() and
54
- not (
55
- len(section.paragraphs) == 3 and
56
- section.paragraphs[0][0].text in ['\n', ' '] and
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wbtools
3
- Version: 3.0.4
3
+ Version: 3.0.6
4
4
  Summary: Interface to WormBase (www.wormbase.org) curation data, including literature management and NLP functions
5
5
  Home-page: https://github.com/WormBase/wbtools
6
6
  Author: Valerio Arnaboldi
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