Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ title = st.text_area("TITLE HERE")
|
|
15 |
abstract = st.text_area("ABSTRACT HERE")
|
16 |
# ^-- показать текстовое поле. В поле text лежит строка, которая находится там в данный момент
|
17 |
|
18 |
-
@st.
|
19 |
def load_model_and_tokenizer():
|
20 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
21 |
model = BertForSequenceClassification.from_pretrained(
|
@@ -34,22 +34,22 @@ input_ids = tokens['input_ids']
|
|
34 |
attention_mask = tokens['attention_mask']
|
35 |
logits = model(input_ids, attention_mask)[0]
|
36 |
|
37 |
-
tags_names = ['
|
38 |
'adap-org',
|
39 |
"adap-org",
|
40 |
-
'
|
41 |
-
'
|
42 |
-
"
|
43 |
-
'
|
44 |
-
'
|
45 |
'cmp-lg',
|
46 |
"cmp-lg",
|
47 |
'comp-gas',
|
48 |
'cond-mat',
|
49 |
"cond-mat",
|
50 |
-
'
|
51 |
'dg-ga',
|
52 |
-
'
|
53 |
'eess',
|
54 |
'funct-an',
|
55 |
'gr-qc',
|
@@ -62,7 +62,7 @@ tags_names = ['acc-phys',
|
|
62 |
"hep-ph",
|
63 |
'hep-th',
|
64 |
"hep-th",
|
65 |
-
'
|
66 |
'math-ph',
|
67 |
'mtrl-th',
|
68 |
'nlin',
|
@@ -70,14 +70,14 @@ tags_names = ['acc-phys',
|
|
70 |
'nucl-th',
|
71 |
"nucl-th",
|
72 |
'patt-sol',
|
73 |
-
'
|
74 |
'q-alg',
|
75 |
-
'
|
76 |
'q-fin',
|
77 |
'quant-ph',
|
78 |
"quant-ph",
|
79 |
'solv-int',
|
80 |
-
'
|
81 |
|
82 |
if abstract:
|
83 |
abstract_tokens = tokenizer(abstract, padding=True, truncation=True, return_tensors="pt")
|
|
|
15 |
abstract = st.text_area("ABSTRACT HERE")
|
16 |
# ^-- показать текстовое поле. В поле text лежит строка, которая находится там в данный момент
|
17 |
|
18 |
+
@st.cache
|
19 |
def load_model_and_tokenizer():
|
20 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
21 |
model = BertForSequenceClassification.from_pretrained(
|
|
|
34 |
attention_mask = tokens['attention_mask']
|
35 |
logits = model(input_ids, attention_mask)[0]
|
36 |
|
37 |
+
tags_names = ['Accelerator Physics',
|
38 |
'adap-org',
|
39 |
"adap-org",
|
40 |
+
'Algebra-Geometry',
|
41 |
+
'Astro-physics',
|
42 |
+
"Astro-physics",
|
43 |
+
'Chao-dynamics',
|
44 |
+
'Chemistry-physics',
|
45 |
'cmp-lg',
|
46 |
"cmp-lg",
|
47 |
'comp-gas',
|
48 |
'cond-mat',
|
49 |
"cond-mat",
|
50 |
+
'Computer Science',
|
51 |
'dg-ga',
|
52 |
+
'Economics',
|
53 |
'eess',
|
54 |
'funct-an',
|
55 |
'gr-qc',
|
|
|
62 |
"hep-ph",
|
63 |
'hep-th',
|
64 |
"hep-th",
|
65 |
+
'Math',
|
66 |
'math-ph',
|
67 |
'mtrl-th',
|
68 |
'nlin',
|
|
|
70 |
'nucl-th',
|
71 |
"nucl-th",
|
72 |
'patt-sol',
|
73 |
+
'Physics',
|
74 |
'q-alg',
|
75 |
+
'Quantitie-biology',
|
76 |
'q-fin',
|
77 |
'quant-ph',
|
78 |
"quant-ph",
|
79 |
'solv-int',
|
80 |
+
'Statistics']
|
81 |
|
82 |
if abstract:
|
83 |
abstract_tokens = tokenizer(abstract, padding=True, truncation=True, return_tensors="pt")
|