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
# No standardization. | |
vectorize_layer = TextVectorization(output_mode="int", max_tokens=5, standardize=None) | |
# Lowercase text and strip punctuation. [DEFAULT] | |
vectorize_layer = TextVectorization(output_mode="int", max_tokens=5, standardize="lower_and_strip_punctuation") | |
# Apply a custom standardization function. | |
def replace_foo_with_bar(input_data): | |
return tf.strings.regex_replace(input_data, "foo", "bar") | |
vectorize_layer = TextVectorization(output_mode="int", max_tokens=5, standardize=replace_foo_with_bar) |
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 | |
CWD=$(pwd) | |
GPROTOBUF_URL=https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protobuf-cpp-3.7.0.tar.gz | |
compile_gprotobuf () { | |
sudo apt-get install autoconf automake libtool curl make g++ unzip && | |
wget $GPROTOBUF_URL && | |
fname=protobuf-cpp-3.7.0.tar.gz && | |
tar xvzf $fname && rm $fname && |
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 pandas as pd | |
from scipy import stats | |
# df = ..... | |
df = df[(np.abs(stats.zscore(df[feature_cols])) < 3).all(axis=1)] |