Spaces:
Runtime error
Runtime error
Commit
·
7c43c1d
1
Parent(s):
93a2379
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,17 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
|
| 6 |
-
|
| 7 |
-
import gzip
|
| 8 |
-
import os
|
| 9 |
-
import torch
|
| 10 |
-
import pickle
|
| 11 |
-
import yake
|
| 12 |
|
| 13 |
-
############
|
| 14 |
-
## Main page
|
| 15 |
-
############
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
st.
|
| 20 |
-
image = Image.open('temp.jpg')
|
| 21 |
-
st.image(image)
|
| 22 |
-
|
| 23 |
-
user_query = st.text_input("Enter a title for the summarization:")
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
from keybert import KeyBERT
|
| 4 |
+
from transformers.pipelines import pipeline
|
| 5 |
|
| 6 |
+
st.title('Title Summarization')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
path='checkpoint-210000'
|
| 10 |
+
hf_model = pipeline("feature-extraction",model=path,tokenizer='bert-base-uncased' )
|
| 11 |
+
etsy_model = KeyBERT(model=hf_model)l=hf_model)
|
| 12 |
|
| 13 |
+
text = st.text_area("Enter title here for the summarization:")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
if text:
|
| 16 |
+
out = pipe(text)
|
| 17 |
+
st.json(out)
|