fabianzarncke commited on
Commit
7e3e64b
·
verified ·
1 Parent(s): 2513166

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -13,7 +13,7 @@ def preprocess_user_input(input_text):
13
  return processed_text
14
 
15
 
16
- def full_auto_adjective_replacement(input_text)
17
 
18
  system_message = "In the following prompt replace all biased adjectives with neutral synonyms. And only return me the modified prompt. Here is an example: Inhowfar is buying gold stingy? becomes: Inhowfar is buying gold economical?"
19
 
@@ -25,7 +25,7 @@ def full_auto_adjective_replacement(input_text)
25
  return processed_promt
26
 
27
 
28
- def full_adjective_replacement(input_text)
29
 
30
 
31
  adjectives = get_adjectives(input_text)
@@ -54,7 +54,7 @@ def get_adjectives(input_text):
54
  return adjectives
55
 
56
 
57
- def determine_biased_adjective(input_text, adjective)
58
 
59
  system_message = "Determine wether the following adjective is biased in the following Text. Return only yes or no as a single word."
60
 
@@ -68,7 +68,7 @@ def determine_biased_adjective(input_text, adjective)
68
  return false
69
 
70
 
71
- def replace_biased_adjective(adjective)
72
 
73
  system_message = "Replace the following adjective with a more neutral one. Return only the new adjective as a single word."
74
 
@@ -77,7 +77,7 @@ def replace_biased_adjective(adjective)
77
  return new_adjective
78
 
79
 
80
- def replace_adjective_in_text(input_text, old_adjective, new_adjective)
81
 
82
  processed_text = input_text.replace(old_adjective, new_adjective)
83
 
 
13
  return processed_text
14
 
15
 
16
+ def full_auto_adjective_replacement(input_text):
17
 
18
  system_message = "In the following prompt replace all biased adjectives with neutral synonyms. And only return me the modified prompt. Here is an example: Inhowfar is buying gold stingy? becomes: Inhowfar is buying gold economical?"
19
 
 
25
  return processed_promt
26
 
27
 
28
+ def full_adjective_replacement(input_text):
29
 
30
 
31
  adjectives = get_adjectives(input_text)
 
54
  return adjectives
55
 
56
 
57
+ def determine_biased_adjective(input_text, adjective):
58
 
59
  system_message = "Determine wether the following adjective is biased in the following Text. Return only yes or no as a single word."
60
 
 
68
  return false
69
 
70
 
71
+ def replace_biased_adjective(adjective):
72
 
73
  system_message = "Replace the following adjective with a more neutral one. Return only the new adjective as a single word."
74
 
 
77
  return new_adjective
78
 
79
 
80
+ def replace_adjective_in_text(input_text, old_adjective, new_adjective):
81
 
82
  processed_text = input_text.replace(old_adjective, new_adjective)
83