Package: extract-drugs
Drug Extraction CLIDrug Extraction CLIDemoDescriptionRequiresInstallationPython Developers / Data ScientistsRust DevelopersUsageInteractiveSearchOutput Data DictionaryExamplesSupportContributingMIT LicenseDemoDescriptionThis application takes a CSV file and parses text records from another CSV file to detect and extract search term mentions using string similarity algorithms to account for common misspellings. It is named for the drug searching it does most commonly for us at IPOP but is flexible enough to accept any type search terms.If you are wondering about specific use cases, check out theExamplesfolder!Requirescargopackage manager (rust toolchain)just(optional dev-dependency if you clone this repo)InstallationTo install the drug-extraction-cli application, simply:Python Developers / Data ScientistsPlease usepipxsince it is designedspecificallyfor this use case of installing Python CLI apps into isolated virtual environments.pipxinstallextract-drugsRust Developerscargoinstalldrug-extraction-cliIMPORTANT!Both of these will install an executable calledextract-drugs.No matter how you install the package from either packaging index, the binary program will be namedextract-drugsfor more intuitive commands.INFO: The naming discrepancy is due to to howmaturinhandles package names and wanting to both keep the same CLI command/name and maintain the Rust namespace. Apologies, but you'll be fine 🙂.UsageThis application has two commands:interactiveandsearch. Both of these commands have the same underlying functionality, the latter allows you to pass command-line arguments and is better suited to automated processing or advanced users while the former allows interactive declaration of the same configuration options and is better for new or first time users.API documentation for the library can be found ondocs.rs.InteractiveThis will present you with a series of prompts to help you select correct options. Highly recommended for new users or one-off runs.Usage:extract-drugsinteractiveThis command is demoed in the GIF above.Searchsearchfunctions the same asinteractivebut allows you to declaratively provide the configuration options.Output Data DictionaryThis tool will output anoutput.csvfile with the following format:Column NameDescriptionData TypeLimits/Rangesrow_idIdentifier from--id-colif provided, else line number of row in--data-fileStringNonesearch_termThe search term, cleaned and normalized. This is the actual term that was compared.StringNonematched_termThe matched term, cleaned and normalized. This is the actual term that was compared.StringNoneeditsTheosaedit distanceInteger0-2 (top limit due to exclusion filter)similarity_scoreThejaro_winklersimilarity scoreFloat0.95-1.0  (bottom limit due to exclusion filter)search_fieldThe field that this match was found in, from--search-colsStringNonemetadataThe attached metadata tosearch_termin the search_terms fileString or NoneNoneExamplesFor a whole showcase of example runs of this tool check out the shell scripts inside theexamplesfolder.For a showcase of potential analytical value that can be derived from running this tool, checkout the Jupyter Notebooks in the same folder!SupportIf you encounter any issues or need support please either contact@nanthony007oropen an issue.ContributingSeeCONTRIBUTING.md.MIT LicenseLICENSE