Spaces:
Runtime error
Runtime error
Commit
·
dabf7ab
0
Parent(s):
initial commit
Browse files- .gitattributes +27 -0
- README.md +14 -0
- app.py +150 -0
- model_api.py +17 -0
- models/.DS_Store +0 -0
- models/scibert/config.json +282 -0
- models/scibert/decode_dict.pkl +0 -0
- models/scibert/rng_state.pth +0 -0
- models/scibert/scheduler.pt +0 -0
- models/scibert/trainer_state.json +40 -0
- models/scibert/training_args.bin +0 -0
- requirements.txt +2 -0
.gitattributes
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Arxiv_paper_classifier
|
| 3 |
+
emoji: 📉
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: pink
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.2.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
| 14 |
+
|
app.py
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import transformers
|
| 3 |
+
import pickle
|
| 4 |
+
import seaborn as sns
|
| 5 |
+
from pandas import DataFrame
|
| 6 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 7 |
+
|
| 8 |
+
st.markdown("# Hello, friend!")
|
| 9 |
+
st.markdown(" This magic application going to help you with understanding of science paper topic! Cool? Yeah! ")
|
| 10 |
+
# st.markdown("<img width=200px src='https://rozetked.me/images/uploads/dwoilp3BVjlE.jpg'>", unsafe_allow_html=True)
|
| 11 |
+
|
| 12 |
+
st.write("Loading tokenizer and dict")
|
| 13 |
+
model_name_global = "allenai/scibert_scivocab_uncased"
|
| 14 |
+
tokenizer_ = AutoTokenizer.from_pretrained(model_name_global)
|
| 15 |
+
with open('./models/scibert/decode_dict.pkl', 'rb') as f:
|
| 16 |
+
decode_dict = pickle.load(f)
|
| 17 |
+
|
| 18 |
+
with st.form(key="my_form"):
|
| 19 |
+
st.markdown("### 🎈 Do you want a little magic? ")
|
| 20 |
+
st.markdown(" Write your article title and abstract to textboxes bellow and I'll gues topic of your paper! ")
|
| 21 |
+
# ce, c1, ce, c2, c3 = st.columns([0.07, 1, 0.07, 5, 0.07])
|
| 22 |
+
ce, c2, c3 = st.columns([0.07, 5, 0.07])
|
| 23 |
+
# with c1:
|
| 24 |
+
# ModelType = st.radio(
|
| 25 |
+
# "Choose your model",
|
| 26 |
+
# ["DistilBERT (Default)", "Flair"],
|
| 27 |
+
# help="At present, you can choose between 2 models (Flair or DistilBERT) to embed your text. More to come!",
|
| 28 |
+
# )
|
| 29 |
+
#
|
| 30 |
+
# if ModelType == "Default (DistilBERT)":
|
| 31 |
+
# # kw_model = KeyBERT(model=roberta)
|
| 32 |
+
#
|
| 33 |
+
# @st.cache(allow_output_mutation=True)
|
| 34 |
+
# def load_model():
|
| 35 |
+
# return KeyBERT(model=roberta)
|
| 36 |
+
#
|
| 37 |
+
#
|
| 38 |
+
# kw_model = load_model()
|
| 39 |
+
#
|
| 40 |
+
# else:
|
| 41 |
+
# @st.cache(allow_output_mutation=True)
|
| 42 |
+
# def load_model():
|
| 43 |
+
# return KeyBERT("distilbert-base-nli-mean-tokens")
|
| 44 |
+
#
|
| 45 |
+
#
|
| 46 |
+
# kw_model = load_model()
|
| 47 |
+
|
| 48 |
+
with c2:
|
| 49 |
+
doc_title = st.text_area(
|
| 50 |
+
"Paste your abstract title below (max 100 words)",
|
| 51 |
+
height=210,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
doc_abstract = st.text_area(
|
| 55 |
+
"Paste your abstract text below (max 100500 words)",
|
| 56 |
+
height=410,
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
MAX_WORDS_TITLE, MAX_WORDS_ABSTRACT = 50, 500
|
| 60 |
+
import re
|
| 61 |
+
|
| 62 |
+
len_title = len(re.findall(r"\w+", doc_title))
|
| 63 |
+
len_abstract = len(re.findall(r"\w+", doc_abstract))
|
| 64 |
+
if len_title > MAX_WORDS_TITLE:
|
| 65 |
+
st.warning(
|
| 66 |
+
"⚠️ Your title contains "
|
| 67 |
+
+ str(len_title)
|
| 68 |
+
+ " words."
|
| 69 |
+
+ " Only the first 50 words will be reviewed. Stay tuned as increased allowance is coming! 😊"
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
doc_title = doc_title[:MAX_WORDS_TITLE]
|
| 73 |
+
|
| 74 |
+
if len_abstract > MAX_WORDS_ABSTRACT:
|
| 75 |
+
st.warning(
|
| 76 |
+
"⚠️ Your abstract contains "
|
| 77 |
+
+ str(len_abstract)
|
| 78 |
+
+ " words."
|
| 79 |
+
+ " Only the first 50 words will be reviewed. Stay tuned as increased allowance is coming! 😊"
|
| 80 |
+
)
|
| 81 |
+
|
| 82 |
+
doc_abstract = doc_abstract[:MAX_WORDS_ABSTRACT]
|
| 83 |
+
|
| 84 |
+
submit_button = st.form_submit_button(label="✨ Let's play, try it!")
|
| 85 |
+
|
| 86 |
+
if not submit_button:
|
| 87 |
+
st.stop()
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
# allow_output_mutation=True
|
| 91 |
+
@st.cache(suppress_st_warning=True)
|
| 92 |
+
def load_model():
|
| 93 |
+
st.write("Loading big model")
|
| 94 |
+
return AutoModelForSequenceClassification.from_pretrained("models/scibert/")
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def make_predict(tokens, decode_dict):
|
| 98 |
+
# tokenizer_ = AutoTokenizer.from_pretrained(model_name_global)
|
| 99 |
+
# tokens = tokenizer_(title + abstract, return_tensors="pt")
|
| 100 |
+
|
| 101 |
+
model_ = load_model()
|
| 102 |
+
outs = model_(tokens.input_ids)
|
| 103 |
+
|
| 104 |
+
probs = outs["logits"].softmax(dim=-1).tolist()[0]
|
| 105 |
+
topic_probs = {}
|
| 106 |
+
for i, p in enumerate(probs):
|
| 107 |
+
if p > 0.1:
|
| 108 |
+
topic_probs[decode_dict[i]] = p
|
| 109 |
+
return topic_probs
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
model_local = "models/scibert/"
|
| 113 |
+
|
| 114 |
+
title = doc_title
|
| 115 |
+
abstract = doc_abstract
|
| 116 |
+
tokens = tokenizer_(title + abstract, return_tensors="pt")
|
| 117 |
+
|
| 118 |
+
predicts = make_predict(model_name_global, model_local, tokens, decode_dict, title, abstract)
|
| 119 |
+
|
| 120 |
+
st.markdown("## 🎈 Yor article probably about: ")
|
| 121 |
+
st.header("")
|
| 122 |
+
|
| 123 |
+
df = (
|
| 124 |
+
DataFrame(predicts.items(), columns=["Topic", "Prob"])
|
| 125 |
+
.sort_values(by="Prob", ascending=False)
|
| 126 |
+
.reset_index(drop=True)
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
df.index += 1
|
| 130 |
+
|
| 131 |
+
# Add styling
|
| 132 |
+
cmGreen = sns.light_palette("green", as_cmap=True)
|
| 133 |
+
cmRed = sns.light_palette("red", as_cmap=True)
|
| 134 |
+
df = df.style.background_gradient(
|
| 135 |
+
cmap=cmGreen,
|
| 136 |
+
subset=[
|
| 137 |
+
"Prob",
|
| 138 |
+
],
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
c1, c2, c3 = st.columns([1, 3, 1])
|
| 142 |
+
|
| 143 |
+
format_dictionary = {
|
| 144 |
+
"Prob": "{:.1%}",
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
df = df.format(format_dictionary)
|
| 148 |
+
|
| 149 |
+
with c2:
|
| 150 |
+
st.table(df)
|
model_api.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#
|
| 2 |
+
#
|
| 3 |
+
# def make_predict(model_name_global, model_local, decode_dict, title, abstract):
|
| 4 |
+
# model_name_global="allenai/scibert_scivocab_uncased"
|
| 5 |
+
# model_local="scibert_trainer/checkpoint-2000/"
|
| 6 |
+
#
|
| 7 |
+
# tokenizer_ = AutoTokenizer.from_pretrained(model_name_global)
|
| 8 |
+
# tokens = tokenizer_(title + abstract, return_tensors="pt")
|
| 9 |
+
# model_ = AutoModelForSequenceClassification.from_pretrained(model_local)
|
| 10 |
+
# outs = model_(tokens.input_ids)
|
| 11 |
+
#
|
| 12 |
+
# probs = outs["logits"].softmax(dim=-1).tolist()[0]
|
| 13 |
+
# topic_probs = {}
|
| 14 |
+
# for i, p in enumerate(probs):
|
| 15 |
+
# if p > 0.1:
|
| 16 |
+
# topic_probs[decode_dict[i]] = p
|
| 17 |
+
# return topic_probs
|
models/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
models/scibert/config.json
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "allenai/scibert_scivocab_uncased",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "LABEL_0",
|
| 13 |
+
"1": "LABEL_1",
|
| 14 |
+
"2": "LABEL_2",
|
| 15 |
+
"3": "LABEL_3",
|
| 16 |
+
"4": "LABEL_4",
|
| 17 |
+
"5": "LABEL_5",
|
| 18 |
+
"6": "LABEL_6",
|
| 19 |
+
"7": "LABEL_7",
|
| 20 |
+
"8": "LABEL_8",
|
| 21 |
+
"9": "LABEL_9",
|
| 22 |
+
"10": "LABEL_10",
|
| 23 |
+
"11": "LABEL_11",
|
| 24 |
+
"12": "LABEL_12",
|
| 25 |
+
"13": "LABEL_13",
|
| 26 |
+
"14": "LABEL_14",
|
| 27 |
+
"15": "LABEL_15",
|
| 28 |
+
"16": "LABEL_16",
|
| 29 |
+
"17": "LABEL_17",
|
| 30 |
+
"18": "LABEL_18",
|
| 31 |
+
"19": "LABEL_19",
|
| 32 |
+
"20": "LABEL_20",
|
| 33 |
+
"21": "LABEL_21",
|
| 34 |
+
"22": "LABEL_22",
|
| 35 |
+
"23": "LABEL_23",
|
| 36 |
+
"24": "LABEL_24",
|
| 37 |
+
"25": "LABEL_25",
|
| 38 |
+
"26": "LABEL_26",
|
| 39 |
+
"27": "LABEL_27",
|
| 40 |
+
"28": "LABEL_28",
|
| 41 |
+
"29": "LABEL_29",
|
| 42 |
+
"30": "LABEL_30",
|
| 43 |
+
"31": "LABEL_31",
|
| 44 |
+
"32": "LABEL_32",
|
| 45 |
+
"33": "LABEL_33",
|
| 46 |
+
"34": "LABEL_34",
|
| 47 |
+
"35": "LABEL_35",
|
| 48 |
+
"36": "LABEL_36",
|
| 49 |
+
"37": "LABEL_37",
|
| 50 |
+
"38": "LABEL_38",
|
| 51 |
+
"39": "LABEL_39",
|
| 52 |
+
"40": "LABEL_40",
|
| 53 |
+
"41": "LABEL_41",
|
| 54 |
+
"42": "LABEL_42",
|
| 55 |
+
"43": "LABEL_43",
|
| 56 |
+
"44": "LABEL_44",
|
| 57 |
+
"45": "LABEL_45",
|
| 58 |
+
"46": "LABEL_46",
|
| 59 |
+
"47": "LABEL_47",
|
| 60 |
+
"48": "LABEL_48",
|
| 61 |
+
"49": "LABEL_49",
|
| 62 |
+
"50": "LABEL_50",
|
| 63 |
+
"51": "LABEL_51",
|
| 64 |
+
"52": "LABEL_52",
|
| 65 |
+
"53": "LABEL_53",
|
| 66 |
+
"54": "LABEL_54",
|
| 67 |
+
"55": "LABEL_55",
|
| 68 |
+
"56": "LABEL_56",
|
| 69 |
+
"57": "LABEL_57",
|
| 70 |
+
"58": "LABEL_58",
|
| 71 |
+
"59": "LABEL_59",
|
| 72 |
+
"60": "LABEL_60",
|
| 73 |
+
"61": "LABEL_61",
|
| 74 |
+
"62": "LABEL_62",
|
| 75 |
+
"63": "LABEL_63",
|
| 76 |
+
"64": "LABEL_64",
|
| 77 |
+
"65": "LABEL_65",
|
| 78 |
+
"66": "LABEL_66",
|
| 79 |
+
"67": "LABEL_67",
|
| 80 |
+
"68": "LABEL_68",
|
| 81 |
+
"69": "LABEL_69",
|
| 82 |
+
"70": "LABEL_70",
|
| 83 |
+
"71": "LABEL_71",
|
| 84 |
+
"72": "LABEL_72",
|
| 85 |
+
"73": "LABEL_73",
|
| 86 |
+
"74": "LABEL_74",
|
| 87 |
+
"75": "LABEL_75",
|
| 88 |
+
"76": "LABEL_76",
|
| 89 |
+
"77": "LABEL_77",
|
| 90 |
+
"78": "LABEL_78",
|
| 91 |
+
"79": "LABEL_79",
|
| 92 |
+
"80": "LABEL_80",
|
| 93 |
+
"81": "LABEL_81",
|
| 94 |
+
"82": "LABEL_82",
|
| 95 |
+
"83": "LABEL_83",
|
| 96 |
+
"84": "LABEL_84",
|
| 97 |
+
"85": "LABEL_85",
|
| 98 |
+
"86": "LABEL_86",
|
| 99 |
+
"87": "LABEL_87",
|
| 100 |
+
"88": "LABEL_88",
|
| 101 |
+
"89": "LABEL_89",
|
| 102 |
+
"90": "LABEL_90",
|
| 103 |
+
"91": "LABEL_91",
|
| 104 |
+
"92": "LABEL_92",
|
| 105 |
+
"93": "LABEL_93",
|
| 106 |
+
"94": "LABEL_94",
|
| 107 |
+
"95": "LABEL_95",
|
| 108 |
+
"96": "LABEL_96",
|
| 109 |
+
"97": "LABEL_97",
|
| 110 |
+
"98": "LABEL_98",
|
| 111 |
+
"99": "LABEL_99",
|
| 112 |
+
"100": "LABEL_100",
|
| 113 |
+
"101": "LABEL_101",
|
| 114 |
+
"102": "LABEL_102",
|
| 115 |
+
"103": "LABEL_103",
|
| 116 |
+
"104": "LABEL_104",
|
| 117 |
+
"105": "LABEL_105",
|
| 118 |
+
"106": "LABEL_106",
|
| 119 |
+
"107": "LABEL_107",
|
| 120 |
+
"108": "LABEL_108",
|
| 121 |
+
"109": "LABEL_109",
|
| 122 |
+
"110": "LABEL_110",
|
| 123 |
+
"111": "LABEL_111",
|
| 124 |
+
"112": "LABEL_112",
|
| 125 |
+
"113": "LABEL_113",
|
| 126 |
+
"114": "LABEL_114",
|
| 127 |
+
"115": "LABEL_115",
|
| 128 |
+
"116": "LABEL_116",
|
| 129 |
+
"117": "LABEL_117",
|
| 130 |
+
"118": "LABEL_118",
|
| 131 |
+
"119": "LABEL_119",
|
| 132 |
+
"120": "LABEL_120",
|
| 133 |
+
"121": "LABEL_121",
|
| 134 |
+
"122": "LABEL_122",
|
| 135 |
+
"123": "LABEL_123",
|
| 136 |
+
"124": "LABEL_124",
|
| 137 |
+
"125": "LABEL_125"
|
| 138 |
+
},
|
| 139 |
+
"initializer_range": 0.02,
|
| 140 |
+
"intermediate_size": 3072,
|
| 141 |
+
"label2id": {
|
| 142 |
+
"LABEL_0": 0,
|
| 143 |
+
"LABEL_1": 1,
|
| 144 |
+
"LABEL_10": 10,
|
| 145 |
+
"LABEL_100": 100,
|
| 146 |
+
"LABEL_101": 101,
|
| 147 |
+
"LABEL_102": 102,
|
| 148 |
+
"LABEL_103": 103,
|
| 149 |
+
"LABEL_104": 104,
|
| 150 |
+
"LABEL_105": 105,
|
| 151 |
+
"LABEL_106": 106,
|
| 152 |
+
"LABEL_107": 107,
|
| 153 |
+
"LABEL_108": 108,
|
| 154 |
+
"LABEL_109": 109,
|
| 155 |
+
"LABEL_11": 11,
|
| 156 |
+
"LABEL_110": 110,
|
| 157 |
+
"LABEL_111": 111,
|
| 158 |
+
"LABEL_112": 112,
|
| 159 |
+
"LABEL_113": 113,
|
| 160 |
+
"LABEL_114": 114,
|
| 161 |
+
"LABEL_115": 115,
|
| 162 |
+
"LABEL_116": 116,
|
| 163 |
+
"LABEL_117": 117,
|
| 164 |
+
"LABEL_118": 118,
|
| 165 |
+
"LABEL_119": 119,
|
| 166 |
+
"LABEL_12": 12,
|
| 167 |
+
"LABEL_120": 120,
|
| 168 |
+
"LABEL_121": 121,
|
| 169 |
+
"LABEL_122": 122,
|
| 170 |
+
"LABEL_123": 123,
|
| 171 |
+
"LABEL_124": 124,
|
| 172 |
+
"LABEL_125": 125,
|
| 173 |
+
"LABEL_13": 13,
|
| 174 |
+
"LABEL_14": 14,
|
| 175 |
+
"LABEL_15": 15,
|
| 176 |
+
"LABEL_16": 16,
|
| 177 |
+
"LABEL_17": 17,
|
| 178 |
+
"LABEL_18": 18,
|
| 179 |
+
"LABEL_19": 19,
|
| 180 |
+
"LABEL_2": 2,
|
| 181 |
+
"LABEL_20": 20,
|
| 182 |
+
"LABEL_21": 21,
|
| 183 |
+
"LABEL_22": 22,
|
| 184 |
+
"LABEL_23": 23,
|
| 185 |
+
"LABEL_24": 24,
|
| 186 |
+
"LABEL_25": 25,
|
| 187 |
+
"LABEL_26": 26,
|
| 188 |
+
"LABEL_27": 27,
|
| 189 |
+
"LABEL_28": 28,
|
| 190 |
+
"LABEL_29": 29,
|
| 191 |
+
"LABEL_3": 3,
|
| 192 |
+
"LABEL_30": 30,
|
| 193 |
+
"LABEL_31": 31,
|
| 194 |
+
"LABEL_32": 32,
|
| 195 |
+
"LABEL_33": 33,
|
| 196 |
+
"LABEL_34": 34,
|
| 197 |
+
"LABEL_35": 35,
|
| 198 |
+
"LABEL_36": 36,
|
| 199 |
+
"LABEL_37": 37,
|
| 200 |
+
"LABEL_38": 38,
|
| 201 |
+
"LABEL_39": 39,
|
| 202 |
+
"LABEL_4": 4,
|
| 203 |
+
"LABEL_40": 40,
|
| 204 |
+
"LABEL_41": 41,
|
| 205 |
+
"LABEL_42": 42,
|
| 206 |
+
"LABEL_43": 43,
|
| 207 |
+
"LABEL_44": 44,
|
| 208 |
+
"LABEL_45": 45,
|
| 209 |
+
"LABEL_46": 46,
|
| 210 |
+
"LABEL_47": 47,
|
| 211 |
+
"LABEL_48": 48,
|
| 212 |
+
"LABEL_49": 49,
|
| 213 |
+
"LABEL_5": 5,
|
| 214 |
+
"LABEL_50": 50,
|
| 215 |
+
"LABEL_51": 51,
|
| 216 |
+
"LABEL_52": 52,
|
| 217 |
+
"LABEL_53": 53,
|
| 218 |
+
"LABEL_54": 54,
|
| 219 |
+
"LABEL_55": 55,
|
| 220 |
+
"LABEL_56": 56,
|
| 221 |
+
"LABEL_57": 57,
|
| 222 |
+
"LABEL_58": 58,
|
| 223 |
+
"LABEL_59": 59,
|
| 224 |
+
"LABEL_6": 6,
|
| 225 |
+
"LABEL_60": 60,
|
| 226 |
+
"LABEL_61": 61,
|
| 227 |
+
"LABEL_62": 62,
|
| 228 |
+
"LABEL_63": 63,
|
| 229 |
+
"LABEL_64": 64,
|
| 230 |
+
"LABEL_65": 65,
|
| 231 |
+
"LABEL_66": 66,
|
| 232 |
+
"LABEL_67": 67,
|
| 233 |
+
"LABEL_68": 68,
|
| 234 |
+
"LABEL_69": 69,
|
| 235 |
+
"LABEL_7": 7,
|
| 236 |
+
"LABEL_70": 70,
|
| 237 |
+
"LABEL_71": 71,
|
| 238 |
+
"LABEL_72": 72,
|
| 239 |
+
"LABEL_73": 73,
|
| 240 |
+
"LABEL_74": 74,
|
| 241 |
+
"LABEL_75": 75,
|
| 242 |
+
"LABEL_76": 76,
|
| 243 |
+
"LABEL_77": 77,
|
| 244 |
+
"LABEL_78": 78,
|
| 245 |
+
"LABEL_79": 79,
|
| 246 |
+
"LABEL_8": 8,
|
| 247 |
+
"LABEL_80": 80,
|
| 248 |
+
"LABEL_81": 81,
|
| 249 |
+
"LABEL_82": 82,
|
| 250 |
+
"LABEL_83": 83,
|
| 251 |
+
"LABEL_84": 84,
|
| 252 |
+
"LABEL_85": 85,
|
| 253 |
+
"LABEL_86": 86,
|
| 254 |
+
"LABEL_87": 87,
|
| 255 |
+
"LABEL_88": 88,
|
| 256 |
+
"LABEL_89": 89,
|
| 257 |
+
"LABEL_9": 9,
|
| 258 |
+
"LABEL_90": 90,
|
| 259 |
+
"LABEL_91": 91,
|
| 260 |
+
"LABEL_92": 92,
|
| 261 |
+
"LABEL_93": 93,
|
| 262 |
+
"LABEL_94": 94,
|
| 263 |
+
"LABEL_95": 95,
|
| 264 |
+
"LABEL_96": 96,
|
| 265 |
+
"LABEL_97": 97,
|
| 266 |
+
"LABEL_98": 98,
|
| 267 |
+
"LABEL_99": 99
|
| 268 |
+
},
|
| 269 |
+
"layer_norm_eps": 1e-12,
|
| 270 |
+
"max_position_embeddings": 512,
|
| 271 |
+
"model_type": "bert",
|
| 272 |
+
"num_attention_heads": 12,
|
| 273 |
+
"num_hidden_layers": 12,
|
| 274 |
+
"pad_token_id": 0,
|
| 275 |
+
"position_embedding_type": "absolute",
|
| 276 |
+
"problem_type": "single_label_classification",
|
| 277 |
+
"torch_dtype": "float32",
|
| 278 |
+
"transformers_version": "4.17.0",
|
| 279 |
+
"type_vocab_size": 2,
|
| 280 |
+
"use_cache": true,
|
| 281 |
+
"vocab_size": 31090
|
| 282 |
+
}
|
models/scibert/decode_dict.pkl
ADDED
|
Binary file (1.63 kB). View file
|
|
|
models/scibert/rng_state.pth
ADDED
|
Binary file (19.5 kB). View file
|
|
|
models/scibert/scheduler.pt
ADDED
|
Binary file (623 Bytes). View file
|
|
|
models/scibert/trainer_state.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_metric": null,
|
| 3 |
+
"best_model_checkpoint": null,
|
| 4 |
+
"epoch": 2.6007802340702213,
|
| 5 |
+
"global_step": 2000,
|
| 6 |
+
"is_hyper_param_search": false,
|
| 7 |
+
"is_local_process_zero": true,
|
| 8 |
+
"is_world_process_zero": true,
|
| 9 |
+
"log_history": [
|
| 10 |
+
{
|
| 11 |
+
"epoch": 0.65,
|
| 12 |
+
"learning_rate": 3.916341569137408e-05,
|
| 13 |
+
"loss": 1.4943,
|
| 14 |
+
"step": 500
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"epoch": 1.3,
|
| 18 |
+
"learning_rate": 2.832683138274816e-05,
|
| 19 |
+
"loss": 1.0861,
|
| 20 |
+
"step": 1000
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"epoch": 1.95,
|
| 24 |
+
"learning_rate": 1.7490247074122236e-05,
|
| 25 |
+
"loss": 0.9443,
|
| 26 |
+
"step": 1500
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"epoch": 2.6,
|
| 30 |
+
"learning_rate": 6.653662765496315e-06,
|
| 31 |
+
"loss": 0.7464,
|
| 32 |
+
"step": 2000
|
| 33 |
+
}
|
| 34 |
+
],
|
| 35 |
+
"max_steps": 2307,
|
| 36 |
+
"num_train_epochs": 3,
|
| 37 |
+
"total_flos": 1.1652712606267776e+16,
|
| 38 |
+
"trial_name": null,
|
| 39 |
+
"trial_params": null
|
| 40 |
+
}
|
models/scibert/training_args.bin
ADDED
|
Binary file (2.99 kB). View file
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
torch
|