I'm newbie python programmer here I suppose.
I want to extract only the related keywords if we were given any list/array in python.
Ex: Extract only food related words in a list of strings A user for example can input a list.
[0] I want to buy some apple.
[1] Oranges are good for the health.
[2] I bought 2 blueberries yesterday.
[3] John is eating some grapes.
[4] My crush did not like me back.
Expected output would be:
[0] apple
[1] oranges
[2] blueberries
[3] grapes
[4] None
I would appreciate if anyone could point out to me how I could achieve something like this. I'm still new to programming and found out how to extract words recently but ONLY if I have a list of categorized food for reference. I could just compare and extract Yaayyy!! :D But assuming that the user can input any items he/she wants, how would I go about approaching a solution for this? Would it be practical to copy all the foods in the whole world and store them in a list for reference? I've looking for a solution. Maybe I might have missed it for some reason. If anyone could point me to a link or topic that would be great if this is a duplicate!
Btw a shoutout and thank you to all the people in StackOverFlow really helped me a lot! :)