Kirill
commited on
Commit
·
abc2c55
1
Parent(s):
2c26172
fix app.py
Browse files- app.py +2 -2
- model_train.ipynb +2 -7
- tags.txt +155 -0
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from torch.nn.functional import softmax
|
|
| 8 |
|
| 9 |
base_model_name = 'distilbert-base-uncased'
|
| 10 |
|
| 11 |
-
@st.
|
| 12 |
def load_tags_info():
|
| 13 |
|
| 14 |
id_to_description = {}
|
|
@@ -26,7 +26,7 @@ def load_tags_info():
|
|
| 26 |
|
| 27 |
id_to_description = load_tags_info()
|
| 28 |
|
| 29 |
-
@st.
|
| 30 |
def load_model():
|
| 31 |
return DistilBertForSequenceClassification.from_pretrained('./')
|
| 32 |
|
|
|
|
| 8 |
|
| 9 |
base_model_name = 'distilbert-base-uncased'
|
| 10 |
|
| 11 |
+
@st.cache_data
|
| 12 |
def load_tags_info():
|
| 13 |
|
| 14 |
id_to_description = {}
|
|
|
|
| 26 |
|
| 27 |
id_to_description = load_tags_info()
|
| 28 |
|
| 29 |
+
@st.cache_resource
|
| 30 |
def load_model():
|
| 31 |
return DistilBertForSequenceClassification.from_pretrained('./')
|
| 32 |
|
model_train.ipynb
CHANGED
|
@@ -599,8 +599,7 @@
|
|
| 599 |
"cell_type": "markdown",
|
| 600 |
"id": "52f5d981",
|
| 601 |
"metadata": {
|
| 602 |
-
"id": "52f5d981"
|
| 603 |
-
"jp-MarkdownHeadingCollapsed": true
|
| 604 |
},
|
| 605 |
"source": [
|
| 606 |
"## Токенизация"
|
|
@@ -822,8 +821,7 @@
|
|
| 822 |
" plt.grid()\n",
|
| 823 |
" plt.xlabel('epoch')\n",
|
| 824 |
" plt.ylabel('loss function')\n",
|
| 825 |
-
" plt.show()
|
| 826 |
-
" "
|
| 827 |
]
|
| 828 |
},
|
| 829 |
{
|
|
@@ -835,8 +833,6 @@
|
|
| 835 |
},
|
| 836 |
"outputs": [],
|
| 837 |
"source": [
|
| 838 |
-
"#!g1.1\n",
|
| 839 |
-
"\n",
|
| 840 |
"device = 'cuda'\n",
|
| 841 |
"\n",
|
| 842 |
"import IPython\n",
|
|
@@ -1102,7 +1098,6 @@
|
|
| 1102 |
}
|
| 1103 |
],
|
| 1104 |
"source": [
|
| 1105 |
-
"#!g1.1\n",
|
| 1106 |
"import torch.nn as nn\n",
|
| 1107 |
"import torch.nn.functional as F\n",
|
| 1108 |
"\n",
|
|
|
|
| 599 |
"cell_type": "markdown",
|
| 600 |
"id": "52f5d981",
|
| 601 |
"metadata": {
|
| 602 |
+
"id": "52f5d981"
|
|
|
|
| 603 |
},
|
| 604 |
"source": [
|
| 605 |
"## Токенизация"
|
|
|
|
| 821 |
" plt.grid()\n",
|
| 822 |
" plt.xlabel('epoch')\n",
|
| 823 |
" plt.ylabel('loss function')\n",
|
| 824 |
+
" plt.show()"
|
|
|
|
| 825 |
]
|
| 826 |
},
|
| 827 |
{
|
|
|
|
| 833 |
},
|
| 834 |
"outputs": [],
|
| 835 |
"source": [
|
|
|
|
|
|
|
| 836 |
"device = 'cuda'\n",
|
| 837 |
"\n",
|
| 838 |
"import IPython\n",
|
|
|
|
| 1098 |
}
|
| 1099 |
],
|
| 1100 |
"source": [
|
|
|
|
| 1101 |
"import torch.nn as nn\n",
|
| 1102 |
"import torch.nn.functional as F\n",
|
| 1103 |
"\n",
|
tags.txt
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cs.AI Artificial Intelligence
|
| 2 |
+
cs.AR Hardware Architecture
|
| 3 |
+
cs.CC Computational Complexity
|
| 4 |
+
cs.CE Computational Engineering, Finance, and Science
|
| 5 |
+
cs.CG Computational Geometry
|
| 6 |
+
cs.CL Computation and Language
|
| 7 |
+
cs.CR Cryptography and Security
|
| 8 |
+
cs.CV Computer Vision and Pattern Recognition
|
| 9 |
+
cs.CY Computers and Society
|
| 10 |
+
cs.DB Databases
|
| 11 |
+
cs.DC Distributed, Parallel, and Cluster Computing
|
| 12 |
+
cs.DL Digital Libraries
|
| 13 |
+
cs.DM Discrete Mathematics
|
| 14 |
+
cs.DS Data Structures and Algorithms
|
| 15 |
+
cs.ET Emerging Technologies
|
| 16 |
+
cs.FL Formal Languages and Automata Theory
|
| 17 |
+
cs.GL General Literature
|
| 18 |
+
cs.GR Graphics
|
| 19 |
+
cs.GT Computer Science and Game Theory
|
| 20 |
+
cs.HC Human-Computer Interaction
|
| 21 |
+
cs.IR Information Retrieval
|
| 22 |
+
cs.IT Information Theory
|
| 23 |
+
cs.LG Machine Learning
|
| 24 |
+
cs.LO Logic in Computer Science
|
| 25 |
+
cs.MA Multiagent Systems
|
| 26 |
+
cs.MM Multimedia
|
| 27 |
+
cs.MS Mathematical Software
|
| 28 |
+
cs.NA Numerical Analysis
|
| 29 |
+
cs.NE Neural and Evolutionary Computing
|
| 30 |
+
cs.NI Networking and Internet Architecture
|
| 31 |
+
cs.OH Other Computer Science
|
| 32 |
+
cs.OS Operating Systems
|
| 33 |
+
cs.PF Performance
|
| 34 |
+
cs.PL Programming Languages
|
| 35 |
+
cs.RO Robotics
|
| 36 |
+
cs.SC Symbolic Computation
|
| 37 |
+
cs.SD Sound
|
| 38 |
+
cs.SE Software Engineering
|
| 39 |
+
cs.SI Social and Information Networks
|
| 40 |
+
cs.SY Systems and Control
|
| 41 |
+
econ.EM Econometrics
|
| 42 |
+
econ.GN General Economics
|
| 43 |
+
econ.TH Theoretical Economics
|
| 44 |
+
eess.AS Audio and Speech Processing
|
| 45 |
+
eess.IV Image and Video Processing
|
| 46 |
+
eess.SP Signal Processing
|
| 47 |
+
eess.SY Systems and Control
|
| 48 |
+
math.AC Commutative Algebra
|
| 49 |
+
math.AG Algebraic Geometry
|
| 50 |
+
math.AP Analysis of PDEs
|
| 51 |
+
math.AT Algebraic Topology
|
| 52 |
+
math.CA Classical Analysis and ODEs
|
| 53 |
+
math.CO Combinatorics
|
| 54 |
+
math.CT Category Theory
|
| 55 |
+
math.CV Complex Variables
|
| 56 |
+
math.DG Differential Geometry
|
| 57 |
+
math.DS Dynamical Systems
|
| 58 |
+
math.FA Functional Analysis
|
| 59 |
+
math.GM General Mathematics
|
| 60 |
+
math.GN General Topology
|
| 61 |
+
math.GR Group Theory
|
| 62 |
+
math.GT Geometric Topology
|
| 63 |
+
math.HO History and Overview
|
| 64 |
+
math.IT Information Theory
|
| 65 |
+
math.KT K-Theory and Homology
|
| 66 |
+
math.LO Logic
|
| 67 |
+
math.MG Metric Geometry
|
| 68 |
+
math.MP Mathematical Physics
|
| 69 |
+
math.NA Numerical Analysis
|
| 70 |
+
math.NT Number Theory
|
| 71 |
+
math.OA Operator Algebras
|
| 72 |
+
math.OC Optimization and Control
|
| 73 |
+
math.PR Probability
|
| 74 |
+
math.QA Quantum Algebra
|
| 75 |
+
math.RA Rings and Algebras
|
| 76 |
+
math.RT Representation Theory
|
| 77 |
+
math.SG Symplectic Geometry
|
| 78 |
+
math.SP Spectral Theory
|
| 79 |
+
math.ST Statistics Theory
|
| 80 |
+
astro-ph.CO Cosmology and Nongalactic Astrophysics
|
| 81 |
+
astro-ph.EP Earth and Planetary Astrophysics
|
| 82 |
+
astro-ph.GA Astrophysics of Galaxies
|
| 83 |
+
astro-ph.HE High Energy Astrophysical Phenomena
|
| 84 |
+
astro-ph.IM Instrumentation and Methods for Astrophysics
|
| 85 |
+
astro-ph.SR Solar and Stellar Astrophysics
|
| 86 |
+
cond-mat.dis-nn Disordered Systems and Neural Networks
|
| 87 |
+
cond-mat.mes-hall Mesoscale and Nanoscale Physics
|
| 88 |
+
cond-mat.mtrl-sci Materials Science
|
| 89 |
+
cond-mat.other Other Condensed Matter
|
| 90 |
+
cond-mat.quant-gas Quantum Gases
|
| 91 |
+
cond-mat.soft Soft Condensed Matter
|
| 92 |
+
cond-mat.stat-mech Statistical Mechanics
|
| 93 |
+
cond-mat.str-el Strongly Correlated Electrons
|
| 94 |
+
cond-mat.supr-con Superconductivity
|
| 95 |
+
gr-qc General Relativity and Quantum Cosmology
|
| 96 |
+
hep-ex High Energy Physics - Experiment
|
| 97 |
+
hep-lat High Energy Physics - Lattice
|
| 98 |
+
hep-ph High Energy Physics - Phenomenology
|
| 99 |
+
hep-th High Energy Physics - Theory
|
| 100 |
+
math-ph Mathematical Physics
|
| 101 |
+
nlin.AO Adaptation and Self-Organizing Systems
|
| 102 |
+
nlin.CD Chaotic Dynamics
|
| 103 |
+
nlin.CG Cellular Automata and Lattice Gases
|
| 104 |
+
nlin.PS Pattern Formation and Solitons
|
| 105 |
+
nlin.SI Exactly Solvable and Integrable Systems
|
| 106 |
+
nucl-ex Nuclear Experiment
|
| 107 |
+
nucl-th Nuclear Theory
|
| 108 |
+
physics.acc-ph Accelerator Physics
|
| 109 |
+
physics.ao-ph Atmospheric and Oceanic Physics
|
| 110 |
+
physics.app-ph Applied Physics
|
| 111 |
+
physics.atm-clus Atomic and Molecular Clusters
|
| 112 |
+
physics.atom-ph Atomic Physics
|
| 113 |
+
physics.bio-ph Biological Physics
|
| 114 |
+
physics.chem-ph Chemical Physics
|
| 115 |
+
physics.class-ph Classical Physics
|
| 116 |
+
physics.comp-ph Computational Physics
|
| 117 |
+
physics.data-an Data Analysis, Statistics and Probability
|
| 118 |
+
physics.ed-ph Physics Education
|
| 119 |
+
physics.flu-dyn Fluid Dynamics
|
| 120 |
+
physics.gen-ph General Physics
|
| 121 |
+
physics.geo-ph Geophysics
|
| 122 |
+
physics.hist-ph History and Philosophy of Physics
|
| 123 |
+
physics.ins-det Instrumentation and Detectors
|
| 124 |
+
physics.med-ph Medical Physics
|
| 125 |
+
physics.optics Optics
|
| 126 |
+
physics.plasm-ph Plasma Physics
|
| 127 |
+
physics.pop-ph Popular Physics
|
| 128 |
+
physics.soc-ph Physics and Society
|
| 129 |
+
physics.space-ph Space Physics
|
| 130 |
+
quant-ph Quantum Physics
|
| 131 |
+
q-bio.BM Biomolecules
|
| 132 |
+
q-bio.CB Cell Behavior
|
| 133 |
+
q-bio.GN Genomics
|
| 134 |
+
q-bio.MN Molecular Networks
|
| 135 |
+
q-bio.NC Neurons and Cognition
|
| 136 |
+
q-bio.OT Other Quantitative Biology
|
| 137 |
+
q-bio.PE Populations and Evolution
|
| 138 |
+
q-bio.QM Quantitative Methods
|
| 139 |
+
q-bio.SC Subcellular Processes
|
| 140 |
+
q-bio.TO Tissues and Organs
|
| 141 |
+
q-fin.CP Computational Finance
|
| 142 |
+
q-fin.EC Economics
|
| 143 |
+
q-fin.GN General Finance
|
| 144 |
+
q-fin.MF Mathematical Finance
|
| 145 |
+
q-fin.PM Portfolio Management
|
| 146 |
+
q-fin.PR Pricing of Securities
|
| 147 |
+
q-fin.RM Risk Management
|
| 148 |
+
q-fin.ST Statistical Finance
|
| 149 |
+
q-fin.TR Trading and Market Microstructure
|
| 150 |
+
stat.AP Applications
|
| 151 |
+
stat.CO Computation
|
| 152 |
+
stat.ME Methodology
|
| 153 |
+
stat.ML Machine Learning
|
| 154 |
+
stat.OT Other Statistics
|
| 155 |
+
stat.TH Statistics Theory
|