diff --git a/generator/ctrl/ctrl_generator.py b/generator/ctrl/ctrl_generator.py index d620de7..53c0b86 100644 --- a/generator/ctrl/ctrl_generator.py +++ b/generator/ctrl/ctrl_generator.py @@ -20,7 +20,7 @@ def loss(labels, logits): class CTRLGenerator(): - def __init__(self, control_code="Horror Text: ", generate_num=128, temperature=0.3): + def __init__(self, control_code="Horror Text: ", generate_num=64, temperature=0.3): self.generate_num=generate_num model_dir = "generator/ctrl/model/seqlen256_v1.ckpt/" diff --git a/story/utils.py b/story/utils.py index 0cab888..3a43ebb 100644 --- a/story/utils.py +++ b/story/utils.py @@ -61,27 +61,30 @@ def replace_outside_quotes(text, current_word, repl_word): first_to_second_mappings = [ - ("I'm", "you're"), - ("I am", "you are"), + ("I'm ", "you're "), + ("I am ", "you are "), ("I ", "you "), - ("I've", "You've"), - ("my", "your"), - ("My", "Your"), + ("I've ", "You've "), + ("my ", "your "), + ("My ", "Your "), ("we ","you "), ("We ","You "), (" mine"," yours"), - ("me", "you"), + (" me", " you"), + (" us ", " you "), + (" us.", " you."), + ("our ", "your ") ] second_to_first_mappings = [ - ("You're", "I'm"), - ("you're", "I'm"), - ("Your", "My"), - ("your", "my"), - ("you are", "I am"), - ("You are", "I am"), - ("You", "I"), - ("you", "I"), + ("You're ", "I'm "), + ("you're ", "I'm "), + ("Your ", "My "), + ("your ", "my "), + ("you are ", "I am "), + ("You are ", "I am "), + ("You ", "I "), + ("you ", "I "), ] def capitalize_helper(string):