Giter Club home page Giter Club logo

doseminer's Issues

Add support for fractional doses (beyond half measures)

The package currently supports expressions with half measures in them, including mixed fractions:

doseminer::replace_numbers(c('half a spoonful', 'three and a half tablets'))
## [1] "0.5 a spoonful" "3.5 tablets" 

But more unusual fractions like thirds, fifths and quarters don't really work because it just kind of adds the denominator:

doseminer::replace_numbers(c('thirty three and a third', 'four fifths'))
## [1] "37" "9" 

The problem is with fixing this (assuming such cases appear often enough in prescriptions to be worth worrying about) without unintentionally breaking the parsing of ordinal words, which look a lot like fractions:

doseminer::replace_numbers(c('every third day', 'every fifth hour'))
## [1] "every 3 day"  "every 5 hour"

However with enough ambition, 'every 1/3 day' could be interpreted as '(every day) / 3' and end up giving the right result, with an appropriate redesign of how intervals are calculated.

Accuracy issues

Thanks for this package. I need to extract doses and units from free text, so I tried this. However, there are some accuracy issues you should probably look into. For example, if you run the code:
extract_from_prescription(c("Diclofenac sodium 50mg gastro-resistant tablets", "Bendroflumethiazide 2.5mg tablets", "Co-amoxiclav 250mg/125mg tablets", "Zyban 150mg modified-release tablets (GlaxoSmithKline UK Ltd)")), you get the wrong units (first two examples), fail to detect the clavulanate dose (third example) and extract a non-existent frequency (last example).

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.