Skip to content

Instantly share code, notes, and snippets.

James Thomson jamesthomson

Block or report user

Report or block jamesthomson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@onyxfish
onyxfish / example1.py
Created Mar 5, 2010
Basic example of using NLTK for name entity extraction.
View example1.py
import nltk
with open('sample.txt', 'r') as f:
sample = f.read()
sentences = nltk.sent_tokenize(sample)
tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences]
tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences]
chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True)
You can’t perform that action at this time.