Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mponty
mponty / EDA u xaB4uK
Created January 22, 2018 06:06
Дополнил EDA анализом активности пользователей
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import os.path as osp\n",
cfg['model']['mask_head']['num_classes'] = N_CLASSES + 1
if isinstance(cfg['model']['bbox_head'], list):
for i in range(len(cfg['model']['bbox_head'])):
cfg['model']['bbox_head'][i]['num_classes'] = N_CLASSES + 1
else:
cfg['model']['bbox_head']['num_classes'] = N_CLASSES + 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mponty
mponty / EDA of labeled-python-data-pii-detection.ipynb
Created March 1, 2023 16:34
EDA of labeled-python-data-pii-detection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from collections import defaultdict, Counter
from typing import Tuple, Dict, Any, List
from nltk import RegexpTokenizer
import re
def is_overlap(span: Tuple[int, int], reference_span: Tuple[int, int]) -> bool:
l1, r1 = min(*span), max(*span)
l2, r2 = min(*reference_span), max(*reference_span)
return l1 <= l2 < r1 or l1 < r2 <= r1 or l2 <= l1 < r2 or l2 < r1 <= r2