Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
New: Add file with examples
Browse files- app.py +2 -6
- lib/examples.py +118 -0
app.py
CHANGED
|
@@ -33,6 +33,7 @@ from lib.bert_regressor_utils import (
|
|
| 33 |
ICONS
|
| 34 |
)
|
| 35 |
from lib.wheel import build_svg_with_values
|
|
|
|
| 36 |
|
| 37 |
### Stettings ####################################################################
|
| 38 |
|
|
@@ -162,11 +163,6 @@ def predict(review: str):
|
|
| 162 |
|
| 163 |
##################################################################################
|
| 164 |
|
| 165 |
-
EXAMPLES = [
|
| 166 |
-
"Fresh apples, honey, vanilla and a touch of smoke.",
|
| 167 |
-
"Thick sherry, raisins and dark chocolate with gentle peat.",
|
| 168 |
-
]
|
| 169 |
-
|
| 170 |
def replace_text():
|
| 171 |
return random.choice(EXAMPLES)
|
| 172 |
|
|
@@ -180,7 +176,7 @@ with gr.Blocks() as demo:
|
|
| 180 |
label="Whisky Review",
|
| 181 |
lines=8,
|
| 182 |
placeholder="Enter whisky review",
|
| 183 |
-
value=EXAMPLES
|
| 184 |
)
|
| 185 |
with gr.Row():
|
| 186 |
replace_btn = gr.Button("Replace Example", variant="secondary", scale=1)
|
|
|
|
| 33 |
ICONS
|
| 34 |
)
|
| 35 |
from lib.wheel import build_svg_with_values
|
| 36 |
+
from lib.examples import EXAMPLES
|
| 37 |
|
| 38 |
### Stettings ####################################################################
|
| 39 |
|
|
|
|
| 163 |
|
| 164 |
##################################################################################
|
| 165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
def replace_text():
|
| 167 |
return random.choice(EXAMPLES)
|
| 168 |
|
|
|
|
| 176 |
label="Whisky Review",
|
| 177 |
lines=8,
|
| 178 |
placeholder="Enter whisky review",
|
| 179 |
+
value=random.choice(EXAMPLES),
|
| 180 |
)
|
| 181 |
with gr.Row():
|
| 182 |
replace_btn = gr.Button("Replace Example", variant="secondary", scale=1)
|
lib/examples.py
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
EXAMPLES = [
|
| 2 |
+
"Sweet vanilla counterbalanced with lemon and lime followed by that surging Ardbeg smoke that we all know and love.",
|
| 3 |
+
"Good body, oily, tar, elegant smoke. Hints of boiled sweets.",
|
| 4 |
+
"Soft velvety sweetness reminiscent of shortbread with a rich mouth coating, vanilla sweetness, with lightly toasted marshmallow, dried oranges, fig and cinnamon.",
|
| 5 |
+
"Soft and mouthfilling, with creamy apricot and peach, and juicy, sweet guava. Boiled sweeties, distant spice, mellow old oak, orange peels, and a touch of bitter pith.",
|
| 6 |
+
"Silken, spicy and peppery oak. Almond, praline, hazelnut, dried peels, fruity. Touch of Armagnac, hint of rancio perhaps?",
|
| 7 |
+
"Robust layers of sweet peat and peppery spice, with waves of pungent smoke, salted caramel, and juicy barley. Creamier notes of polished oak join in time, with peppercorns and nutmeg nestling right on the edges.",
|
| 8 |
+
"Sea salt and kippers, dark chocolate, sultanas, a touch of cantaloupe.",
|
| 9 |
+
"Big, bold waves of creamy vanilla sweetness couple with drying, oaken spice. Malted Milk biscuits, and the zesty, chilli zing of Tajin seasoning. Bubblegum sweetness and French toast crisp bakes join ancient grain and maple pastries.",
|
| 10 |
+
"Waves of honey and vanilla fudge, dotted with raisin, almond and another helping of cinnamon spiciness.",
|
| 11 |
+
"It's a goodie! Brimming with layers of peat smoke, with notes of smoky cured meats, a touch of fennel, then sweeter suggestions of rooibos tea and dried red fruits. There's some peppercorn and candied ginger heat in tow, but creamy oaken vanilla keeps it in check.",
|
| 12 |
+
"Fragrant wood with a touch of smoke to it, mellowed by vanilla tablet and shortbread. A good crackle of peppercorn and some oily malt.",
|
| 13 |
+
"Creamy and honeyed with some thick-cut marmalade, cinnamon and warm pastries.",
|
| 14 |
+
"Peaches, dried apricots, dark berries, and cherries mingle with caramelised nuts, chocolate raisins, brown sugar, and baking spices.",
|
| 15 |
+
"Full and rich with notes of berry fruits, and honey and butter on granary toast. More sherry, caramel and toasted almond.",
|
| 16 |
+
"Bright and creamy, with notes of banana fritters, honeyed sultanas, and berry-studded chocolate. Melon, lemon drops, malty biscuits, and buttery oak join, as gentle spices bring distant warmth.",
|
| 17 |
+
"Vanilla tablet and chocolate chip cookies lead the way, backed by hints of marmalade, sultanas, and honeyed oats.",
|
| 18 |
+
"Soft and rich, with flavours of dark chocolate coated ginger with dates and dried apricots, balanced with oak and the sweetness of vanilla.",
|
| 19 |
+
"A fine Sherried character, fruity aromas balanced with rich chocolate.",
|
| 20 |
+
"Rich layers of dark stewed fruits, coffee, and chocolate raisins join burnt custard, plums, and dark cherries.",
|
| 21 |
+
"Quite light, great clarity. Orange, soft acidity. Dry oak. Mixed fruits, vanilla, leather.",
|
| 22 |
+
"Very fruity palate with a mix of stewed fruits, dessert wine, apple peels and honey. Becomes quite oaky late palate.",
|
| 23 |
+
"Medium-body and quite firm. There are notes of hot pastries and marmalade, sultanas and peels with a developing sweetness from the barley sugar.",
|
| 24 |
+
"Meaty chewy sweet peat, salted tablet and tarry smoke are joined by rich dark chocolate and a touch of billtong.",
|
| 25 |
+
"Sweet vanilla forms a creamy palate with notes of apples and mangoes with a hint of orange in the background.",
|
| 26 |
+
"Chocolate-chip brioche, zesty Seville orange marmalade, cinnamon sticks, maple syrup, yet more dried fruit by the bucket load.",
|
| 27 |
+
"Fresh and balanced, vanilla. Boiled sweets, very creamy, tiramisu, toffee.",
|
| 28 |
+
"Dark, runny caramel, chocolate raisins, stewed forest fruits, and a dusting of sweet cinnamon.",
|
| 29 |
+
"Balanced and rounded nose - lots of fruit here, with a little toffee and malt.",
|
| 30 |
+
"Dried fruits galore, with a dusting of cinnamon, candied ginger and orange peel.",
|
| 31 |
+
"Full and rich with notes of chewy, tannic oak. Manuka honey and walnut with Cox’s apples and orange peels. Cut herbs - fennel and spearmint.",
|
| 32 |
+
"Pebbly minerality with crisp peat smoke, sweet, dark caramel, and biscuity malt. Creamy oak and peppery barley tangle beneath.",
|
| 33 |
+
"Nutty brown bread with a thin layer of blackcurrant jam. Slight smokiness along the way.",
|
| 34 |
+
"Savoury, salty, and active on the palate with coal dust, chimney soot, soft, ripe fruits.",
|
| 35 |
+
"Medium, lovely delivery. Zesty orange, Curaçao, chocolate. Winter spice, stem ginger in syrup. Hints of anise and a little hickory.",
|
| 36 |
+
"Clove, maple syrup, blackcurrant compote, golden raisins, and crystalised ginger.",
|
| 37 |
+
"Robust and earthy, with burnt coffee grounds, bold peat smoke, and dustings of cocoa and cinnamon. Sticky, stewed stone fruits join in the depths, with salted dark chocolate in tow.",
|
| 38 |
+
"Coastal peat and exotic fruit mingle, bringing a balance of salted papaya and fresh charcoal. Rich oak char follows, with hearty notes of cacao and wintery spice.",
|
| 39 |
+
"White fruit, sponge cake, lemon, oatcakes and smoked cheese.",
|
| 40 |
+
"Walnut, raisin, Christmas spices and fresh ginger.",
|
| 41 |
+
"Thick with rich butterscotch, freshly baked cookies dotted with chocolate chunks, slightly peppery at points with a dry hint of toasted cedar.",
|
| 42 |
+
"Big and bold with vanilla fudge and boozy dried fruits opening the way for sweet, nutty malt. Chocolate raisins and Brazil nuts follow, with notes of wood polish and brandy snaps.",
|
| 43 |
+
"A generous burst of tropical fruit and dried raisin opens the palate. Warming smoke continues to waft playfully.",
|
| 44 |
+
"Oily malt arrives first, followed by BBQ pineapple and summer berries. Pine nuts and almonds.",
|
| 45 |
+
"Melted white chocolate, toasted walnut, sugared almonds, gingersnap biscuits, marzipan.",
|
| 46 |
+
"Lots of plum, juicy raisin, fried banana, raspberry jam doughnuts and oak spice.",
|
| 47 |
+
"Rich and sticky with swirls of honeycomb, orange syrup, and brioche, balanced by a soft drumbeat of spice and lemon zestiness.",
|
| 48 |
+
"Scottish tablet, apples, nutty malt, clotted cream, and gentle peat smoke.",
|
| 49 |
+
"Salt-baked pear, meadowsweet, wildflowers, lemon thyme. Sultanas, cherrywood embers, cocoa powder, pink peppercorns.",
|
| 50 |
+
"Cream, spices, tingling, fresh fruit, medicinal, plasters, Clementines. Orange peels.",
|
| 51 |
+
"A rich, creamy mouthfeel drifts into sharp, sooty and spicy notes of creosote, aniseed, and clove. Tempered by the distinct sweetness of muscovado sugar, robust woody notes orbit rich charcoal.",
|
| 52 |
+
"Red apples and white grapes, with touches of sweet cinnamon and brown sugar. Still softly coastal.",
|
| 53 |
+
"Coastal smoke, with some salted toffee, and more sherry character.",
|
| 54 |
+
"Delicious sherry sweetness and dried fruits, with complex, delicate winter spices and fruitcake. Light toffee, and a hint of smoke.",
|
| 55 |
+
"The palate is full and rich with winter spice; cinnamon and cloves, thick oak with developing aridity.",
|
| 56 |
+
"Smokehouse, caramelised bacon, and smouldering bonfires, with sweet sherry character tying it together.",
|
| 57 |
+
"Incredibly clean central palate, but amazingly tangy. Really zingy top notes. Sherry and creamy barley, hints of gingerbread and nutty chocolate.",
|
| 58 |
+
"Sweet. Quite malty, digestive biscuits, followed by green fruits and Cox's apple peel.",
|
| 59 |
+
"Led by sweet, ripe fruit and black forest honey. A good helping of malt. The throne then usurped by a powerful peat and smoked barley.",
|
| 60 |
+
"Creamy vanilla, leathery oak, some dried herbs, and plump raisins join butterscotch and nutty maple syrup.",
|
| 61 |
+
"Soft, creamy notes of vanilla tablet soon give way to robust, vegetal peat. There are coastal notes of charred samphire, backed by custard tarts, and baked, spiced apples.",
|
| 62 |
+
"Lemon cheesecake and orange boiled sweets, shortly followed by stem ginger and beeswax.",
|
| 63 |
+
"More roasted cedar and peat smoke, with a hint of iodine tucked away. Dark chocolate, honey, and vanilla pod.",
|
| 64 |
+
"Lively with hints of bitter chocolate, ash and a spicy chili bite.",
|
| 65 |
+
"Sweet layers of berries and jammy stone fruits cushion notes of black peppercorns and a touch of woody spice.",
|
| 66 |
+
"Brown sugar, nutmeg, roast chestnuts, cask char, loads of phenolic notes drifting in.",
|
| 67 |
+
"The palate is very pleasantly sweet and salty. Citrus oils and orchard fruits are present along with an unmistakable dark berry tartness which is joined by plenty of damp peat and dry wood smoke. Adding depth there’s pepper steak, creosote and then some touches of clove and liquorice. In the back-end, there’s a juicy sweetness from lychee and peaches as well as just a touch of salted caramel.",
|
| 68 |
+
"Bold and oily, with candied fruit, cracked black pepper, tobacco smoke and toasted oak. A touch of cinnamon and brine keeps things lively.",
|
| 69 |
+
"Dense, rich sherried notes perked up with a coastal saltiness. On a second wave roast chestnuts emerge and gentle wood spice.",
|
| 70 |
+
"Meaty peat smoke, balsamic poached fruits, woody spice and sweet, leathery oak.",
|
| 71 |
+
"Initially fruity with citrus notes and orange peel, after this: vanilla, butterscotch, honeycomb and digestive biscuits can all be tasted and enjoyed.",
|
| 72 |
+
"Soft and supple with a nutty, sherried quality leading among vanilla, marmalade, sultanas, and a bright coastal element.",
|
| 73 |
+
"Sweet lemon meringue pie and soft, very soft mouthfeel. The peat hits a third of the way in but it's restrained; soothing wood smoke rather than burning tyres, and it retains a sweetness throughout.",
|
| 74 |
+
"A hit of spice, malt biscuits, and black pepper, with toasted caramelised nuts.",
|
| 75 |
+
"Amaretti biscuits, subtly toasty hints, powerful raisin and prune, just a touch of earthy oak lingers.",
|
| 76 |
+
"Golden syrup, soft, juicy raisins, tangy oak notes, peach, cherry blossom, cocoa and honeydew melon.",
|
| 77 |
+
"Zesty citrus peels and delicate woody spice, sweet, rich smoke, honeyed toast, and vanilla fudge, with subtle wax and a touch of pepper beneath.",
|
| 78 |
+
"Supple and balanced. Good toffee and hints of very wistful smoke. Chocolate, hints of grass and a good hit of malt.",
|
| 79 |
+
"Smoky, creamy palate with notes of marmalade, toffee apples and pear cider. A development of cloves comes late palate.",
|
| 80 |
+
"A tangle of dried berries and stewed fruits support meaty, oily malt. Chewy spice and roasted nuts develop in time, backed by rich oak and a trickle of treacle.",
|
| 81 |
+
"Generous helpings of peat join grilled pineapple, then fresh oak and vanilla fight their way through.",
|
| 82 |
+
"When sipped, I can taste walnuts and fireside wood smoke. The dram develops with a hint of thyme from my kitchen, closely followed by dried oranges.",
|
| 83 |
+
"Sweet with good body. The bourbon characters develop; gentle spice with a little vanilla, a hint of balancing peat lurking quietly in the substrata. Dried fruit too, combining with nuts, nutmeg, cinnamon, back into the bourbon notes - so well integrated.",
|
| 84 |
+
"Grassy peat with sea breeze in tow, almond butter, lemon zest, biscuit dough, honeydew melon.",
|
| 85 |
+
"Almond pastries, honeyed apricot, geranium, buttery vanilla, and a little hint of toasted cedar.",
|
| 86 |
+
"Fresh cinnamon pastries and treacle toffee blend with hazelnut, dried figs, and soft herbal notes.",
|
| 87 |
+
"Oak-y smoke and salty sea air, paired with sweeter notes of Custard Cream biscuits and white grape.",
|
| 88 |
+
"Delicate malt and richly sherried oak combine, with crisp notes of apple and sweet, cakey spice.",
|
| 89 |
+
"Silky toffee and a pinch of dried heather lead, followed by dense, honeyed fruit cake. Forest fruits creep in, bringing with them nutty spice and old oak.",
|
| 90 |
+
"Fruits, peels, buttery. Pain au chocolat, a little marmalade on toast before becoming firmer and nuttier with spiced raisins.",
|
| 91 |
+
"Creamy malt, with some light fruitcake, green grapes, and drying, peppery spice.",
|
| 92 |
+
"Crystallised ginger, green apple and a touch of salty sea air. Sweet chocolate and cooking spices, growing intense on the mid-palate.",
|
| 93 |
+
"A roar of intense peaty characters which tingle and warms the palette, intermingled with notes of roasted cocoa beans and bitter dark chocolate. As the rich phenolic characters subside, a tangy fruitiness comes to the fore with the introduction of blackberry, plum, and gooseberry notes with indulgent characters of a crème brûlée.",
|
| 94 |
+
"Malty. Walnuts steeped in manuka honey with vanilla sponge. Gentle smoke weaves its way through the cereal with a touch of spice.",
|
| 95 |
+
"Chocolate mousse, Bourbon biscuits, orange oil, more almond notes (now toasted), blackcurrant and raisin.",
|
| 96 |
+
"Dense layers of charcoal, coffee grounds, and cacao, with peppery notes of barbecued meat, herbaceous peat, and smoked sea salt joined by sweet, sherried fruit.",
|
| 97 |
+
"Rounded malt notes once again, now a touch oily. Still packs a hearty helping of stone fruit sweetness.",
|
| 98 |
+
"Honeyed cereals, cooked apple, chocolate peanuts and soft, almost jammy sultanas.",
|
| 99 |
+
"Waves of red berries, oily walnuts, and marmalade support glorious robust, meaty malt, with hints of sweetly cured biltong and tangy dried cranberries.",
|
| 100 |
+
"Almost like cold coffee with dark brown sugar, vanilla and dried fruit.",
|
| 101 |
+
"Opens with more fudge with a little dusting of powdered sugar. Powerful, oily and a touch herbaceous with some German brandy character.",
|
| 102 |
+
"Vanilla, honey, dates, more walnuts, and a hint of Toblerone.",
|
| 103 |
+
"Creamy barley leads the way, with plump sultanas and more fruit-studded pastries.",
|
| 104 |
+
"Melted butter on rye toast, sandalwood, peach, soft peppery hints drift in later on, with just a pinch of mint.",
|
| 105 |
+
"Raisins, more sherry, orange peel, walnuts, dates.",
|
| 106 |
+
"A familiar oiliness and smokiness is introduced on the palate, with notes of Iberico ham and brandy snaps.",
|
| 107 |
+
"Sweet, syrupy cinnamon and drying malt lead, before a suggestion of Terry's Chocolate Orange rises. A hint of lime rind is present, as are lychees and dates. The backdrop is filled with tobacco leaves and freshly roasted espresso beans, with a little honey-roasted cashew.",
|
| 108 |
+
"Seaweed-led, with a hint of vanilla ice cream and more than a whiff of notes from the first aid box (TCP, plasters etc). The oak is big, and muscles its way into the fore as you hold this whisky over your tongue. An upsurge of spices develop – cardamom/black pepper/chilli.",
|
| 109 |
+
"Very thick and rich. A massive mouthful of malt and Sherry with good fruity sweetness, but also a wonderful sweetness. Big, powerful peat and oak.",
|
| 110 |
+
"Grassy peat, stewed plum, raspberry, almond, dark chocolate.",
|
| 111 |
+
"Stem ginger and sultana, oily barley and buttery vanilla.",
|
| 112 |
+
"Full, fruitcake, spices, buttery vanilla, malty, with oak and candied ginger.",
|
| 113 |
+
"Thick and mouth-coating with wood smoke, brine, some tin and chilli heat too.",
|
| 114 |
+
"It's a bonfire of peat crackling with black pepper, with a touch of brine and dry barley. A welcome delivery of orchard fruit provides a delicate and beautiful balance.",
|
| 115 |
+
"Baked orchard fruits, hazelnut praline and dark chocolate work in harmony with crystalised ginger and orange marmalade. Hints of toasted oak and soft worn leather chime in, adding depth and complexity.",
|
| 116 |
+
"Notes of Seville marmalade and triple sec with winter spices and fruitcake. Zesty cocoa and milk chocolate.",
|
| 117 |
+
"A gentle, subtle palate offering up a mix of cranberries and cooked raspberries, a little white grape juice and barley."
|
| 118 |
+
]
|