Spaces:
Running
Running
Update interfaces/classification.py
Browse files- interfaces/classification.py +1 -11
interfaces/classification.py
CHANGED
|
@@ -8,13 +8,9 @@ classification_examples = [
|
|
| 8 |
[
|
| 9 |
"""
|
| 10 |
"I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
|
| 11 |
-
|
| 12 |
The headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.
|
| 13 |
-
|
| 14 |
I also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.
|
| 15 |
-
|
| 16 |
However, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.
|
| 17 |
-
|
| 18 |
Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.""",
|
| 19 |
"positive review, negative review, neutral review",
|
| 20 |
0.5
|
|
@@ -32,9 +28,7 @@ Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to a
|
|
| 32 |
[
|
| 33 |
"""
|
| 34 |
"Last night, we visited the new Italian restaurant downtown. The Margherita pizza was absolutely delightful, with a perfectly crisp crust and fresh basil.
|
| 35 |
-
|
| 36 |
However, the service was slow; it took over 20 minutes to take our order. The pasta arrived lukewarm, which was disappointing given the hype around this place.
|
| 37 |
-
|
| 38 |
On the bright side, the ambiance was cozy, and the wine selection was impressive. Overall, it was a mixed experience, but I might give it another try on a quieter evening."
|
| 39 |
""",
|
| 40 |
"Food Quality, Technology, Politics",
|
|
@@ -43,9 +37,7 @@ On the bright side, the ambiance was cozy, and the wine selection was impressive
|
|
| 43 |
[
|
| 44 |
"""
|
| 45 |
"Das Kind verbrachte den Nachmittag im Park und entdeckte einen kleinen Teich mit Enten. Es war wunderschön zu sehen, wie es die Natur erkundete.
|
| 46 |
-
|
| 47 |
Doch plötzlich störten die Geräusche einer Baustelle die ruhige Atmosphäre. Trotzdem spielte das Kind weiter, und ich genoss die frische Luft.
|
| 48 |
-
|
| 49 |
Solche Momente zeigen, wie wichtig es ist, Kinder in der Natur aufwachsen zu lassen."
|
| 50 |
""",
|
| 51 |
"Outdoor Activities, Gaming, Artificial Intelligence",
|
|
@@ -54,9 +46,7 @@ Solche Momente zeigen, wie wichtig es ist, Kinder in der Natur aufwachsen zu las
|
|
| 54 |
[
|
| 55 |
"""
|
| 56 |
"I recently attended a healthcare technology conference. The keynote speaker demonstrated how AI is revolutionizing diagnostics, making it possible to detect rare diseases with incredible accuracy.
|
| 57 |
-
|
| 58 |
However, concerns about data privacy and ethical implications were also heavily discussed. Despite these challenges, the energy in the room was palpable as experts envisioned a future where AI saves millions of lives.
|
| 59 |
-
|
| 60 |
It was an inspiring event that showcased the potential of combining technology and healthcare innovation."
|
| 61 |
""",
|
| 62 |
"Artificial Intelligence, Music, Sports",
|
|
@@ -75,7 +65,7 @@ def process(text, labels, threshold):
|
|
| 75 |
labels = [label.strip() for label in labels.split(",")]
|
| 76 |
prompt = prepare_prompts(text, labels)
|
| 77 |
|
| 78 |
-
predictions = model.
|
| 79 |
entities = []
|
| 80 |
|
| 81 |
if predictions and predictions[0]:
|
|
|
|
| 8 |
[
|
| 9 |
"""
|
| 10 |
"I recently purchased the Sony WH-1000XM4 Wireless Noise-Canceling Headphones from Amazon and I must say, I'm thoroughly impressed. The package arrived in New York within 2 days, thanks to Amazon Prime's expedited shipping.
|
|
|
|
| 11 |
The headphones themselves are remarkable. The noise-canceling feature works like a charm in the bustling city environment, and the 30-hour battery life means I don't have to charge them every day. Connecting them to my Samsung Galaxy S21 was a breeze, and the sound quality is second to none.
|
|
|
|
| 12 |
I also appreciated the customer service from Amazon when I had a question about the warranty. They responded within an hour and provided all the information I needed.
|
|
|
|
| 13 |
However, the headphones did not come with a hard case, which was listed in the product description. I contacted Amazon, and they offered a 10% discount on my next purchase as an apology.
|
|
|
|
| 14 |
Overall, I'd give these headphones a 4.5/5 rating and highly recommend them to anyone looking for top-notch quality in both product and service.""",
|
| 15 |
"positive review, negative review, neutral review",
|
| 16 |
0.5
|
|
|
|
| 28 |
[
|
| 29 |
"""
|
| 30 |
"Last night, we visited the new Italian restaurant downtown. The Margherita pizza was absolutely delightful, with a perfectly crisp crust and fresh basil.
|
|
|
|
| 31 |
However, the service was slow; it took over 20 minutes to take our order. The pasta arrived lukewarm, which was disappointing given the hype around this place.
|
|
|
|
| 32 |
On the bright side, the ambiance was cozy, and the wine selection was impressive. Overall, it was a mixed experience, but I might give it another try on a quieter evening."
|
| 33 |
""",
|
| 34 |
"Food Quality, Technology, Politics",
|
|
|
|
| 37 |
[
|
| 38 |
"""
|
| 39 |
"Das Kind verbrachte den Nachmittag im Park und entdeckte einen kleinen Teich mit Enten. Es war wunderschön zu sehen, wie es die Natur erkundete.
|
|
|
|
| 40 |
Doch plötzlich störten die Geräusche einer Baustelle die ruhige Atmosphäre. Trotzdem spielte das Kind weiter, und ich genoss die frische Luft.
|
|
|
|
| 41 |
Solche Momente zeigen, wie wichtig es ist, Kinder in der Natur aufwachsen zu lassen."
|
| 42 |
""",
|
| 43 |
"Outdoor Activities, Gaming, Artificial Intelligence",
|
|
|
|
| 46 |
[
|
| 47 |
"""
|
| 48 |
"I recently attended a healthcare technology conference. The keynote speaker demonstrated how AI is revolutionizing diagnostics, making it possible to detect rare diseases with incredible accuracy.
|
|
|
|
| 49 |
However, concerns about data privacy and ethical implications were also heavily discussed. Despite these challenges, the energy in the room was palpable as experts envisioned a future where AI saves millions of lives.
|
|
|
|
| 50 |
It was an inspiring event that showcased the potential of combining technology and healthcare innovation."
|
| 51 |
""",
|
| 52 |
"Artificial Intelligence, Music, Sports",
|
|
|
|
| 65 |
labels = [label.strip() for label in labels.split(",")]
|
| 66 |
prompt = prepare_prompts(text, labels)
|
| 67 |
|
| 68 |
+
predictions = model.inference([prompt], ["match"], threshold=threshold)
|
| 69 |
entities = []
|
| 70 |
|
| 71 |
if predictions and predictions[0]:
|