如果您不接受其他选项
NLTK,请签出
TextBlob。它可以轻松提取所有名词和名词短语:
>>> from textblob import TextBlob>>> txt = """Natural language processing (NLP) is a field of computer science, artificial intelligence, and computational linguistics concerned with the interactions between computers and human (natural) languages.""">>> blob = TextBlob(txt)>>> print(blob.noun_phrases)[u'natural language processing', 'nlp', u'computer science', u'artificial intelligence', u'computational linguistics']
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)