robertselvam commited on
Commit
48537c4
1 Parent(s): 15ffa22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -42,7 +42,7 @@ class KeyValueExtractor:
42
  pdf_file_path (str): The path to the input PDF file.
43
  """
44
  self.model = "facebook/bart-large-mnli"
45
- openai.api_key = os.environ.get("OPENAI_API_KEY")
46
 
47
  def get_url(self,keyword):
48
  return f"https://finance.yahoo.com/quote/{keyword}?p={keyword}"
@@ -113,7 +113,7 @@ class KeyValueExtractor:
113
  return result["output_text"]
114
 
115
  def one_day_summary(self,content) -> None:
116
-
117
 
118
  # Use OpenAI's Completion API to analyze the text and extract key-value pairs
119
  response = openai.Completion.create(
@@ -269,7 +269,7 @@ class KeyValueExtractor:
269
  output_file_path = self.save_dataframe_in_text_file(df)
270
  docs = self.csv_loader(output_file_path)
271
  split_docs = self.document_text_spilliter(docs)
272
-
273
  prompt_template = """Analyze the Financial Details and Write a abractive quick short summary how the company perform up and down,Bullish/Bearish of the following:
274
  {text}
275
  CONCISE SUMMARY:"""
 
42
  pdf_file_path (str): The path to the input PDF file.
43
  """
44
  self.model = "facebook/bart-large-mnli"
45
+
46
 
47
  def get_url(self,keyword):
48
  return f"https://finance.yahoo.com/quote/{keyword}?p={keyword}"
 
113
  return result["output_text"]
114
 
115
  def one_day_summary(self,content) -> None:
116
+ openai.api_key = os.getenv("OPENAI_API_KEY")
117
 
118
  # Use OpenAI's Completion API to analyze the text and extract key-value pairs
119
  response = openai.Completion.create(
 
269
  output_file_path = self.save_dataframe_in_text_file(df)
270
  docs = self.csv_loader(output_file_path)
271
  split_docs = self.document_text_spilliter(docs)
272
+
273
  prompt_template = """Analyze the Financial Details and Write a abractive quick short summary how the company perform up and down,Bullish/Bearish of the following:
274
  {text}
275
  CONCISE SUMMARY:"""