Skip to content

Instantly share code, notes, and snippets.

@mertyildiran
Created June 21, 2017 01:22
Show Gist options
  • Select an option

  • Save mertyildiran/dcd7605f0d8721a244a61b90aa952d21 to your computer and use it in GitHub Desktop.

Select an option

Save mertyildiran/dcd7605f0d8721a244a61b90aa952d21 to your computer and use it in GitHub Desktop.
Q&A Engine
import nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
import wikipedia
page = wikipedia.page(wikipedia.search('albert einstein')[0])
sentences = nltk.sent_tokenize(page.content)
print nltk.word_tokenize(sentences[0])
print nltk.pos_tag(sentences[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment