Jackie2235 commited on
Commit
7c43c1d
·
1 Parent(s): 93a2379

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -1,24 +1,17 @@
1
  import streamlit as st
2
- from streamlit_tags import st_tags, st_tags_sidebar
3
- from keytotext import pipeline
4
- from PIL import Image
5
 
6
- import json
7
- import gzip
8
- import os
9
- import torch
10
- import pickle
11
- import yake
12
 
13
- ############
14
- ## Main page
15
- ############
16
 
17
- st.write("# Demonstration for Etsy Title Summarization(Etsy-TS)")
 
 
18
 
19
- st.markdown("***Idea is to build a model which will automatically summarize title information.***")
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)