curtpond commited on
Commit
e5d6638
1 Parent(s): cbd3f4c

Updated app.py to start with very short examples.

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -12,15 +12,14 @@ def predict(text):
12
 
13
  # Define interface
14
  iface = gr.Interface(fn=predict,
15
- inputs=gr.inputs.Textbox(lines=10, label="Text"),
16
- outputs="text",
17
  title="Text Classification",
18
  description="Classify text as other[0], healthcare[1], or technology[2]",
19
  examples=[
20
- 'As a psychologist, I often hear stories about fighting. After all, conflict is a normal part of any relationship and, during heated conversations, feelings of anger and frustration can swell, causing us to snap at our partners. However, when I hear about people who make threats, resort to name-calling, and yell whenever they get riled up, I get concerned. It’s normal to lose one\'s cool occasionally if you’re arguing with your partner about something, but if these verbal slingshots happen regularly, it may be a sign of emotional abuse. Because the signs may be subtle, discerning between a heated argument and verbal abuse can be tricky.',
21
- 'Google welcomed a decision on Monday by London’s High Court to block an attempt to bring legal action over claims it had collected sensitive data from 4 million iPhone users in England and Wales.',
22
- 'The U.S. Food and Drug Administration on Monday approved the first drug to treat a rare genetic disorder that causes severe muscle weakness and fatigue, the agency said in a statement.'
23
- 'The success of Hudson’s Bay Co Executive Chairman Richard Baker’s $1.3 billion bid to take the department store operator private hinges on whether an independent valuator will view the company more as a retailer and less as a real estate owner, corporate governance experts and analysts said.'],
24
  allow_flagging='never'
25
  )
26
 
 
12
 
13
  # Define interface
14
  iface = gr.Interface(fn=predict,
15
+ inputs=gr.inputs.Textbox(lines=10, label="Input Text"),
16
+ outputs="Text Classification Results: {other[0], healthcare[1], technology[2]}",
17
  title="Text Classification",
18
  description="Classify text as other[0], healthcare[1], or technology[2]",
19
  examples=[
20
+ ['This is a text about healthcare'],
21
+ ['This is a text about technology'],
22
+ ['This is a text about other']],
 
23
  allow_flagging='never'
24
  )
25