Spaces:
Runtime error
Runtime error
catch bad spans, propogate error message to UI
Browse files
app.py
CHANGED
|
@@ -41,7 +41,10 @@ if spacy_data or st.button("Or try an example"):
|
|
| 41 |
if run_data:
|
| 42 |
st.write("Spacy input data:")
|
| 43 |
st.json(run_data)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
if run_data:
|
| 42 |
st.write("Spacy input data:")
|
| 43 |
st.json(run_data)
|
| 44 |
+
try:
|
| 45 |
+
hf_data = spacy_to_hf(run_data, tok)
|
| 46 |
+
df = Dataset.from_dict(hf_data).to_pandas()
|
| 47 |
+
st.write("Output huggingface format:")
|
| 48 |
+
st.dataframe(df)
|
| 49 |
+
except Exception as e:
|
| 50 |
+
st.error(f"Failed to create tokens and tags: {str(e)}")
|