3 ms·
> If you want to give it a go, grab a ratpack parser in the language of your choice, pick a dozen recipes, write rules to extract the ingredients, and then appl
by skipnup 5y ago
> If you want to give it a go, grab a ratpack parser in the language of your choice, pick a dozen recipes, write rules to extract the ingredients, and then apply them to other recipes. I'm fairly sure you'll be surprised.
As I didn't unterstand all of the words in your reply without looking them up, I'll definitely give it a try! Thanks
- tgv 5y ago> conventional symbolic rules CFG like rules, such as used in programming languages. The famous one that opens many introductions to syntax is S -> NP VP. That is: a Sentence can be rewritten to a Noun Phrase followed by a Verbal Phrase. That covers a large part of everyday English. In fact, the previous sentence has an NP + VP, while this sentence doesn't. > Statistical modeling Language is very ambiguous. Adding more rules to cover more cases makes it even worse. Collecting statistics is a way to use rules such as above (or more complex variants) and filter out the most probable analysis. There are other forms of statistical models. E.g., for tagging (assinging categories to words), the Markov chain (often representing n-grams) was quite popular. > Conditional Random Fields A statistical method that can take context into account. > custom tags, not just "noun", "verb" One approach to adding meaning to lexical and syntactic analysis was having more semantical categories. Early attempts are features such as "living/non-living", "abstract/concrete", etc. for nouns. The NY ingredient parser seems to have categories like quantity, unit, name (the actual ingredient) and comment (such as fresh). > a ratpack parser in the language of your choice Ratpack is perhaps too specific a name. The more generic term is PEG parsers. They are flexible and easily programmed, and available for many programming languages; Python might even have one built in (PEP 0617). You can write grammatical rules in code. Set up a notebook, and you'll be able to test your rules against input samples with the click of a button.