Karthikeyan commited on
Commit
52259cd
1 Parent(s): 43e1c6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -16,7 +16,6 @@ import plotly.express as px
16
  class SentimentAnalyzer:
17
  def __init__(self):
18
  self.model="facebook/bart-large-mnli"
19
- openai.api_key = "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"
20
  def analyze_sentiment(self, text):
21
  pipe = pipeline("zero-shot-classification", model=self.model)
22
  label=["positive","negative","neutral"]
@@ -66,8 +65,7 @@ Please analyze the text and provide the output in the following format: emotion:
66
 
67
  class Summarizer:
68
  def __init__(self):
69
- openai.api_key = "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"
70
-
71
  def generate_summary(self, text):
72
  model_engine = "text-davinci-003"
73
  prompt = f"""summarize the following conversation delimited by triple backticks.
@@ -91,8 +89,7 @@ sentiment = SentimentAnalyzer()
91
  class LangChain_Document_QA:
92
 
93
  def __init__(self):
94
- openai_api_key ='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'
95
- os.environ["OPENAI_API_KEY"] = openai_api_key
96
 
97
  def _add_text(self,history, text):
98
  history = history + [(text, None)]
 
16
  class SentimentAnalyzer:
17
  def __init__(self):
18
  self.model="facebook/bart-large-mnli"
 
19
  def analyze_sentiment(self, text):
20
  pipe = pipeline("zero-shot-classification", model=self.model)
21
  label=["positive","negative","neutral"]
 
65
 
66
  class Summarizer:
67
  def __init__(self):
68
+ pass
 
69
  def generate_summary(self, text):
70
  model_engine = "text-davinci-003"
71
  prompt = f"""summarize the following conversation delimited by triple backticks.
 
89
  class LangChain_Document_QA:
90
 
91
  def __init__(self):
92
+ pass
 
93
 
94
  def _add_text(self,history, text):
95
  history = history + [(text, None)]