File size: 4,333 Bytes
a082fed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
#vitamin D
def get_correct_desc(input_text):
if input_text == "There was no fish taste":
text1 = "This supplement works great and is tasteless."
text2 = "These are a great supplement and I feel like they help me stay more energetic regularly. They are easy to take and have an excellent taste/smell. The ingredients are quality as well! These vitamins helped me when I was having difficulty with sleep, in my opinion, although it's quite subjective."
text3 = "Supports Healthy Bones & Teeth."
elif input_text == "I liked it":
text1 = "This supplement has many benefits."
text2 = "I'm a Vegan, very active in my diet, and I've been taking this vitamin for over 4 months. There's been a noticeable improvement in my health and energy levels on top of the well-documented benefits of Vitamins. Highly recommend!"
text3 = "Supports Healthy Immune System Function."
else:
text1 = "I feel amazing after using this product."
text2 = "My name is Jessica, I've been taking this vitamin for the last few days and it's been amazing. It has increased my energy, made me feel stronger, helped improve my mood, immune system and overall well being. I would recommend this product to anyone who needs a little boost in their health and quality of life."
text3 = "Formulated to Contain: No Gluten, No GMOs, No Soy."
return text1, text2, text3
#Ashwagandha Extract
def get_correct_desc1(input_text1):
if input_text1 == "Helped with my energy levels":
text4 = "This supplement works great and is tasteless."
text5 = "I've tried two other ashwagandha brands (Jarrow Formulas and Himalaya and think this one is the strongest. They're all pretty good though. You can feel the calming relaxing effects in about 10 minutes. Great for getting to sleep. When I use it daily, (for the overall tonic and pro-thyroid effects)I find the relaxing effects wear off. For better sleep, I just stop using it for a couple of days and start again. I really like ashwagandha, and this brand."
text6 = "Free Radical Scavenger"
elif input_text1 == "No Smell":
text4 = "This supplement has many benefits."
text5 = "Ashwaghanda can smell bad but this product has no odor at all, which makes it easy to take."
text6 = "Immune System Support"
else:
text4 = "I feel amazing after using this product."
text5 = "Gives me a good night's sleep without feeling hungover in the morning."
text6 = "Non-GMO"
import gradio as gr
demo = gr.Blocks()
image = """
<center>
<img src="https://www.springml.com/wp-content/uploads/2018/01/SpringML-Logo-200x50-1.png" width=200px>
</center>
"""
with demo:
gr.Markdown(image)
with gr.Tabs():
with gr.TabItem("Vitamin D"):
with gr.Row():
#input object 1
in1 = gr.Dropdown(["There was no fish taste", "I liked it" ,"I feel better"])
#output object1
out1 = gr.Textbox(label = "Key Phase Choice" , show_label = True)
#output object 2
out2= gr.Textbox(label="Helpful Review", show_label = True)
#output object 3
out3 = gr.Textbox(label="Product Descriptor", line = 7 , show_label = True)
text_button = gr.Button("Select the option from dropdown option and then click here")
with gr.TabItem("Ashwagandha Extract"):
with gr.Row():
#input object 2
in2 = gr.Dropdown(["Helped with my energy levels", "No Smell" ,"Helped with sleep"])
#output object 4
out4 = gr.Textbox(label = "Key Phase Choice" , show_label = True,lines = 2)
#output object 5
out5= gr.Textbox(label="Helpful Review", show_label = True,lines = 2,max_lines=99)
#output object 6
out6 = gr.Textbox(label="Product Descriptor", line = 2 , show_label = True)
text_button1 = gr.Button("Select the option from dropdown and then click here")
text_button.click(fn=get_correct_desc,inputs=in1,outputs=[out1, out2, out3])
text_button1.click(fn=get_correct_desc1,inputs=in2,outputs=[out4, out5, out6])
demo.launch() |