Skip to content

Instantly share code, notes, and snippets.

View chetanambi's full-sized avatar

Chetan Ambi chetanambi

View GitHub Profile
@chetanambi
chetanambi / evaluate.py
Created August 4, 2020 15:44
evaluate
!python3 pegasus/bin/evaluate.py \
-- params=reddit_tifu_long_transformer \
-- param_overrides=vocab_filename=ckpt/pegasus_ckpt/c4.unigram.newline.10pct.96000.model,batch_size=1,beam_size=2,beam_alpha=0.6 \
-- model_dir=ckpt/pegasus_ckpt/reddit_tifu/model.ckpt-8000
@chetanambi
chetanambi / reddit_tifu_long.py
Created August 4, 2020 15:45
reddit_tifu_long
save_path = "tfrecord:/content/pegasus/pegasus/data/testdata/test_pattern_1.tfrecord"
@registry.register("reddit_tifu_long_transformer")
def reddit_tifu_long_transformer(param_overrides):
return transformer_params(
{
"train_pattern": save_path,
"dev_pattern": save_path,
"test_pattern": save_path,
"max_input_len": 1024,
"max_output_len": 128,
import pandas as pd
import tensorflow as tf
input_dict = dict(
inputs=[inp],
targets=[""]
)
save_path = "pegasus/data/testdata/test_pattern_1.tfrecord"
data = pd.DataFrame(input_dict)
@chetanambi
chetanambi / clone_pegasus.py
Created August 4, 2020 15:53
clone_pegasus
!git clone https://github.com/google-research/pegasus
%cd pegasus
!export PYTHONPATH=.
!pip3 install -r requirements.txt
!sudo apt-get install gcc python-dev python-setuptools libffi-dev
!sudo apt-get install python-pip
!sudo pip install gsutil
!mkdir ckpt
!gsutil cp -r gs://pegasus_ckpt ckpt/
@chetanambi
chetanambi / install_pegasus.py
Created August 4, 2020 15:57
install_pegasus
!pip3 install -e pegasus
%cd /content/pegasus/
@chetanambi
chetanambi / NLP_with_Disaster_Tweets.ipynb
Created August 8, 2020 16:55
NLP_with_Disaster_Tweets
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.