From dbd8132a5409de9d68821daf88e76d27d54e366b Mon Sep 17 00:00:00 2001 From: Nick Walton Date: Thu, 26 Sep 2019 14:46:23 -0600 Subject: [PATCH] update --- generator/ctrl/ctrl_generator.py | 6 +++--- story/utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generator/ctrl/ctrl_generator.py b/generator/ctrl/ctrl_generator.py index 8d9e3de..d077023 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=80, temperature=0.3): + def __init__(self, control_code="Writing Text: ", generate_num=80, temperature=0.3): self.generate_num=generate_num model_dir = "generator/ctrl/model/seqlen256_v1.ckpt/" @@ -158,7 +158,7 @@ class CTRLGenerator(): if prompt[-1] != " ": prompt = prompt + " " - prompt = second_to_first_person(prompt) + #prompt = second_to_first_person(prompt) prompt = self.control_code + prompt # print("\n\nAFTER PROMPT_REPLACE") @@ -172,7 +172,7 @@ class CTRLGenerator(): first_letter_capitalized = result[0].isupper() result = result.replace("#", "") result = result.replace("*", "") - result = first_to_second_person(result) + #result = first_to_second_person(result) result = remove_profanity(result) if not first_letter_capitalized: diff --git a/story/utils.py b/story/utils.py index cc0d5a9..59bc5a9 100644 --- a/story/utils.py +++ b/story/utils.py @@ -173,5 +173,5 @@ def second_to_first_person(text): return capitalize_first_letters(text[1:]) if __name__ == '__main__': - text = '“Hey there, you okay?” She asks. I\'m not sure what to say, “I\'m fine, I\'m sorry.” I say' + text = 'You wake up in an old rundown hospital with no memory of how you got there. You look around and see a nurse standing over me. "Hey buddy, you okay?" she asks. She looks at me like I\'m crazy. ' print(first_to_second_person(text)) \ No newline at end of file