dk-crazydiv commited on
Commit
a584f19
·
1 Parent(s): a490fc1

Added rhetoric classifier

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -16,6 +16,8 @@ def generate_hashtags(input):
16
  input_prompt = "This program takes an input and reframes it by removing negative words and rephrasing with with positivity while preserving the meaning of the original sentence. The word 'no' doesn't appear in the output\n--\nInput: I wouldn’t say I don’t want to go.\nOutput: I would like to go.\n--\nInput: That’s not a bad idea.\nOutput: That is a good idea.\n--\nInput: {}\nOutput:".format(input.strip())
17
  if category == "self_affirmation":
18
  input_prompt = "This program takes an input and reframes it with positive affirmations.\n-- \nInput: I am worthless\nOutput: I have value and my actions impact the world around me.\n--\nInput: I am a failure\nOutput: I never fail, only my attempts do. I will keep trying and improving\n--\nInput: I don’t like myself\nOutput: I accept myself and improve what I can.\n--\nInput: {}\nOutput:".format(input.strip())
 
 
19
  response = co.generate(
20
  model='xlarge',
21
  prompt=input_prompt,
@@ -38,7 +40,7 @@ input = st.text_area('Enter your post title caption here', height=100)
38
 
39
  category = st.radio(
40
  "Please select a category",
41
- ('growth', 'remove_negations', 'self_affirmation'))
42
 
43
  if st.button('Reframe'):
44
  output = generate_hashtags(input)
 
16
  input_prompt = "This program takes an input and reframes it by removing negative words and rephrasing with with positivity while preserving the meaning of the original sentence. The word 'no' doesn't appear in the output\n--\nInput: I wouldn’t say I don’t want to go.\nOutput: I would like to go.\n--\nInput: That’s not a bad idea.\nOutput: That is a good idea.\n--\nInput: {}\nOutput:".format(input.strip())
17
  if category == "self_affirmation":
18
  input_prompt = "This program takes an input and reframes it with positive affirmations.\n-- \nInput: I am worthless\nOutput: I have value and my actions impact the world around me.\n--\nInput: I am a failure\nOutput: I never fail, only my attempts do. I will keep trying and improving\n--\nInput: I don’t like myself\nOutput: I accept myself and improve what I can.\n--\nInput: {}\nOutput:".format(input.strip())
19
+ if category == "detect_rhetoric":
20
+ input_prompt = "This program takes an input and tells if it is rhetoric or not.\n--\nInput: Are you kidding me?\nOutput: rhetoric\n--\nInput: How should I know?\nOutput: rhetoric\n--\nInput: How much does this cost?\nOutput: not rhetoric\n--\nInput: Do you know the answer to this problem?\nOutput: not rhetoric\n--\nInput: Is this for real?\nOutput: rhetoric\n--\nInput: Can you please finish this task by monday?\nOutput: not rhetoric\n--\nInput:{}\nOutput:".format(input.strip())
21
  response = co.generate(
22
  model='xlarge',
23
  prompt=input_prompt,
 
40
 
41
  category = st.radio(
42
  "Please select a category",
43
+ ('growth', 'remove_negations', 'self_affirmation', 'detect_rhetoric'))
44
 
45
  if st.button('Reframe'):
46
  output = generate_hashtags(input)