able to load sample insurance
Browse files
app.py
CHANGED
@@ -74,7 +74,11 @@ if 'is_initialized' not in st.session_state:
|
|
74 |
|
75 |
nltk.download('punkt')
|
76 |
nltk.download('stopwords')
|
77 |
-
|
|
|
|
|
|
|
|
|
78 |
st.session_state.bert_tokenizer = BertTokenizer.from_pretrained("bert-base-uncased", )
|
79 |
st.session_state.bert_model = BertModel.from_pretrained("bert-base-uncased", ).to('cuda')
|
80 |
st.session_state.paraphrase_tokenizer = AutoTokenizer.from_pretrained("Vamsi/T5_Paraphrase_Paws")
|
@@ -94,7 +98,7 @@ if 'list_count' in st.session_state:
|
|
94 |
read_progress_bar.progress(progress_percentage)
|
95 |
|
96 |
sentence_encodings = []
|
97 |
-
sentences = sent_tokenize(paragraph['
|
98 |
for sentence in sentences:
|
99 |
if sentence.strip().endswith('?'):
|
100 |
sentence_encodings.append(None)
|
|
|
74 |
|
75 |
nltk.download('punkt')
|
76 |
nltk.download('stopwords')
|
77 |
+
# print("stop words start")
|
78 |
+
# print(stopwords.words('english'))
|
79 |
+
# print("stop words end")
|
80 |
+
stop_words_list = stopwords.words('english')
|
81 |
+
st.session_state.stop_words = set(stop_words_list)
|
82 |
st.session_state.bert_tokenizer = BertTokenizer.from_pretrained("bert-base-uncased", )
|
83 |
st.session_state.bert_model = BertModel.from_pretrained("bert-base-uncased", ).to('cuda')
|
84 |
st.session_state.paraphrase_tokenizer = AutoTokenizer.from_pretrained("Vamsi/T5_Paraphrase_Paws")
|
|
|
98 |
read_progress_bar.progress(progress_percentage)
|
99 |
|
100 |
sentence_encodings = []
|
101 |
+
sentences = sent_tokenize(paragraph['paragraph'])
|
102 |
for sentence in sentences:
|
103 |
if sentence.strip().endswith('?'):
|
104 |
sentence_encodings.append(None)
|