gopiashokan commited on
Commit
e9aeca3
·
verified ·
1 Parent(s): bcaf643

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
  import numpy as np
3
  import spacy
4
  import nltk
@@ -132,20 +131,13 @@ def prediction(input_file):
132
  unsafe_allow_html=True)
133
 
134
  add_vertical_space(1)
135
- st.markdown(f'<h3 style="text-align: center; color: green;">{predicted_class}</h3>',
136
  unsafe_allow_html=True)
137
 
138
 
139
 
140
  # Streamlit Configuration Setup
141
  streamlit_config()
142
-
143
-
144
- # Check 'punkt' Already Downloaded or Not
145
- try:
146
- nltk.data.find('tokenizers/punkt')
147
- except LookupError:
148
- nltk.download('punkt')
149
 
150
 
151
  # File uploader to upload the HTML file
@@ -153,6 +145,16 @@ input_file = st.file_uploader('Upload an HTML file', type='html')
153
 
154
  if input_file is not None:
155
 
156
- prediction(input_file)
 
 
 
 
 
 
 
 
 
157
 
158
-
 
 
 
1
  import numpy as np
2
  import spacy
3
  import nltk
 
131
  unsafe_allow_html=True)
132
 
133
  add_vertical_space(1)
134
+ st.markdown(f'<h3 style="text-align: center; color: green;">Prdicted Class = {predicted_class}</h3>',
135
  unsafe_allow_html=True)
136
 
137
 
138
 
139
  # Streamlit Configuration Setup
140
  streamlit_config()
 
 
 
 
 
 
 
141
 
142
 
143
  # File uploader to upload the HTML file
 
145
 
146
  if input_file is not None:
147
 
148
+ try:
149
+ # Predict the Input_HTML_File_Class
150
+ prediction(input_file)
151
+
152
+ except:
153
+ # Check 'punkt' Already Downloaded or Not
154
+ try:
155
+ nltk.data.find('tokenizers/punkt')
156
+ except LookupError:
157
+ nltk.download('punkt')
158
 
159
+ # Predict the Input_HTML_File_Class
160
+ prediction(input_file)