Skip to content

Instantly share code, notes, and snippets.

View matthewcornell's full-sized avatar
🎸

Matthew Cornell matthewcornell

🎸
View GitHub Profile
@matthewcornell
matthewcornell / example1.py
Last active September 16, 2015 14:44 — forked from onyxfish/example1.py
Basic example of using NLTK for name entity extraction.
# forked for my own reference
import urllib.request
import urllib.parse
from bs4 import BeautifulSoup as bs
import nltk
def extract_named_ents_from_url(url):
url_bytes = get_bytes_for_url(url)
soup = bs(url_bytes, "lxml")