KaziRahman commited on
Commit
32cf6bd
·
1 Parent(s): 8ff3194

Changed Summerizer Model

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -3,7 +3,7 @@ from transformers import pipeline
3
 
4
  # Load the sentiment analysis, keyword extraction, and text summarization models from Hugging Face
5
  sentiment_model = pipeline("sentiment-analysis")
6
- summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
7
  keyword_extraction_model = pipeline(
8
  "text2text-generation", model="transformer3/keywordextractor"
9
  )
@@ -27,13 +27,12 @@ def analyze_text(text):
27
  summary = summarizer(text, max_length=130, min_length=30, do_sample=False)
28
 
29
  # return f"Sentiment: {sentiment}, Score: {sentiment_score}\nKeywords: {keywords}\nSummary: {summary}"
30
- # return {
31
- # "sentiment": sentiment,
32
- # "sentiment_score": sentiment_score,
33
- # "keywords": keywords,
34
- # "summary": summary,
35
- # }
36
- return "test String Only"
37
 
38
  # Create the Gradio interface
39
  iface = gr.Interface(fn=analyze_text, inputs="text", outputs="text")
 
3
 
4
  # Load the sentiment analysis, keyword extraction, and text summarization models from Hugging Face
5
  sentiment_model = pipeline("sentiment-analysis")
6
+ summarizer = pipeline("summarization", model="knkarthick/MEETING_SUMMARY")
7
  keyword_extraction_model = pipeline(
8
  "text2text-generation", model="transformer3/keywordextractor"
9
  )
 
27
  summary = summarizer(text, max_length=130, min_length=30, do_sample=False)
28
 
29
  # return f"Sentiment: {sentiment}, Score: {sentiment_score}\nKeywords: {keywords}\nSummary: {summary}"
30
+ return {
31
+ "sentiment": sentiment,
32
+ "sentiment_score": sentiment_score,
33
+ "keywords": keywords,
34
+ "summary": summary,
35
+ }
 
36
 
37
  # Create the Gradio interface
38
  iface = gr.Interface(fn=analyze_text, inputs="text", outputs="text")