Spaces:
Runtime error
Runtime error
fuhsiao418
commited on
Commit
·
2280fc9
1
Parent(s):
9072490
update
Browse files- app.py +7 -1
- model/BART-PMC-EXT-Section +1 -0
- model/BioBART-PMC-EXT-Section +1 -0
- model/all-MiniLM-L6-v2 +1 -0
- utils/preprocess.py +1 -1
app.py
CHANGED
@@ -18,7 +18,13 @@ def main(file, ext_threshold, article_type):
|
|
18 |
ExtModel = load_ExtModel('model/LGB_model_F10_S.pkl')
|
19 |
ext = extractive_method(sentJson, sentFeat, ExtModel, threshold=ext_threshold, TGB=False)
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
abstr = abstractive_method(ext, tokenizer=TOKENIZER, model=ABSTRMODEL)
|
23 |
|
24 |
result = ''
|
|
|
18 |
ExtModel = load_ExtModel('model/LGB_model_F10_S.pkl')
|
19 |
ext = extractive_method(sentJson, sentFeat, ExtModel, threshold=ext_threshold, TGB=False)
|
20 |
|
21 |
+
abstr_model_path = ''
|
22 |
+
if article_type == 'non-specialized field':
|
23 |
+
abstr_model_path = 'model/BART-PMC-EXT-Section'
|
24 |
+
elif article_type == 'biomedical field':
|
25 |
+
abstr_model_path = 'model/BioBART-PMC-EXT-Section'
|
26 |
+
|
27 |
+
TOKENIZER, ABSTRMODEL = load_AbstrModel(abstr_model_path)
|
28 |
abstr = abstractive_method(ext, tokenizer=TOKENIZER, model=ABSTRMODEL)
|
29 |
|
30 |
result = ''
|
model/BART-PMC-EXT-Section
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 952a510b0609c33faf7575d646a93a830f761ce7
|
model/BioBART-PMC-EXT-Section
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 8d32d050b4287ff94760b526e4d734b8c07d8929
|
model/all-MiniLM-L6-v2
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 7dbbc90392e2f80f3d3c277d6e90027e55de9125
|
utils/preprocess.py
CHANGED
@@ -143,7 +143,7 @@ def similarity(lst, ptm):
|
|
143 |
def feature_extraction(title, section, sents):
|
144 |
lst = sent_lst(sents)
|
145 |
tfisf = Tfisf(lst)
|
146 |
-
cosine = similarity(lst, "
|
147 |
|
148 |
# Number of sentences
|
149 |
ns = len(sents)
|
|
|
143 |
def feature_extraction(title, section, sents):
|
144 |
lst = sent_lst(sents)
|
145 |
tfisf = Tfisf(lst)
|
146 |
+
cosine = similarity(lst, "model/all-MiniLM-L6-v2")
|
147 |
|
148 |
# Number of sentences
|
149 |
ns = len(sents)
|