tensorgirl commited on
Commit
62528eb
1 Parent(s): a87e18a

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +13 -7
utils.py CHANGED
@@ -73,19 +73,25 @@ def summary(input_json):
73
  if filtering_results[0] == 0:
74
  #return 0
75
  return filtering_results[1]
76
-
77
  id = desc_list.index(input_json['Descriptor'])
78
  long_text = filtering_results[1]
79
 
80
- output['mobile'] = call(promptShort[id], long_text)
 
 
 
 
 
 
81
 
82
- output['web'] = call(promptLong[id], long_text)
83
 
84
  prompt = "1 word Financial SEO tag for this news article"
85
- output['tag'] = call(prompt, output['mobile'])
86
 
87
  prompt = "Give a single headline for this News Article"
88
- output['headline'] = call(prompt, output['web'])
89
 
90
  utc_now = datetime.datetime.utcnow()
91
  ist_now = utc_now.astimezone(datetime.timezone(datetime.timedelta(hours=5, minutes=30)))
@@ -95,7 +101,7 @@ def summary(input_json):
95
  output['Date'] = f"{ist_now.day} {month_name}, {ist_now.year}"
96
 
97
  prompt = "Answer in one word the sentiment of this News out of Positive, Negative or Neutral {}"
98
- output['sentiment'] = call(prompt, output['web'])
99
 
100
  time.sleep(60)
101
  # response = client.images.generate(
@@ -105,6 +111,6 @@ def summary(input_json):
105
  # quality="standard",
106
  # n=1
107
  # )
108
- # output["image_url"] = response.data[0].url
109
 
110
  return output
 
73
  if filtering_results[0] == 0:
74
  #return 0
75
  return filtering_results[1]
76
+
77
  id = desc_list.index(input_json['Descriptor'])
78
  long_text = filtering_results[1]
79
 
80
+ url = 'https://www.bseindia.com/xml-data/corpfiling/AttachLive/'+ input_json['FileURL'].split('Pname=')[-1]
81
+
82
+ ouput["Link to BSE website"] = url
83
+
84
+ output["Stock Ticker"] = input_json['symbol']
85
+
86
+ output['Short Summary'] = call(promptShort[id], long_text)
87
 
88
+ output['Long summary'] = call(promptLong[id], long_text)
89
 
90
  prompt = "1 word Financial SEO tag for this news article"
91
+ output['Tag'] = call(prompt, output['mobile'])
92
 
93
  prompt = "Give a single headline for this News Article"
94
+ output['Headline'] = call(prompt, output['web'])
95
 
96
  utc_now = datetime.datetime.utcnow()
97
  ist_now = utc_now.astimezone(datetime.timezone(datetime.timedelta(hours=5, minutes=30)))
 
101
  output['Date'] = f"{ist_now.day} {month_name}, {ist_now.year}"
102
 
103
  prompt = "Answer in one word the sentiment of this News out of Positive, Negative or Neutral {}"
104
+ output['Sentiment'] = call(prompt, output['web'])
105
 
106
  time.sleep(60)
107
  # response = client.images.generate(
 
111
  # quality="standard",
112
  # n=1
113
  # )
114
+ # output["Link to Infographic (data visualization only)] = response.data[0].url
115
 
116
  return output