3 ms·
I stumbled over SpaCy when looking for something to extract key words and numbers from sentences, however it looked a bit daunting and/or overkill. Think recipe
by magicalhippo 6y ago
I stumbled over SpaCy when looking for something to extract key words and numbers from sentences, however it looked a bit daunting and/or overkill. Think recipes or similar, turning "take three tablespoons of sugar" into [3, 'tablespoons', 'sugar'] or similar.
Should I give it another shot or are there libraries more suited for this than just plain regexp galore?
- teruakohatu 6y agoI did that years ago for some project. For recipes you can probably get away with regular expressions. But with Spacy you could tokenize the sentence, then tag each work with the Part of Speech it is, and then find patterns eg. Verb Number Noun Preposition Noun Then match the first noum against a list of measurements (tablespoon, teaspoon, tbsp...) and extract the rest of the components.
- SirHoki 6y agoThis is exactly what you want: https://github.com/facebook/duckling https://github.com/facebook/duckling
- magicalhippo 6y agoThat looks great, time to dip my feet in the Haskell pond then. Thanks!