Denver Citizen9 commited on
Commit
e6efd22
1 Parent(s): 7affa44

random topics

Browse files
Files changed (1) hide show
  1. app.py +27 -3
app.py CHANGED
@@ -20,6 +20,28 @@ def launch_demo():
20
  "Taste/Culture",
21
  "Cooking Skills"
22
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  def analyze_input(category, text):
25
  result = analyze_data(category, text)
@@ -29,9 +51,11 @@ def launch_demo():
29
  text_input = gr.components.Textbox(label="Enter Text")
30
  output = gr.components.Textbox(label="Analysis Result")
31
 
 
 
 
32
  examples = [
33
- [random.choice(categories), "Example input 1"],
34
- [random.choice(categories), "Example input 2"],
35
  ]
36
 
37
  gr.Interface(
@@ -40,7 +64,7 @@ def launch_demo():
40
  outputs=output,
41
  examples=examples,
42
  title="Data Analyzer",
43
- description="Select a category, enter text, and click Submit to analyze the data.",
44
  theme="default",
45
  ).launch()
46
 
 
20
  "Taste/Culture",
21
  "Cooking Skills"
22
  ]
23
+
24
+
25
+ topics = [
26
+ "Holidays",
27
+ "Plants",
28
+ "Animals",
29
+ "Countries",
30
+ "Pop Culture",
31
+ "Religion",
32
+ "Lifestyle",
33
+ "Environment",
34
+ "Technology",
35
+ "Sports",
36
+ "Music",
37
+ "Space/Astronomy",
38
+ "Food and Cooking",
39
+ "History",
40
+ "Travel",
41
+ "Education",
42
+ "Health and Fitness",
43
+ "Movies/TV Shows"
44
+ ]
45
 
46
  def analyze_input(category, text):
47
  result = analyze_data(category, text)
 
51
  text_input = gr.components.Textbox(label="Enter Text")
52
  output = gr.components.Textbox(label="Analysis Result")
53
 
54
+ rando_choice = [random.choice(categories)
55
+ rando_topic = [random.choice(topics)
56
+
57
  examples = [
58
+ rando_choice, rando_topic],
 
59
  ]
60
 
61
  gr.Interface(
 
64
  outputs=output,
65
  examples=examples,
66
  title="Data Analyzer",
67
+ description="Select a category, enter text, and click Submit.",
68
  theme="default",
69
  ).launch()
70