Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,10 +87,10 @@ def main():
|
|
| 87 |
elif choice=="Keyword Extractor":
|
| 88 |
st.subheader("Keyword Extraction")
|
| 89 |
#loading the pipeline
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 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"]
|
|
|
|
| 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"]
|