Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
text = """Dear Amazon, last week I ordered an Optimus Prime action figure
|
2 |
+
from your online store in Germany. Unfortunately, when I opened the package,
|
3 |
+
I discovered to my horror that I had been sent an action figure of Megatron
|
4 |
+
instead! As a lifelong enemy of the Decepticons, I hope you can understand my
|
5 |
+
dilemma. To resolve the issue, I demand an exchange of Megatron for the
|
6 |
+
Optimus Prime figure I ordered. Enclosed are copies of my records concerning
|
7 |
+
this purchase. I expect to hear from you soon. Sincerely, Bumblebee."""
|
8 |
+
|
9 |
+
from transformers import pipeline
|
10 |
+
classifier = pipeline("text-classification")
|
11 |
+
import pandas as pd
|
12 |
+
outputs = classifier(text)
|
13 |
+
pd.DataFrame(outputs)
|