Справочник переехал: https://github.com/hflabs/city
This file contains 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 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 |
This file contains 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
## install.packages(c("RCurl", "rjson", "digest")) | |
library(RCurl) | |
library(rjson) | |
library(digest) | |
## 老版, 已无法get到新的key | |
user = "blog125" | |
key = "21376174" |
This file contains 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 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) |
This file contains 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
####################################### | |
### -------- 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 |