robertselvam commited on
Commit
6b8138e
·
1 Parent(s): 6fba339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -53
app.py CHANGED
@@ -316,68 +316,30 @@ class KeyValueExtractor:
316
 
317
  return clean_summary, key_value
318
 
 
 
 
 
319
  def gradio_interface(self):
320
 
321
  with gr.Blocks(css="style.css",theme= 'karthikeyan-adople/hudsonhayes-gray') as app:
322
  gr.HTML("""<center class="darkblue" style='background-color:rgb(0,1,36); text-align:center;padding:25px;'><center><h1 class ="center">
323
  <img src="file=logo.png" height="110px" width="280px"></h1></center>
324
  <br><h1 style="color:#fff">summarizer</h1></center>""")
325
- with gr.Accordion("List_of_Companies", open = False):
326
- with gr.Row(elem_id="col-container"):
327
- with gr.Column(scale=1.0, min_width=150 ):
328
- list_of_companies = gr.HTML(value="""Apple Inc. - AAPL
329
- Microsoft Corporation - MSFT
330
- Amazon.com Inc. - AMZN
331
- Alphabet Inc. (Google) - GOOGL (Class A shares), GOOG (Class C shares)
332
- Facebook Inc. - FB
333
- Tesla Inc. - TSLA
334
- Netflix Inc. - NFLX
335
- NVIDIA Corporation - NVDA
336
- Intel Corporation - INTC
337
- The Coca-Cola Company - KO
338
- Pfizer Inc. - PFE
339
- Johnson & Johnson - JNJ
340
- Procter & Gamble Co. - PG
341
- Visa Inc. - V
342
- Mastercard Incorporated - MA
343
- Walmart Inc. - WMT
344
- Adobe Inc. - ADBE
345
- Salesforce.com Inc. - CRM
346
- IBM (International Business Machines Corporation) - IBM
347
- McDonald's Corporation - MCD
348
- Boeing Co. - BA
349
- The Walt Disney Company - DIS
350
- JPMorgan Chase & Co. - JPM
351
- Goldman Sachs Group Inc. - GS
352
- Verizon Communications Inc. - VZ
353
- AT&T Inc. - T
354
- General Electric Co. - GE
355
- Exxon Mobil Corporation - XOM
356
- Chevron Corporation - CVX
357
- Coca-Cola Enterprises Inc. - CCEP
358
- Nike Inc. - NKE
359
- PepsiCo Inc. - PEP
360
- Oracle Corporation - ORCL
361
- Cisco Systems Inc. - CSCO
362
- Intel Corporation - INTC
363
- Netflix Inc. - NFLX
364
- Walmart Inc. - WMT
365
- PayPal Holdings Inc. - PYPL
366
- Square Inc. - SQ
367
- Adobe Inc. - ADBE
368
- Zoom Video Communications Inc. - ZM
369
- Moderna Inc. - MRNA
370
- Twitter Inc. - TWTR
371
- Airbnb Inc. - ABNB
372
- Uber Technologies Inc. - UBER
373
- Lyft Inc. - LYFT
374
- Snap Inc. - SNAP
375
- Spotify Technology S.A. - SPOT
376
- Pinterest Inc. - PINS
377
- Beyond Meat Inc. - BYND""")
378
  with gr.Row(elem_id="col-container"):
379
  with gr.Column(scale=1.0, min_width=150, ):
380
  input_news = gr.Textbox(label="Company Name")
 
 
 
 
 
 
 
 
 
 
 
381
  with gr.Row(elem_id="col-container"):
382
  with gr.Column(scale=1.0, min_width=150):
383
  analyse = gr.Button("Analyse")
 
316
 
317
  return clean_summary, key_value
318
 
319
+ def company_names(self,input_text):
320
+ words = input_text.split("-")
321
+ return words[1]
322
+
323
  def gradio_interface(self):
324
 
325
  with gr.Blocks(css="style.css",theme= 'karthikeyan-adople/hudsonhayes-gray') as app:
326
  gr.HTML("""<center class="darkblue" style='background-color:rgb(0,1,36); text-align:center;padding:25px;'><center><h1 class ="center">
327
  <img src="file=logo.png" height="110px" width="280px"></h1></center>
328
  <br><h1 style="color:#fff">summarizer</h1></center>""")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  with gr.Row(elem_id="col-container"):
330
  with gr.Column(scale=1.0, min_width=150, ):
331
  input_news = gr.Textbox(label="Company Name")
332
+ with gr.Accordion("List_of_Companies", open = False):
333
+ with gr.Row(elem_id="col-container"):
334
+ with gr.Column(scale=1.0, min_width=150 ):
335
+ gr.Examples(
336
+ [["Apple Inc. - AAPL"], ["Microsoft Corporation - MSFT"],["Amazon.com Inc. - AMZN"],["Facebook Inc. - FB"],["Tesla Inc. - TSLA"]],
337
+ [input_news],
338
+ input_news,
339
+ fn=self.company_names,
340
+ cache_examples=True,
341
+ )
342
+
343
  with gr.Row(elem_id="col-container"):
344
  with gr.Column(scale=1.0, min_width=150):
345
  analyse = gr.Button("Analyse")