This file contains hidden or 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 dataclasses import dataclass | |
from time import perf_counter | |
from typing import NamedTuple | |
class Person: | |
def __init__(self, first_name: str, last_name: str, age: int) -> None: | |
self.first_name = first_name | |
self.last_name = last_name | |
self.age = age |
This file contains hidden or 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
#!/bin/bash | |
# Usage: | |
# ~$ sh reduce_video_file_size.sh [./input.mp4] [size mb] [./output.mp4] | |
# Parameters can be preset or set by providing none | |
# Input and output names must end with ".mp4" | |
# Can use Git Bash to run the script on Windows | |
display_help() { | |
local FILE=`basename "$0"` |
This file contains hidden or 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 spacy | |
nlp = spacy.load('en') # loading the language model | |
data = pd.read_feather('data/preprocessed_data') # reading a pandas dataframe which is stored as a feather file | |
def clean_up(text): # clean up your text and generate list of words for each document. | |
removal=['ADV','PRON','CCONJ','PUNCT','PART','DET','ADP','SPACE'] | |
text_out = [] | |
doc= nlp(text) | |
for token in doc: |