Skip to content

Instantly share code, notes, and snippets.

View kspicer80's full-sized avatar

Kevin Andrew Spicer kspicer80

View GitHub Profile
@widiger-anna
widiger-anna / contractions_test.py
Created May 4, 2018 17:31
Expanding contractions with spaCy
from __future__ import unicode_literals, print_function
import spacy
from spacy.attrs import ORTH, LEMMA, NORM, TAG
from spacy.lang.en.stop_words import STOP_WORDS
from spacy import displacy
from pathlib import Path
import re
nlp = spacy.load('en_core_web_sm')
# example of expanding contractions using regexes (slow for a big corpus)
@nsarode
nsarode / pandas_notes.md
Last active August 19, 2022 23:26
Pandas notes : Compiling a reference list of commands relevant to Pandas

Version check

pd.__version__

Summary stats

df.describe()

Rows and column counts

@vu3jej
vu3jej / colour_extractor.py
Last active March 29, 2023 23:55
COLOUR NAME EXTRACTION USING SPACY
import spacy
class ColourExtractorStrict:
"""Extract colours along with adjectives"""
def __init__(self, colours):
self.colours = colours
self.pos_ok = ['ADJ', 'NOUN']
self.tagger = spacy.load('en')