numBery commited on
Commit
02ac4f2
1 Parent(s): fb64fbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -1,5 +1,8 @@
1
- import torch
2
  import time
 
 
 
3
  from keybert import KeyBERT
4
  from sentence_transformers import SentenceTransformer
5
  from keyphrase_vectorizers import KeyphraseCountVectorizer
@@ -93,16 +96,18 @@ def extract_paraphrased_sentences(article):
93
 
94
  doc = st.text_area("Enter a custom document")
95
 
96
- t5_keywords_df, original_keywords_df, unique_keywords_df, total_end = extract_paraphrased_sentences(doc)
97
-
98
- # extract_paraphrased_article(input_list[0])
99
- st.text(f'T5 PARAPHRASING RUNTIME: {total_end}\n')
100
-
101
- st.subheader('\nOriginal Keywords Extracted:\n\n')
102
- st.dataframe(original_keywords_df)
103
-
104
- st.subheader('\nT5 Keywords Extracted:\n\n')
105
- st.dataframe(t5_keywords_df)
106
-
107
- st.subheader('\nT5 Unique New Keywords Extracted:\n\n')
108
- st.dataframe(unique_keywords_df)
 
 
 
1
+
2
  import time
3
+ import pandas as pd
4
+
5
+ import torch
6
  from keybert import KeyBERT
7
  from sentence_transformers import SentenceTransformer
8
  from keyphrase_vectorizers import KeyphraseCountVectorizer
 
96
 
97
  doc = st.text_area("Enter a custom document")
98
 
99
+ if doc:
100
+ t5_keywords_df, original_keywords_df, unique_keywords_df, total_end = extract_paraphrased_sentences(doc)
101
+
102
+ # extract_paraphrased_article(input_list[0])
103
+ st.text(f'T5 PARAPHRASING RUNTIME: {total_end}\n')
104
+
105
+ st.subheader('\nOriginal Keywords Extracted:\n\n')
106
+ st.dataframe(original_keywords_df)
107
+
108
+ st.subheader('\nT5 Keywords Extracted:\n\n')
109
+ st.dataframe(t5_keywords_df)
110
+
111
+ st.subheader('\nT5 Unique New Keywords Extracted:\n\n')
112
+ st.dataframe(unique_keywords_df)
113
+