1
$\begingroup$

I'm trying to understand what types of techniques would be most applicable to the following type of problem.

I'm trying to, given a webpage url that contains a recipe, separate the ingredient list from the instructions. From there I have found some libraries that can structure the ingredients once you have the list (e.g. turning "3 large applies" into something structured). What I haven't found and can't quite figure out how to characterize is the extraction of the ingredient list from the overall webpage.

Any advice is helpful.

$\endgroup$
0
$\begingroup$

Wouldn't you need to develop a library of words that are found in ingredients, the same way there are libraries for good words and bad words, which are used in sentiment analysis?

Firstly, there's only about 10,000 unique words in the English vocabulary which are used in text mining. Couldn't you get the list of all fruits, vegetables, fish, meats, oils, grains, spices, measuring units (tspn, tbspn, cup, quart, shakes, etc.), and verbs (action words like grind, puree, boil, sautee, fry, steam, sear, etc.). Once you have that you'll know when you are in the ingredients section, so then maybe reverse 100 words, and learn when these words stop, add 100 words, cut that text string out and perform stemming and stopping to drop articles (a, the, of, etc.) and other junk words.

$\endgroup$
0
$\begingroup$

This might be a non-answer, but perhaps you could think about parsing techniques for web pages. For example, on Python there are a few HTML (or other file format parsers) like HTMLParser. I also quite like Beautiful Soup for some fileformats.

Your goal here is to use the structure of the website to retrieve the information. From the website, if they label the ingredient section with a particular tag, it might be easily parsed by extracting just a particular section of the webpage.

$\endgroup$
1
  • $\begingroup$ Right, but my goal was to build something smarter that worked on multiple websites not coding to specific ones. $\endgroup$ – gunygoogoo Aug 26 '18 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.