Spaces:
Runtime error
Runtime error
Commit
Β·
890df00
1
Parent(s):
9076fb7
Changed examples
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
pipe = pipeline("text-classification", model="qualitydatalab/autotrain-car-review-project-966432120")
|
5 |
|
6 |
def predict(text):
|
7 |
-
label2emoji = {"poor": "
|
8 |
preds = pipe(text)[0]
|
9 |
return label2emoji[preds["label"]], round(preds["score"], 5)
|
10 |
|
@@ -20,7 +20,8 @@ gradio_ui = gr.Interface(
|
|
20 |
gr.outputs.Textbox(label="Score"),
|
21 |
],
|
22 |
examples=[
|
23 |
-
["
|
|
|
24 |
],
|
25 |
)
|
26 |
|
|
|
4 |
pipe = pipeline("text-classification", model="qualitydatalab/autotrain-car-review-project-966432120")
|
5 |
|
6 |
def predict(text):
|
7 |
+
label2emoji = {"poor": "π", "ok": "π", "great": "π"}
|
8 |
preds = pipe(text)[0]
|
9 |
return label2emoji[preds["label"]], round(preds["score"], 5)
|
10 |
|
|
|
20 |
gr.outputs.Textbox(label="Score"),
|
21 |
],
|
22 |
examples=[
|
23 |
+
[" Bought this Clio for my daughter 2 years ago. It was very well cared for with 95,000 miles. New brakes, tires, and all scheduled maintenance was done. We have had no problems (ex a torn axle boot) in 2 years and 22,000 miles. "],
|
24 |
+
["I bought a brand new Scenic for my daily driver last year, and this is my biggest mistake! I should of do more researches before buying it. This car is the MOST POS ever. My suspension was bad after a couple thousand miles, the car made huge noise when the car is rolling."],
|
25 |
],
|
26 |
)
|
27 |
|