Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
-
|
| 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 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
st.
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
st.
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
st.
|
|
|
|
|
|
|
|
|
| 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 |
+
|