addGreppedPatterns: Search for inventory-related information within item titles

Description Usage Arguments Details Value

Description

Given items data, with columns 'hash_str', 'title', 'prediction', extract columns grams, ounces, pounds, milligrams, pills, quantity

Usage

1
addGreppedPatterns(itemsTuple)

Arguments

itemsTuple

name of dataframe with items data, described above

Details

Grams is the information associated with grams, e.g. "half gram" or "10g", etc., and similarly for ounces and pounds. Milligrams can be both milligrams and micrograms. Pills refers to pills, tabs, tablet, blotters. In the absence of any of the preceding information, we extract a beginning numeric quantity in the item title. For example, in the title "10 credit cards," 10 will be extracted.

Value

dataframe with six columns added


xhtai/heisenbrgr documentation built on June 8, 2019, 9:30 a.m.