{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "60484ff2", "metadata": {}, "outputs": [], "source": [ "import torch\n", "import pandas as pd\n", "import seaborn as sns\n", "import numpy as np\n", "import re\n", "import unicodedata\n", "\n", "import torch.nn as nn\n", "from torch.utils.data import Dataset, WeightedRandomSampler\n", "from transformers import AutoTokenizer, AutoModel\n", "\n", "from sklearn.metrics import accuracy_score, f1_score" ] }, { "cell_type": "markdown", "id": "b8bd2483", "metadata": {}, "source": [ "### Чтение данных" ] }, { "cell_type": "code", "execution_count": 2, "id": "8c3bc1a0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Title | \n", "Description | \n", "Price | \n", "Capacity | \n", "Grape | \n", "Secondary Grape Varieties | \n", "Closure | \n", "Country | \n", "Unit | \n", "Characteristics | \n", "Per bottle / case / each | \n", "Type | \n", "ABV | \n", "Region | \n", "Style | \n", "Vintage | \n", "Appellation | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "The Guv'nor, Spain | \n", "We asked some of our most prized winemakers wo... | \n", "£9.99 per bottle | \n", "75CL | \n", "Tempranillo | \n", "NaN | \n", "Natural Cork | \n", "Spain | \n", "10.5 | \n", "Vanilla, Blackberry, Blackcurrant | \n", "per bottle | \n", "Red | \n", "ABV 14.00% | \n", "NaN | \n", "Rich & Juicy | \n", "NV | \n", "NaN | \n", "
| 1 | \n", "Bread & Butter 'Winemaker's Selection' Chardon... | \n", "This really does what it says on the tin. It’s... | \n", "£15.99 per bottle | \n", "75CL | \n", "Chardonnay | \n", "NaN | \n", "Natural Cork | \n", "USA | \n", "10.1 | \n", "Vanilla, Almond, Coconut, Green Apple, Peach, ... | \n", "per bottle | \n", "White | \n", "ABV 13.50% | \n", "California | \n", "Rich & Toasty | \n", "2021 | \n", "Napa Valley | \n", "
| 2 | \n", "Oyster Bay Sauvignon Blanc 2022, Marlborough | \n", "Oyster Bay has been an award-winning gold-stan... | \n", "£12.49 per bottle | \n", "75CL | \n", "Sauvignon Blanc | \n", "NaN | \n", "Screwcap | \n", "New Zealand | \n", "9.8 | \n", "Tropical Fruit, Gooseberry, Grapefruit, Grass,... | \n", "per bottle | \n", "White | \n", "ABV 13.00% | \n", "Marlborough | \n", "Crisp & Zesty | \n", "2022 | \n", "NaN | \n", "
| 3 | \n", "Louis Latour Mâcon-Lugny 2021/22 | \n", "We’ve sold this wine for thirty years – and fo... | \n", "£17.99 per bottle | \n", "75CL | \n", "Chardonnay | \n", "NaN | \n", "Natural Cork | \n", "France | \n", "10.1 | \n", "Peach, Apricot, Floral, Lemon | \n", "per bottle | \n", "White | \n", "ABV 13.50% | \n", "Burgundy | \n", "Ripe & Rounded | \n", "2022 | \n", "Macon | \n", "
| 4 | \n", "Bread & Butter 'Winemaker's Selection' Pinot N... | \n", "Bread & Butter is that thing that you can coun... | \n", "£15.99 per bottle | \n", "75CL | \n", "Pinot Noir | \n", "NaN | \n", "Natural Cork | \n", "USA | \n", "10.1 | \n", "Smoke, Black Cherry, Cedar, Raspberry, Red Fruit | \n", "per bottle | \n", "Red | \n", "ABV 13.50% | \n", "California | \n", "Smooth & Mellow | \n", "2021 | \n", "Napa Valley | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 1285 | \n", "Vouvray Sec 'Expresion de Silex' 2020/21, Loire | \n", "Although Denis Meunier is only in his late 20s... | \n", "£11.99 per bottle | \n", "75CL | \n", "Chenin Blanc | \n", "NaN | \n", "Natural Cork | \n", "France | \n", "9.4 | \n", "Quince, Green Apple, Lemon, Pear | \n", "per bottle | \n", "White | \n", "ABV 12.50% | \n", "Loire | \n", "Aromatic & Floral | \n", "2021 | \n", "Vouvray | \n", "
| 1286 | \n", "Waimea Estates Pinot Noir Rosé 2021, Nelson | \n", "Waimea’s vineyards are less than 1km from the ... | \n", "£13.99 per bottle | \n", "75CL | \n", "Pinot Noir | \n", "NaN | \n", "Screwcap | \n", "New Zealand | \n", "9.8 | \n", "Floral, Raspberry, Red Cherry, Strawberry | \n", "per bottle | \n", "Rosé | \n", "ABV 13.00% | \n", "Nelson | \n", "Delicate & Dry | \n", "2021 | \n", "NaN | \n", "
| 1287 | \n", "Wakefield 'Visionary' Cabernet Sauvignon 2010 | \n", "Made from the very best fruit nourished by 40-... | \n", "£85.00 per bottle | \n", "75CL | \n", "Cabernet Sauvignon | \n", "NaN | \n", "Screwcap | \n", "Australia | \n", "10.1 | \n", "Vanilla, Blackberry, Blackcurrant, Cedar, Euca... | \n", "per bottle | \n", "Red | \n", "ABV 13.50% | \n", "South Australia | \n", "Savoury & Full Bodied | \n", "2010 | \n", "Clare Valley | \n", "
| 1288 | \n", "Yalumba 'The Menzies' Cabernet Sauvignon 2015/... | \n", "In 1961, Sir Robert Menzies said that Yalumba'... | \n", "£37.99 per bottle | \n", "75CL | \n", "Cabernet Sauvignon | \n", "NaN | \n", "Natural Cork | \n", "Australia | \n", "10.9 | \n", "Black Plum, Blackcurrant, Vanilla | \n", "per bottle | \n", "Red | \n", "ABV 14.50% | \n", "South Australia | \n", "Savoury & Full Bodied | \n", "2016 | \n", "Coonawarra | \n", "
| 1289 | \n", "Yalumba 'Virgilius' Viognier 2017, Eden Valley | \n", "Yalumba's Virgilius is often regarded as Austr... | \n", "£34.99 per bottle | \n", "75CL | \n", "Viognier | \n", "NaN | \n", "Screwcap | \n", "Australia | \n", "10.1 | \n", "Peach, Apricot, Floral, Honeysuckle | \n", "per bottle | \n", "White | \n", "ABV 13.50% | \n", "NaN | \n", "Aromatic & Floral | \n", "2017 | \n", "Eden Valley | \n", "
1290 rows × 17 columns
\n", "| \n", " | Description | \n", "Type | \n", "
|---|---|---|
| 0 | \n", "We asked some of our most prized winemakers wo... | \n", "Red | \n", "
| 1 | \n", "This really does what it says on the tin. It’s... | \n", "White | \n", "
| 2 | \n", "Oyster Bay has been an award-winning gold-stan... | \n", "White | \n", "
| 3 | \n", "We’ve sold this wine for thirty years – and fo... | \n", "White | \n", "
| 4 | \n", "Bread & Butter is that thing that you can coun... | \n", "Red | \n", "
| ... | \n", "... | \n", "... | \n", "
| 1285 | \n", "Although Denis Meunier is only in his late 20s... | \n", "White | \n", "
| 1286 | \n", "Waimea’s vineyards are less than 1km from the ... | \n", "Rosé | \n", "
| 1287 | \n", "Made from the very best fruit nourished by 40-... | \n", "Red | \n", "
| 1288 | \n", "In 1961, Sir Robert Menzies said that Yalumba'... | \n", "Red | \n", "
| 1289 | \n", "Yalumba's Virgilius is often regarded as Austr... | \n", "White | \n", "
1290 rows × 2 columns
\n", "