Update app.py
Browse files
app.py
CHANGED
@@ -45,21 +45,22 @@ def get_ext(uploaded_file):
|
|
45 |
|
46 |
def read_model(url):
|
47 |
response = requests.get(url)
|
48 |
-
open("
|
49 |
-
with open("
|
50 |
svm_classifier = pickle.load(f)
|
51 |
return svm_classifier
|
52 |
|
53 |
|
54 |
def read_tf(url):
|
55 |
response = requests.get(url)
|
56 |
-
open("
|
57 |
-
with open("
|
58 |
preprocessing = pickle.load(f)
|
59 |
return preprocessing
|
60 |
|
61 |
-
svm_classifier = read_model("https://github.com/manika-lamba/ml/raw/main/
|
62 |
-
preprocessing = read_tf("https://github.com/manika-lamba/ml/raw/main/
|
|
|
63 |
|
64 |
# Function to predict the category for a given abstract
|
65 |
def predict_category(abstract):
|
|
|
45 |
|
46 |
def read_model(url):
|
47 |
response = requests.get(url)
|
48 |
+
open("temp.pkl", "wb").write(response.content)
|
49 |
+
with open("temp.pkl", "rb") as f:
|
50 |
svm_classifier = pickle.load(f)
|
51 |
return svm_classifier
|
52 |
|
53 |
|
54 |
def read_tf(url):
|
55 |
response = requests.get(url)
|
56 |
+
open("temp.pkl", "wb").write(response.content)
|
57 |
+
with open("temp.pkl", "rb") as f:
|
58 |
preprocessing = pickle.load(f)
|
59 |
return preprocessing
|
60 |
|
61 |
+
svm_classifier = read_model("https://github.com/manika-lamba/ml/raw/main/model-topics.pkl")
|
62 |
+
preprocessing = read_tf("https://github.com/manika-lamba/ml/raw/main/tfidf-topics.pkl")
|
63 |
+
|
64 |
|
65 |
# Function to predict the category for a given abstract
|
66 |
def predict_category(abstract):
|