Spaces:
Runtime error
Runtime error
Update
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
import json
|
2 |
import time
|
|
|
3 |
import streamlit as st
|
4 |
from annotated_text import annotated_text
|
5 |
|
@@ -31,7 +31,7 @@ def getDictFromPOS(texts, labels):
|
|
31 |
return [{ "text": t, "label": l } for t, l in zip(texts, labels)]
|
32 |
|
33 |
def getAnnotatedFromPOS(texts, labels):
|
34 |
-
return [(t,l,
|
35 |
|
36 |
def main():
|
37 |
|
@@ -61,9 +61,6 @@ def main():
|
|
61 |
|
62 |
texts, labels = getPos(s)
|
63 |
|
64 |
-
st.header("Labels:")
|
65 |
-
st.write(" ".join(labels))
|
66 |
-
|
67 |
st.header("Labels:")
|
68 |
anns = getAnnotatedFromPOS(texts, labels)
|
69 |
annotated_text(*anns)
|
|
|
1 |
import time
|
2 |
+
import random
|
3 |
import streamlit as st
|
4 |
from annotated_text import annotated_text
|
5 |
|
31 |
return [{ "text": t, "label": l } for t, l in zip(texts, labels)]
|
32 |
|
33 |
def getAnnotatedFromPOS(texts, labels):
|
34 |
+
return [(t,l,random.choice(colors)) for t, l in zip(texts, labels)]
|
35 |
|
36 |
def main():
|
37 |
|
61 |
|
62 |
texts, labels = getPos(s)
|
63 |
|
|
|
|
|
|
|
64 |
st.header("Labels:")
|
65 |
anns = getAnnotatedFromPOS(texts, labels)
|
66 |
annotated_text(*anns)
|