Oddly enough, computers are not typically good at making complex judgement calls, like determining whether or not a given product is "food" under the arcane definitions in various cities, counties, and states. That requires a person to research the product, research the law, and apply the latter to the former.
Years ago, before Amazon changed to supporting sales taxes, there was an effort by several online retailers to negotiate with states to create a uniform set of taxable categories, so products could be classified once, and only the tax rate would be variable from jurisdiction to jurisdiction. Regrettably, this effort did not succeed.