domro11 commited on
Commit
6f3fdbc
·
1 Parent(s): 216fb76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -87,20 +87,15 @@ def main():
87
  elif choice=="Keyword Extractor":
88
  st.subheader("Keyword Extraction")
89
  #loading the pipeline
90
- sentiment_analysis = pipeline("sentiment-analysis")
91
- raw_text = st.text_area("Enter some text:")
92
- model_name = "yanekyuk/bert-uncased-keyword"
93
- keyword_extractor = pipeline("text2text-generation", model=model_name, tokenizer=model_name, config={"wordwise": True})
94
 
95
- if raw_text !="Enter Text Here":
96
- if st.button("Extract Keywords"):
97
- # Extract keywords using the model
98
- keywords = keyword_extractor(input_text, max_length=20, do_sample=False)[0]["generated_text"]
99
- # Display the extracted keywords
100
- st.write("Keywords:", keywords)
101
-
102
-
103
- # Load the keyword extraction model
104
 
105
 
106
  elif choice=="Question Answering":
 
87
  elif choice=="Keyword Extractor":
88
  st.subheader("Keyword Extraction")
89
  #loading the pipeline
90
+ model_name = "yanekyuk/bert-uncased-keyword"
91
+ keyword_extractor = pipeline("text2text-generation", model=model_name, tokenizer=model_name, config={"wordwise": True})
92
+ input_text = st.text_area("Enter some text:")
 
93
 
94
+ if st.button("Extract Keywords"):
95
+ # Extract keywords using the model
96
+ keywords = keyword_extractor(input_text, max_length=20, do_sample=False)[0]["generated_text"]
97
+ # Display the extracted keywords
98
+ st.write("Keywords:", keywords)
 
 
 
 
99
 
100
 
101
  elif choice=="Question Answering":