Skip to content

Instantly share code, notes, and snippets.

View fkurushin's full-sized avatar
🌪️
Focusing

Fedor Kurushin fkurushin

🌪️
Focusing
View GitHub Profile
@emillykkejensen
emillykkejensen / MultiLabel_MultiClass_TextClassification_with_BERT_Transformer_and_Keras.py
Created August 21, 2020 10:23
Multi-Label, Multi-Class Text Classification with BERT, Transformer and Keras
#######################################
### -------- Load libraries ------- ###
# Load Huggingface transformers
from transformers import TFBertModel, BertConfig, BertTokenizerFast
# Then what you need from tensorflow.keras
from tensorflow.keras.layers import Input, Dropout, Dense
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
@ilap
ilap / grafana_telegram_bot.md
Last active July 16, 2024 11:43
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active October 27, 2024 15:17 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@nalgeon
nalgeon / cities.md
Last active November 14, 2024 15:48
Города России с координатами
@michaelHL
michaelHL / translate_youdao.r
Last active July 26, 2023 11:50
有道翻译api(via R), youdao dict
## install.packages(c("RCurl", "rjson", "digest"))
library(RCurl)
library(rjson)
library(digest)
## 老版, 已无法get到新的key
user = "blog125"
key = "21376174"
@pwaller
pwaller / Dockerfile
Created January 26, 2015 21:16
Trying to use jemalloc with cgo
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y curl build-essential git mercurial upx
RUN curl -sSL https://golang.org/dl/go1.4.src.tar.gz | tar -v -C /usr/local -xz
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
ENV GOPATH /go
ENV PATH /usr/local/go/bin:$PATH
ENV PATH /go/bin:$PATH