Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,20 +87,15 @@ def main():
|
|
| 87 |
elif choice=="Keyword Extractor":
|
| 88 |
st.subheader("Keyword Extraction")
|
| 89 |
#loading the pipeline
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
keyword_extractor = pipeline("text2text-generation", model=model_name, tokenizer=model_name, config={"wordwise": True})
|
| 94 |
|
| 95 |
-
if
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 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":
|