Extract surrounding words close to a tag
Hi!
I have tagged my dataset based on a pre-defined dictionary. Now I would like to extract all surrounding words (+/- 5) around each tag. I have tried to do so with the Term Neighborhood Extractor, yet this node does this for every word and not only for the ones that are tagged. Technically I could use a row filter after the Term Neighborhood node, but this will require a lot of computational power since my data set is very large.
So here is an example:
“I’ve been a customer[Tag] at this shop[Tag] for about three years now. Even though I currently live in Los Angeles[Tag], I find myself visiting the shop[Tag] at least once a month.”
For each word that has a [Tag], I’d like to extract the sorrounding words (+/- 5), plus the tagged word itself.
Hope someone can help!