Update app.py
Browse files
app.py
CHANGED
@@ -29,26 +29,15 @@ def get_ext(uploaded_file):
|
|
29 |
extype = uID+uploaded_file.name
|
30 |
return extype
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
@st.cache_resource(ttl=3600)
|
35 |
-
def read_model(url):
|
36 |
-
response = requests.get(url)
|
37 |
-
open("temp.pkl", "wb").write(response.content)
|
38 |
-
with open("temp.pkl", "rb") as f:
|
39 |
-
svm_classifier = pickle.load(f)
|
40 |
-
return svm_classifier
|
41 |
-
|
42 |
-
|
43 |
def read_tf(url):
|
44 |
response = requests.get(url)
|
45 |
open("temp.pkl", "wb").write(response.content)
|
46 |
with open("temp.pkl", "rb") as f:
|
47 |
preprocessing = pickle.load(f)
|
48 |
return preprocessing
|
49 |
-
|
50 |
-
svm_classifier = read_model("
|
51 |
-
preprocessing = read_tf("
|
52 |
|
53 |
# Function to predict the category for a given abstract
|
54 |
def predict_category(abstract):
|
@@ -71,6 +60,7 @@ def conv_txt(extype):
|
|
71 |
papers.rename(columns=col_dict, inplace=True)
|
72 |
return papers
|
73 |
|
|
|
74 |
#===Read data===
|
75 |
|
76 |
# uploaded_file = st.file_uploader("Choose a file", type=['csv'])
|
|
|
29 |
extype = uID+uploaded_file.name
|
30 |
return extype
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def read_tf(url):
|
33 |
response = requests.get(url)
|
34 |
open("temp.pkl", "wb").write(response.content)
|
35 |
with open("temp.pkl", "rb") as f:
|
36 |
preprocessing = pickle.load(f)
|
37 |
return preprocessing
|
38 |
+
|
39 |
+
svm_classifier = read_model("model2.pkl")
|
40 |
+
preprocessing = read_tf("preprocessing.pkl")
|
41 |
|
42 |
# Function to predict the category for a given abstract
|
43 |
def predict_category(abstract):
|
|
|
60 |
papers.rename(columns=col_dict, inplace=True)
|
61 |
return papers
|
62 |
|
63 |
+
|
64 |
#===Read data===
|
65 |
|
66 |
# uploaded_file = st.file_uploader("Choose a file", type=['csv'])
|