IN = re.compile('.*\\bin\\b(?!\\b.+ing)')
for doc in nltk.corpus.ieer.parsed_docs('NYT_19980315'):
    for rel in nltk.sem.relextract.extract_rels('ORG', 'LOC', doc, corpus=
        'ieer', pattern=IN):
        print(nltk.sem.relextract.rtuple(rel))
извлечь отношения с помощью NLTK