Skip to content

Instantly share code, notes, and snippets.

View akaanirban's full-sized avatar
🏠
Working from home

Anirban Das akaanirban

🏠
Working from home
  • Capital One
  • San Mateo, CA
View GitHub Profile
@akaanirban
akaanirban / parallel.py
Created August 31, 2021 02:33 — forked from thomwolf/parallel.py
Data Parallelism in PyTorch for modules and losses
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang, Rutgers University, Email: zhang.hang@rutgers.edu
## Modified by Thomas Wolf, HuggingFace Inc., Email: thomas@huggingface.co
## Copyright (c) 2017-2018
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""Encoding Data Parallel"""
@akaanirban
akaanirban / spacy_preprocessor.py
Created August 5, 2021 14:52 — forked from omri374/spacy_preprocessor.py
Text preprocessing using spaCy
import re
from typing import List
import spacy
from spacy.tokens import Doc
from tqdm import tqdm
class SpacyPreprocessor:
def __init__(