simonschoe commited on
Commit
53e63bc
1 Parent(s): 75d5899

update app interface

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -38,30 +38,32 @@ with app:
38
  gr.Markdown("## Detect Transformation Sentences in Quarterly Earnings Conference Calls")
39
  with gr.Row():
40
  with gr.Column():
41
- text_in = gr.Textbox(lines=1, placeholder="Insert text", label="Search Query")
42
  with gr.Row():
43
- compute_bt = gr.Button("Calculate")
44
- score_out = gr.Number(label="Label 1 probability", interactive=False)
45
  html_out = gr.HTML(label="Explanation")
46
  with gr.Column():
47
  gr.Markdown(
48
  """
49
  #### Project Description
50
- Call2Vec is a [fastText](https://fasttext.cc/) word embedding model trained via [Gensim](https://radimrehurek.com/gensim/). It maps each token in the vocabulary into a dense, 300-dimensional vector space, designed for performing semantic search.
51
- The model is trained on a large sample of quarterly earnings conference calls, held by U.S. firms during the 2006-2022 period. In particular, the training data is restriced to the (rather sponentous) executives' remarks of the Q&A section of the call. The data has been preprocessed prior to model training via stop word removal, lemmatization, named entity masking, and coocurrence modeling.
52
  """
53
  )
54
  gr.Markdown(
55
  """
56
  #### App usage
57
- The model is intented to be used for **semantic search**: It encodes the search query (entered in the textbox on the right) in a dense vector space and finds semantic neighbours, i.e., token which frequently occur within similar contexts in the underlying training data.
58
- The model allows for two use cases:
59
- 1. *Single Search:* The input query consists of a single word. When provided a bi-, tri-, or even fourgram, the quality of the model output depends on the presence of the query token in the model's vocabulary. N-grams should be concated by an underscore (e.g., "machine_learning" or "artifical_intelligence").
60
- 2. *Multi Search:* The input query may consist of several words or n-grams, seperated by comma, semi-colon or newline. It then computes the average vector over all inputs and performs semantic search based on the average input token.
61
  """
62
  )
63
  gr.Examples(
64
- examples=[["Now Accord networks is a company in video, and he led the sales team, and the marketing group at Accord, and he took it from start up, sound familiar, it's from start up to $60 million company in two years."], ["Another test sentence"], ["Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam"]],
 
 
 
 
65
  inputs=[text_in],
66
  outputs=[score_out, html_out],
67
  fn=classify,
@@ -72,7 +74,7 @@ with app:
72
  <p style="text-align: center;">
73
  TIClassifier by X and Y
74
  <br>
75
- <img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=simonschoe.call2vec&left_color=green&right_color=blue" style="display: block; margin-left: auto; margin-right: auto;"/>
76
  </p>
77
  """
78
  )
 
38
  gr.Markdown("## Detect Transformation Sentences in Quarterly Earnings Conference Calls")
39
  with gr.Row():
40
  with gr.Column():
41
+ text_in = gr.Textbox(lines=1, placeholder="Insert text", label="Input Sentence")
42
  with gr.Row():
43
+ compute_bt = gr.Button("Classify")
44
+ score_out = gr.Number(label="Score", interactive=False)
45
  html_out = gr.HTML(label="Explanation")
46
  with gr.Column():
47
  gr.Markdown(
48
  """
49
  #### Project Description
50
+ Placeholder
 
51
  """
52
  )
53
  gr.Markdown(
54
  """
55
  #### App usage
56
+ The model is intented to be used for **sequence classification**: It encodes the input sentence (entered in the textbox on the left) in a dense vector space and runs it through a deep neural network classifier (*Distill-RoBERTa*).
57
+ It returns a confidence score that indicates the probability of the sentence containing a discussion on transformation activities. A value of 1 (0) signals a high confidence of the sentence being transformation-related (generic). A score in the range of [0.25; 0.75] implies that the model is rather undecided about the correct label.
58
+ In addition, the app returns the tokenized version of the sentence, alongside word importances that are indicated by color codes. Those visuals illustrates the ability of the context-aware classifier to simultaneously pay attention to various parts in the input sentence to derive a final label.
 
59
  """
60
  )
61
  gr.Examples(
62
+ examples=[
63
+ ["If we look at the plans for 2018, it is to introduce 650 new products, which is an absolute all- time high."],
64
+ ["We have been doing kind of an integrated campaign, so it's TV, online, we do the Google Ad Words - all those different elements together."],
65
+ ["So that turned out to be beneficial for us, and I think, we'll just see how the market and interest rates move over the course of the year,"]
66
+ ],
67
  inputs=[text_in],
68
  outputs=[score_out, html_out],
69
  fn=classify,
 
74
  <p style="text-align: center;">
75
  TIClassifier by X and Y
76
  <br>
77
+ <img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=simonschoe.TIC&left_color=green&right_color=blue" style="display: block; margin-left: auto; margin-right: auto;"/>
78
  </p>
79
  """
80
  )