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

Updated dependencies #58

Merged
merged 7 commits into from
Jul 8, 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
4 changes: 2 additions & 2 deletions .github/workflows/github_test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Tests
run-name: Unit Testing on ${{ github.event_name }}
name: CI Tests
run-name: CI Testing on ${{ github.event_name }}

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<a href="https://doi.org/10.48550/arXiv.2407.02626">
<img alt="arXiv preprint" src="https://img.shields.io/badge/DOI-arXiv:2407.02626-orange" />
</a>
<img alt="PyPI Installs" src="https://img.shields.io/pypi/dm/text2term?label=pypi%20installs&color=D3CB40">
<img alt="Total Downloads" src="https://img.shields.io/pepy/dt/text2term?label=downloads&color=D10000">
</div>

## Installation
Expand Down
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Owlready2~=0.44
owlready2~=0.46
argparse~=1.4.0
pandas~=2.0.3
numpy~=1.24.2
gensim~=4.3.0
scipy~=1.10.1
scikit-learn~=1.2.1
setuptools~=68.2.2
requests~=2.31.0
pandas~=2.2.2
numpy~=1.26.4
gensim~=4.3.2
scipy~=1.12.0
scikit-learn~=1.5.1
setuptools~=70.2.0
requests~=2.32.3
tqdm~=4.66.1
sparse_dot_topn~=0.3.4
bioregistry~=0.10.6
sparse-dot-topn~=1.1.3
bioregistry~=0.11.10
nltk~=3.8.1
rapidfuzz~=2.13.7
rapidfuzz~=3.9.4
shortuuid~=1.0.11
myst_parser~=2.0.0
myst-parser~=2.0.0
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from text2term.config import VERSION

description = 'A tool for mapping free-text descriptions of (biomedical) entities to controlled terms in ontologies'
description = 'a tool for mapping free-text descriptions of entities to ontology terms'
long_description = open('README.md').read()

with open('requirements.txt') as f:
Expand All @@ -24,9 +24,13 @@
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Environment :: Console',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering'
],
python_requires=">=3.9",
Expand Down
7 changes: 3 additions & 4 deletions text2term/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from t2t import map_terms, cache_ontology
from onto_cache import cache_exists
from mapper import Mapper
from term import OntologyTermType

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='A tool for mapping free-text descriptions of (biomedical) '
Expand All @@ -25,7 +24,7 @@
"that contains the terms to map, optionally followed by the name of the column that "
"contains identifiers for the terms (eg 'my_terms,my_term_ids')")
parser.add_argument("-sep", "--separator", required=False, type=str, default=',',
help="Specifies the cell separator to be used when reading a non-comma-separated tabular file")
help="Specifies the cell separator to be used when reading a table")
parser.add_argument("-top", "--top_mappings", required=False, type=int, default=3,
help="Maximum number of top-ranked mappings returned per source term (default=3)")
parser.add_argument("-min", "--min_score", required=False, type=float, default=0.5,
Expand All @@ -38,9 +37,9 @@
parser.add_argument("-g", "--save_term_graphs", required=False, default=False, action="store_true",
help="Save vis.js graphs representing the neighborhood of each ontology term (default=False)")
parser.add_argument("-c", "--store_in_cache", required=False, type=str, default="",
help="Store the target ontology into local cache under acronym")
help="Cache the target ontology using the name given here")
parser.add_argument("-type", "--term_type", required=False, type=str, default="class",
help="Define whether to return ontology classes, properties, or both")
help="Define whether to map to ontology classes, properties, or both")
parser.add_argument('-u', "--incl_unmapped", required=False, default=False, action="store_true",
help="Include all unmapped terms in the output")

Expand Down
2 changes: 1 addition & 1 deletion text2term/config.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "4.1.4"
VERSION = "4.2.0"
9 changes: 4 additions & 5 deletions text2term/syntactic_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,32 +79,31 @@ def compare_levenshtein(self, s1, s2):
Calculates the normalized Levenshtein distance between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.normalized_levenshtein(s1, s2)/100
similarity = rapidfuzz.distance.Levenshtein.normalized_similarity(s1, s2)
return similarity

def compare_jaro(self, s1, s2):
"""
Calculates the Jaro similarity between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.jaro_similarity(s1, s2)/100
similarity = rapidfuzz.distance.Jaro.normalized_similarity(s1, s2)
return similarity

def compare_jarowinkler(self, s1, s2):
"""
Calculates the Jaro-Winkler similarity between s1 and s2.
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.string_metric.jaro_winkler_similarity(s1, s2)/100
similarity = rapidfuzz.distance.Jaro.normalized_similarity(s1, s2)
return similarity

def compare_indel(self, s1, s2):
"""
Calculates the normalized Indel distance between s1 and s2.
See: https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html#ratio
:return similarity between s1 and s2 as a float between 0 and 1
"""
similarity = rapidfuzz.fuzz.ratio(s1, s2)/100
similarity = rapidfuzz.distance.Indel.normalized_similarity(s1, s2)
return similarity

def compare_fuzzy_ratio(self, s1, s2):
Expand Down
Loading