Hanna Abi Akl commited on
Commit
38e02fd
1 Parent(s): bd17aeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -52,7 +52,13 @@ def predict(model_name, text):
52
  result[config.id2label[idx]] = float(label)
53
  return result
54
  if __name__ == '__main__':
55
- text = 'An A-B trust is a joint trust created by a married couple for the purpose of minimizing estate taxes.'
 
 
 
 
 
 
56
  model_name_list = [
57
  'yseop/distilbert-base-financial-relation-extraction'
58
  ]
@@ -60,8 +66,8 @@ if __name__ == '__main__':
60
  app = gr.Interface(
61
  fn=predict,
62
  inputs=[gr.inputs.Dropdown(model_name_list, label="Model Name"), 'text'], outputs=['label'],
63
- examples = [[MODEL_BUF["name"], text]],
64
- title="FReE",
65
- description="Financial relations classifier"
66
  )
67
  app.launch(inline=False)
 
52
  result[config.id2label[idx]] = float(label)
53
  return result
54
  if __name__ == '__main__':
55
+ text1 = 'An A-B trust is a joint trust created by a married couple for the purpose of minimizing estate taxes.'
56
+ text2 = 'For example, if the supply of reserves in the fed funds market is greater than the demand, then the fed funds rate falls, and if the supply of reserves is less than the demand, the rate rises.'
57
+ text3 = 'Coupon dates are the dates on which the bond issuer will make interest payments.'
58
+ text4 = "Two features of a bond—credit quality and time to maturity—are the principal determinants of a bond's coupon rate."
59
+ text5 = "When an investment sale is less than a standard lot, it's referred to as a job lot."
60
+ text6 = 'Most bonds can be sold by the initial bondholder to other investors after they have been issued.'
61
+ text7 = 'A bond could be thought of as an I.O.U. between the lender and borrower.'
62
  model_name_list = [
63
  'yseop/distilbert-base-financial-relation-extraction'
64
  ]
 
66
  app = gr.Interface(
67
  fn=predict,
68
  inputs=[gr.inputs.Dropdown(model_name_list, label="Model Name"), 'text'], outputs=['label'],
69
+ examples = [[MODEL_BUF["name"], text1], [MODEL_BUF["name"], text2], [MODEL_BUF["name"], text3], [MODEL_BUF["name"], text4], [MODEL_BUF["name"], text5], [MODEL_BUF["name"], text6], [MODEL_BUF["name"], text7]],
70
+ title="FReE (Financial Relation Extraction)",
71
+ description="A model capable of detecting the presence of a relationship between financial terms and qualifying the relationship in case of its presence."
72
  )
73
  app.launch(inline=False)