Skip to content

Fuzzy#26

Open
rfdougherty wants to merge 3 commits into
fastdatascience:mainfrom
soundtrip-health:fuzzy
Open

Fuzzy#26
rfdougherty wants to merge 3 commits into
fastdatascience:mainfrom
soundtrip-health:fuzzy

Conversation

@rfdougherty
Copy link
Copy Markdown

Description

Improve fuzzy matching performance. Changes include:

  • using the fuzzyset2 package, and efficient n-gram based matching algorithm
  • filtering common English words to reduce false-positives

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Testing

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • added fuzzy-match unit tests to tests/test_drugs_finder.py

Test Configuration

  • Library version: fuzzyset2 0.2.5, english-words 2.0.2
  • OS: Linux
  • Toolchain: python 3.12.3

Checklist

  • My PR is for one issue, rather than for multiple unrelated fixes.
  • My code follows the style guidelines of this project. I have applied a Linter (recommended: Pycharm's code formatter) to make my whitespace consistent with the rest of the project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • [NA] Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I add third party dependencies only when necessary. If I changed the requirements, it changes in pyproject.toml
  • If I introduced a new feature, I documented it ideally in the README examples so that people will know how to use it. NOTE: fuzzy match api is unchanged and should just be more accurate.

@woodthom2
Copy link
Copy Markdown
Member

Thanks so much Bob! Please give me a week or two to review both the PRs

@woodthom2
Copy link
Copy Markdown
Member

Hi Rob, thanks so much for these changes, I took some time to run everything but I think I unfortunately can't merge them.

The reason is that I've been trying to keep the project lightweight so that it can run very quickly e.g. on Azure Functions, and we're adding more third party dependencies. The response time has become quite slow now with the extra dependencies. However, I do really like what you did with the library and I could point to your fork in the README?

Also, I tested the input e.g. "i bought some Amphoteracin B" and that works both in the modified version and the original version, so I am not sure what advantage adding fuzzyset and the English library dependencies is bringing? Is it possible to apply the English word check at the time that the drug name dictionary is built? If things like NLTK can be invoked only when the package is built, but not needed to run the library, that would be ideal. Are there some false positives that I'm missing that are fixed by these changes? In which case I could cherry pick bits of your logic over into the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants