Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from pprint import pprint
|
| 3 |
+
from paddlenlp import Taskflow
|
| 4 |
+
|
| 5 |
+
text=st.text_area("enter some text!")
|
| 6 |
+
schema = ['时间', '选手', '赛事名称'] # Define the schema for entity extraction
|
| 7 |
+
ie = Taskflow('information_extraction', schema=schema)
|
| 8 |
+
if text:
|
| 9 |
+
out=ie(text)
|
| 10 |
+
st.json(out)
|
| 11 |
+
|