import re

text = "a/NNP b/NNG c/NP d/NNP e/PNG" 
words = re.compile(r'\w+/(?:NNP|NNG)\b')
print(re.findall(words,text))