Let's say I have a dataframe with comments about a pizzaria. I'd like to apply a list of tags to this dataframe to highlight the top tagged words, not case sensitive.
For example, the dataframe is:
ID String
1 "The pizza was delicious"
2 "I loved the appetizer"
3 "Meatballs please on my pizza"
4 "Yum"
5 "Pineapple on my pizza"
6 "Keep the pineapple away"
7 "Peperoni Pizza!"
The tag list is:
Tag List
PIZZA
MEATBALL
PINEAPPLE
PEPERONI
The ideal output would be:
ID | String | Tag 1 | Tag 2 |
---|---|---|---|
1 | "The pizza was delicious" | PIZZA | |
2 | "I loved the appetizer" | ||
3 | "Meatballs please on my pizza" | MEATBALL | PIZZA |
4 | "Yum" | ||
5 | "Pineapple on my pizza" | PINEAPPLE | |
6 | "Keep the pineapple away" | PINEAPPLE | |
7 | "Peperoni Pizza!" | PEPERONI | PIZZA |
How could I go about accomplishing this?
Any help would be greatly appreciated!