{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n for filename in filenames:\n print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session\nimport torch\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nimport torch.optim as optim","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-04-02T18:30:02.008625Z","iopub.execute_input":"2023-04-02T18:30:02.009328Z","iopub.status.idle":"2023-04-02T18:30:04.758970Z","shell.execute_reply.started":"2023-04-02T18:30:02.009298Z","shell.execute_reply":"2023-04-02T18:30:04.757803Z"},"trusted":true},"execution_count":1,"outputs":[{"name":"stdout","text":"/kaggle/input/silero-stress-predictor/sample_submission.csv\n/kaggle/input/silero-stress-predictor/train.csv\n/kaggle/input/silero-stress-predictor/test.csv\n","output_type":"stream"}]},{"cell_type":"code","source":"torch.cuda.is_available()","metadata":{"execution":{"iopub.status.busy":"2023-04-02T18:30:04.761262Z","iopub.execute_input":"2023-04-02T18:30:04.761794Z","iopub.status.idle":"2023-04-02T18:30:04.843866Z","shell.execute_reply.started":"2023-04-02T18:30:04.761754Z","shell.execute_reply":"2023-04-02T18:30:04.842113Z"},"trusted":true},"execution_count":2,"outputs":[{"execution_count":2,"output_type":"execute_result","data":{"text/plain":"True"},"metadata":{}}]},{"cell_type":"code","source":"device = 'cuda' if torch.cuda.is_available() else 'cpu'","metadata":{"execution":{"iopub.status.busy":"2023-04-02T18:30:04.845010Z","iopub.execute_input":"2023-04-02T18:30:04.845401Z","iopub.status.idle":"2023-04-02T18:30:04.852435Z","shell.execute_reply.started":"2023-04-02T18:30:04.845363Z","shell.execute_reply":"2023-04-02T18:30:04.851256Z"},"trusted":true},"execution_count":3,"outputs":[]},{"cell_type":"markdown","source":"# Предобработка","metadata":{}},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/silero-stress-predictor/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-04-02T18:30:04.855676Z","iopub.execute_input":"2023-04-02T18:30:04.856258Z","iopub.status.idle":"2023-04-02T18:30:05.033608Z","shell.execute_reply.started":"2023-04-02T18:30:04.856218Z","shell.execute_reply":"2023-04-02T18:30:05.032496Z"},"trusted":true},"execution_count":4,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2023-04-02T18:30:05.038925Z","iopub.execute_input":"2023-04-02T18:30:05.041482Z","iopub.status.idle":"2023-04-02T18:30:05.072535Z","shell.execute_reply.started":"2023-04-02T18:30:05.041426Z","shell.execute_reply":"2023-04-02T18:30:05.071457Z"},"trusted":true},"execution_count":5,"outputs":[{"execution_count":5,"output_type":"execute_result","data":{"text/plain":" id word stress num_syllables lemma\n0 0 румяной 2 3 румяный\n1 1 цифрами 1 3 цифра\n2 2 слугами 1 3 слуга\n3 3 выбирает 3 4 выбирать\n4 4 управдом 3 3 управдом\n... ... ... ... ... ...\n63433 63433 экзамена 2 4 экзамен\n63434 63434 культурой 2 3 культура\n63435 63435 объемной 2 3 объемный\n63436 63436 участком 2 3 участок\n63437 63437 ташкента 2 3 ташкент\n\n[63438 rows x 5 columns]","text/html":"
| \n | id | \nword | \nstress | \nnum_syllables | \nlemma | \n
|---|---|---|---|---|---|
| 0 | \n0 | \nрумяной | \n2 | \n3 | \nрумяный | \n
| 1 | \n1 | \nцифрами | \n1 | \n3 | \nцифра | \n
| 2 | \n2 | \nслугами | \n1 | \n3 | \nслуга | \n
| 3 | \n3 | \nвыбирает | \n3 | \n4 | \nвыбирать | \n
| 4 | \n4 | \nуправдом | \n3 | \n3 | \nуправдом | \n
| ... | \n... | \n... | \n... | \n... | \n... | \n
| 63433 | \n63433 | \nэкзамена | \n2 | \n4 | \nэкзамен | \n
| 63434 | \n63434 | \nкультурой | \n2 | \n3 | \nкультура | \n
| 63435 | \n63435 | \nобъемной | \n2 | \n3 | \nобъемный | \n
| 63436 | \n63436 | \nучастком | \n2 | \n3 | \nучасток | \n
| 63437 | \n63437 | \nташкента | \n2 | \n3 | \nташкент | \n
63438 rows × 5 columns
\n| \n | id | \nword | \nnum_syllables | \nlemma | \n
|---|---|---|---|---|
| 0 | \n0 | \nэпилепсия | \n5 | \nэпилепсия | \n
| 1 | \n1 | \nотносящейся | \n5 | \nотноситься | \n
| 2 | \n2 | \nразмышлениями | \n6 | \nразмышление | \n
| 3 | \n3 | \nмодемы | \n3 | \nмодем | \n
| 4 | \n4 | \nсолнц | \n1 | \nсолнце | \n
| ... | \n... | \n... | \n... | \n... | \n
| 29955 | \n29955 | \nдонбасса | \n3 | \nдонбасс | \n
| 29956 | \n29956 | \nобложка | \n3 | \nобложка | \n
| 29957 | \n29957 | \nправителя | \n4 | \nправитель | \n
| 29958 | \n29958 | \nшерстяной | \n3 | \nшерстяной | \n
| 29959 | \n29959 | \nоптимизации | \n6 | \nоптимизация | \n
29960 rows × 4 columns
\n| \n | id | \nstress | \n
|---|---|---|
| 0 | \n0 | \n3 | \n
| 1 | \n1 | \n3 | \n
| 2 | \n2 | \n3 | \n
| 3 | \n3 | \n2 | \n
| 4 | \n4 | \n1 | \n
| ... | \n... | \n... | \n
| 29955 | \n29955 | \n2 | \n
| 29956 | \n29956 | \n2 | \n
| 29957 | \n29957 | \n2 | \n
| 29958 | \n29958 | \n3 | \n
| 29959 | \n29959 | \n4 | \n
29960 rows × 2 columns
\n