Skip to content

Instantly share code, notes, and snippets.

View chauhanakash23's full-sized avatar
🎯
Focusing

Akash Chauhan chauhanakash23

🎯
Focusing
View GitHub Profile
save_path = "<Your path>/pegasus/data/testdata/test_pattern_1.tfrecords"
@registry.register("test_transformer")
def test_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": 256,
@chauhanakash23
chauhanakash23 / create_input_data.py
Created June 25, 2020 07:00
Script to convert summarization data to tf_records.
import pandas as pd
import tensorflow as tf
save_path = "<Your path>/pegasus/data/testdata/test_pattern_1.tfrecords"
input_dict = dict(
inputs=[
# Your text inputs to be summarized.
],
targets=[
import pandas as pd
from tqdm import tqdm
from difflib import SequenceMatcher
import re
import pickle
def matcher(string, pattern):
'''
Return the start and end index of any pattern present in the text.
'''