I am trying to extract the identified dictionary words from a Quanteda dfm, but have been unable to find a solution.
Does someone have a solution for this?
Sample input:
dict <- dictionary(list(season = c("spring", "summer", "fall", "winter")))
dfm <- dfm("summer is great", dictionary = dict)
Output:
> dfm
Document-feature matrix of: 1 document, 1 feature.
1 x 1 sparse Matrix of class "dfmSparse"
features
docs season
text1 1
I now know that a seasonality dict word has been identified in the sentence, but I would also like to know which word it was.
This should preferably be extracted in the table format:
docs dict dictWord
text1 season summer