Skip to content

0.1.0-beta9

Pre-release
Pre-release

Choose a tag to compare

@strangetom strangetom released this 06 Apr 15:09
· 753 commits to master since this release

General

Model

  • Add additional model performance metrics.
  • Add model hyper-parameter tuning functionality with python train.py gridsearch to iterate over specified training algorithms and hyper-parameters.
  • Add --detailed argument to output detailed information about model performance on test data. (#9, @boxydog)
  • Change model labels to treat label all punctuation as PUNC - this resolves some of the ambiguity in token labeling
  • Introduce SIZE label for tokens that modify the size of the ingredient. Note that his only applies to size modifiers of the ingredient. Size modifiers of the unit will remain part of the unit e.g. large clove.

Processing

  • Integration of pint library for units

    • By default, units in IngredientAmount object will be returned as pint.Unit objects (where possible). This enables the easy conversion of amounts between different units. This can be disabled by setting string_units=True in the parse_ingredient function calls.

    • For units that have US customary and Imperial version with the same name (e.g, cup), setting imperial_units=True in the parse_ingredient function calls will return the imperial version. The default is US customary.

    • This only applies to units in pint's unit registry (basically all common, standardised units). If the unit can't be found, then the string is returned as previously.

  • Additions to IngredientAmount object:

    • New quantity_max field for handling upper limit of ranges. If the quantity is not a range, this will default to same as the quantity field.
    • Flags for RANGE and MULTIPLIER
      • RANGE is set to True for quantity ranges e.g. 1-2
      • MULTIPLIER is set to True for quantities like 1x
    • Conversion of quantity field to float where possible
  • PreProcessor improvements

    • Be less aggressive about replacing written numbers (e.g. one) with the digit version. For example, in sentences like 1 tsp Chinese five-spice, five-spice is now kept as written instead of being replaced by two tokens: 5 spice.
    • Improve handling of ranges that duplicate the units e.g. 1 pound to 2 pound is now returned as 1-2 pound