Spaces:
Sleeping
Sleeping
Commit
·
f59d33b
1
Parent(s):
27ca478
test
Browse files
app.py
CHANGED
@@ -1,7 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
def greet(name):
|
4 |
-
return
|
|
|
5 |
|
6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from paddlenlp import Taskflow
|
4 |
+
|
5 |
+
schema = '情感倾向[正向,负向]' # Define the schema for sentence-level sentiment classification
|
6 |
+
ie = Taskflow('information_extraction', schema=schema)
|
7 |
+
ie.set_schema(schema) # Reset schema
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
def greet(name):
|
13 |
+
return ie(name)
|
14 |
+
# return "Hello " + name + "!!"
|
15 |
|
16 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
17 |
demo.launch()
|