From 63e3eaa120a7990084a2e681ceccdc223ca33b90 Mon Sep 17 00:00:00 2001 From: Digital-Black <44770198+Digital-Black@users.noreply.github.com> Date: Thu, 9 Sep 2021 01:31:48 -0400 Subject: [PATCH 1/2] Added list elements for randomization New list elements were added into a random choice method. Expanded suspect_words list with short, varied strings. Made minor adjustments to biases to optimize randomness. Current self-test output: Duplicates: 175558 Unique: 1824442 I [think]: 1322491 Other: 501951 --- bot/prompt.py | 112 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 81 insertions(+), 31 deletions(-) diff --git a/bot/prompt.py b/bot/prompt.py index 3c1aca5..5c23e42 100644 --- a/bot/prompt.py +++ b/bot/prompt.py @@ -8,15 +8,28 @@ def random_select_weighted_list(ls): suspect_words = [ (1.0, 'know'), + (1.0, 'determined'), + (1.0, 'have determined'), (1.0, 'discovered'), (1.0, 'uncovered'), (1.0, 'suspect'), (1.0, 'learned'), (0.8, 'figured out'), (1.0, 'found out'), - (0.3, 'have reason to suspect'), + (1.0, 'can show'), + (1.0, 'can reveal'), + (1.0, 'have revealed'), + (1.0, 'revealed'), + (1.0, 'revealed proof'), + (1.0, 'revealed evidence'), + (1.0, 'revealed information'), + (0.5, 'have reason to suspect'), + (1.0, 'have information'), + (1.0, 'got information'), + (1.0, 'found information'), + (1.0, 'obtained information'), (1.0, 'believe'), - (0.3, 'have reason to believe'), + (0.5, 'have reason to believe'), (1.0, 'think'), (0.5, 'have found evidence'), (0.5, 'have written evidence'), @@ -24,12 +37,16 @@ def random_select_weighted_list(ls): (0.5, 'have video evidence'), (0.5, 'have obtained evidence'), (0.5, 'have evidence'), - (0.2, 'have strong evidence'), + (0.5, 'have strong evidence'), (1.0, 'am convinced'), (1.0, 'am certain'), (1.0, 'am positive'), (1.0, 'am suspicious'), (1.0, 'am sure'), + (1.0, 'am reporting'), + (1.0, 'am testifying'), + (1.0, 'am notifying'), + (1.0, 'hereby report'), (1.0, 'can prove'), (0.8, 'can legally show'), (0.8, 'can legally prove'), @@ -39,16 +56,24 @@ def random_select_weighted_list(ls): (0.5, 'will testify'), (1.0, 'have verified'), (1.0, 'have verification'), + (1.0, 'got verification'), (0.8, 'happened upon proof'), (0.8, 'happened upon evidence'), + (0.8, 'happened upon information'), (0.8, 'stumbled upon proof'), (0.8, 'stumbled upon evidence'), + (0.8, 'stumbled upon information'), (0.8, 'came upon proof'), (0.8, 'came upon evidence'), + (0.8, 'came upon information'), (0.8, 'came across evidence'), (0.8, 'came across proof'), - (1.0, 'uncovered proof'), + (0.8, 'came across information'), + (1.0, 'offer proof'), + (1.0, 'offer evidence'), + (1.0, 'offer information'), (1.0, 'uncovered evidence'), + (1.0, 'uncovered information'), (1.0, 'recovered proof'), (1.0, 'recovered evidence'), (0.5, 'just received proof'), @@ -59,10 +84,17 @@ def random_select_weighted_list(ls): (1.0, 'got proof'), (1.0, 'received proof'), (1.0, 'received evidence'), - (0.5, 'got hold of proof'), - (0.5, 'got hold of evidence'), - (0.5, 'saved proof'), - (0.5, 'saved evidence'), + (1.0, 'received information'), + (1.0, 'got hold of proof'), + (1.0, 'got hold of evidence'), + (1.0, 'got hold of information'), + (1.0, 'saved proof'), + (1.0, 'saved evidence'), + (1.0, 'saved information'), + (1.0, 'stored proof'), + (1.0, 'stored evidence'), + (1.0, 'stored information'), + (1.0, 'uncovered proof'), (0.5, 'have saved proof'), (0.5, 'have saved evidence'), (0.5, 'happen to have proof'), @@ -76,28 +108,39 @@ def random_select_weighted_list(ls): (0.5, 'will legally prove'), (0.5, 'will provide proof'), (0.5, 'will show legal proof'), - (0.3, 'have it on video'), - (0.3, 'have it on film'), - (0.3, 'have it on a recording'), + (0.5, 'have it on video'), + (0.5, 'have it on film'), + (0.5, 'have it on recording'), (1.0, 'have video proof'), (1.0, 'have audio proof'), - (0.5, 'saved screenshots as proof'), - (0.5, 'saved screenshots as evidence'), + (0.5, 'saved screenshots to prove'), + (0.5, 'saved screenshots for evidence'), (0.5, 'saved texts as proof'), (0.5, 'saved texts as evidence'), - (0.5, 'saved messages as proof'), - (0.5, 'saved messages as evidence'), - (0.8, 'took screenshots as proof'), - (0.8, 'took screenshots as evidence'), - (0.8, 'saved video as proof'), - (0.8, 'took video as evidence'), + (0.5, 'saved messages to document'), + (0.5, 'saved messages showing evidence'), + (0.8, 'took screenshot evidence'), + (0.8, 'took screenshots proving'), + (0.8, 'saved video proof'), + (0.8, 'took video as documentation'), (1.0, 'have confirmed'), (1.0, 'have confirmation'), - (1.0, 'know and can prove') + (1.0, 'know and can prove'), + (1.0, 'know and may reveal'), + (1.0, 'know and can show'), + ] my_family_words = [ + (0.5, 'dad'), + (0.5, 'mom'), + (0.5, 'god-father'), + (0.5, 'god father'), + (0.5, 'godfather'), (0.5, 'father'), (0.5, 'mother'), + (0.5, 'god-mother'), + (0.5, 'god mother'), + (0.5, 'godmother'), (1.0, 'brother'), (1.0, 'sister'), (0.2, 'older brother'), @@ -116,8 +159,12 @@ def random_select_weighted_list(ls): (0.7, 'nephew'), (0.7, 'niece'), (0.5, 'grandmother'), + (0.5, 'gram'), + (0.2, 'grammy'), + (0.5, 'oma'), (0.2, 'grandma'), (0.5, 'grandfather'), + (0.5, 'opa'), (0.2, 'grandpa'), (0.5, 'granddad'), (1.0, 'grandson'), @@ -225,23 +272,23 @@ def random_select_weighted_list(ls): ] my_teacher_possessive_adj = [ (k[0], k[1] + "'s ") for k in my_teacher_possessive_adj ] violated_words = [ - (5.0, 'violated'), + (3.0, 'violated'), (2.5, 'intentionally violated'), (2.5, 'knowingly violated'), (2.5, 'purposefully violated'), - (5.0, 'disregarded'), + (3.0, 'disregarded'), (2.5, 'intentionally disregarded'), (2.5, 'knowingly disregarded'), (2.5, 'purposefully disregarded'), - (5.0, 'disobeyed'), + (3.0, 'disobeyed'), (2.5, 'intentionally disobeyed'), (2.5, 'knowingly disobeyed'), (2.5, 'purposefully disobeyed'), - (5.0, 'broke'), + (3.0, 'broke'), (2.5, 'intentionally broke'), (2.5, 'knowingly broke'), (2.5, 'purposefully broke'), - (5.0, 'ignored'), + (3.0, 'ignored'), (2.5, 'intentionally ignored'), (2.5, 'knowingly ignored'), (2.5, 'purposefully ignored'), @@ -275,8 +322,9 @@ def random_select_weighted_list(ls): 'managed to get', 'illegally got', 'illegally had', 'unlawfully got', 'unlawfully had' ] past_time_frames = [ - 'last week', 'last month', 'this week', 'this month', 'yesterday', 'a week ago', 'two weeks ago', 'two days ago', 'on the weekend', - 'this weekend', 'last weekend', 'over the weekend', 'this last weekend' + 'last week', 'last month', 'this week', 'this month', 'yesterday', 'a week ago', 'one week ago', 'two weeks ago', + 'two days ago', 'on the weekend', 'this weekend', 'last weekend', 'over the weekend', 'this last weekend', + 'a day ago', '2 days ago', 'three days ago', '3 days ago' ] past_time_frames.extend([ 'last ' + k for k in days_of_the_week ]) past_time_frames.extend([ 'on ' + k for k in days_of_the_week ]) @@ -296,13 +344,13 @@ def random_select_weighted_list(ls): 'after she leaves work', 'after work', 'on the weekend', 'this weekend', 'next weekend', 'the weekend after next', 'three days from now', 'three days from today', 'right after work', 'just after work', 'tomorrow morning', 'tomorrow evening', 'next monday', 'next tuesday', 'next wednesday', 'next thursday', 'next friday', - 'this afternoon' + 'this afternoon', 'sometime tomorrow', 'in 2 days', 'in 3 days' ] future_time_frames.extend(['next ' + k for k in days_of_the_week]) future_time_frames.extend(['on ' + k for k in days_of_the_week]) abortion_ban_words = [ - 'ban', 'law', 'legislation', 'abortion law', 'abortion ban', 'abortion restriction', 'anti-abortion law', - 'anti-abortion legislation', 'abortion prohibition', 'ban on abortion' + 'ban', 'law', 'legislation', 'abortion law', 'legal code', 'abortion restriction', 'anti-abortion law', + 'anti-abortion legislation', 'abortion prohibition', 'abortion ban' ] abortion_ban_words = [*["Texas's " + k for k in abortion_ban_words], *["the " + k for k in abortion_ban_words]] abortion_ban_words.extend(['Texas law', 'the new law', 'Texas legislation', 'the new legislation', 'the new rule', @@ -331,7 +379,9 @@ def gen_abortion_prompt_My(accused): else: abortion_prompt += random.choice(will_get_words) abortion_prompt += ' an' - abortion_prompt += random.choices(['', ' illegal', ' unlawful', ' illicit', ' aspiration'], weights=[0.20, 0.20, 0.20, 0.20, 0.20], k=1)[0] + abortion_prompt += random.choices(['', ' illegal', ' unlawful', ' illicit', ' aspiration', 'unauthorized', + 'unsanctioned', 'outlawed', 'unjust', 'unrighteous'], weights=[0.125, 0.125, + 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125], k=1)[0] abortion_prompt += ' abortion' if random.random() > 0.5: abortion_prompt += ' ' From 4785f20c14143e841b020262d3140acdec1f4851 Mon Sep 17 00:00:00 2001 From: Digital-Black <44770198+Digital-Black@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:46:48 -0400 Subject: [PATCH 2/2] Fixed an issue with string spacing Fixed new list elements added which did not account for a hard-coded space between words. --- bot/prompt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/prompt.py b/bot/prompt.py index 5c23e42..b75c70e 100644 --- a/bot/prompt.py +++ b/bot/prompt.py @@ -379,9 +379,9 @@ def gen_abortion_prompt_My(accused): else: abortion_prompt += random.choice(will_get_words) abortion_prompt += ' an' - abortion_prompt += random.choices(['', ' illegal', ' unlawful', ' illicit', ' aspiration', 'unauthorized', - 'unsanctioned', 'outlawed', 'unjust', 'unrighteous'], weights=[0.125, 0.125, - 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125], k=1)[0] + abortion_prompt += random.choices(['', ' illegal', ' unlawful', ' illicit', ' aspiration', ' unauthorized', + ' unsanctioned', ' outlawed', ' unjust', ' unrighteous'], + weights=[0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125], k=1)[0] abortion_prompt += ' abortion' if random.random() > 0.5: abortion_prompt += ' '