NLTK relation extraction returns nothing
问题 I am recently working on using nltk to extract relation from text. so i build a sample text:" Tom is the cofounder of Microsoft." and using following program to test and return nothing. I cannot figure out why. I'm using NLTK version: 3.2.1, python version: 3.5.2. Here is my code: import re import nltk from nltk.sem.relextract import extract_rels, rtuple from nltk.tokenize import sent_tokenize, word_tokenize def test(): with open('sample.txt', 'r') as f: sample = f.read() # "Tom is the