This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stopped = [t for t in wordnet_lemmas if t not in stop] | |
untokenize(stopped) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.corpus import stopwords | |
stop = stopwords.words('english') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.stem.wordnet import WordNetLemmatizer | |
wordnet = WordNetLemmatizer() | |
wordnet_lemmas = [wordnet.lemmatize(token) for token in tokens] | |
untokenize(wordnet_lemmas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.stem.lancaster import LancasterStemmer | |
lancaster = LancasterStemmer() | |
lancaster_stemmed = [lancaster.stem(token) for token in tokens] | |
untokenize(lancaster_stemmed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.stem.porter import PorterStemmer | |
porter = PorterStemmer() | |
porter_stemmed = [porter.stem(token) for token in tokens] | |
untokenize(porter_stemmed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.stem.snowball import SnowballStemmer | |
snowball = nltk.SnowballStemmer("english") | |
snowball_stemmed = [snowball.stem(token) for token in tokens] | |
untokenize(snowball_stemmed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.tokenize import RegexpTokenizer | |
snippet = snippet.lower() | |
tokens = RegexpTokenizer(r'\w+').tokenize(snippet) | |
untokenize(tokens) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet = """ | |
When the Apple Watch first came out last year, Engadget published not one but two reviews. There was the \"official\" review, which provided an overview of the device's features and, more important, attempted to explain who, if anyone, should buy it. Then there was a piece I wrote, focusing specifically on the watch's capabilities (actually, drawbacks) as a running watch. Although we knew that many readers would be interested in that aspect of the device, we were wary of derailing the review by geeking out about marathoning. | |
This year, we needn't worry about that. With the new Apple Watch Series 2, the company is explicitly positioning the device as a sports watch. In particular, the second generation brings a built-in GPS radio for more accurate distance tracking on runs, walks, hikes, bike rides and swims. Yes, swims: It's also waterproof this time, safe for submersion in up to 50 meters of water. | |
Beyond that, the other changes are performance-related, including a faster chip, longer batte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk, string | |
def untokenize(tokens): | |
return "".join([" "+i if not i.startswith("'") and i not in string.punctuation else i for i in tokens]).strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="container tiles" role="main"> | |
<div class="row" v-for="projectGroup in chunkedProjects"> | |
<div class="col-lg-4" v-for="project in projectGroup"> | |
<div class="flip"> | |
<div class="card" :class="{'flipped':project.flipped}"> | |
<div class="face front">Front</div> | |
<div class="face back">Back</div> |
NewerOlder