doc.text = [nltk.Tree('ORGANIZATION', ['WHYY']), 'in', nltk.Tree('LOCATION',
    ['Philadelphia']), '.', 'Ms.', nltk.Tree('PERSON', ['Gross']), ',']
for rel in nltk.sem.extract_rels('ORG', 'LOC', doc, corpus='ieer', pattern=IN):
    pass
extract relationships using NLTK