-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component Error when attempting to use pre-defined label List #7
Comments
Look at the example https://github.com/rmarquet21/streamlit-annotation-tools/blob/master/examples/example.py You have here the format of parameter def labeler_page():
st.title("Text Labeling Tool")
text = "Yesterday, at 3 PM, Emily Johnson and Michael Smith met at the Central Park in New York to discuss the merger between TechCorp and Global Solutions. The deal, worth approximately 500 million dollars, is expected to significantly impact the tech industry. Later, at 6 PM, they joined a conference call with the CEO of TechCorp, David Brown, who was in London for a technology summit. During the call, they discussed the market trends in Asia and Europe and planned for the next quarterly meeting, which is scheduled for January 15th, 2024, in Paris."
labels = {
"Personal names": [
{"start": 20, "end": 33, "label": "Emily Johnson"},
{"start": 38, "end": 51, "label": "Michael Smith"},
{"start": 327, "end": 338, "label": "David Brown"},
],
"Organizations": [
{"start": 118, "end": 126, "label": "TechCorp"},
{"start": 131, "end": 147, "label": "Global Solutions"},
],
"Locations": [
{"start": 63, "end": 75, "label": "Central Park"},
{"start": 79, "end": 87, "label": "New York"},
{"start": 351, "end": 357, "label": "London"},
{"start": 436, "end": 440, "label": "Asia"},
{"start": 445, "end": 451, "label": "Europe"},
{"start": 542, "end": 547, "label": "Paris"},
],
"Time": [
{"start": 0, "end": 9, "label": "Yesterday"},
{"start": 14, "end": 18, "label": "3 PM"},
{"start": 265, "end": 269, "label": "6 PM"},
{"start": 519, "end": 531, "label": "January 15th"},
{"start": 533, "end": 537, "label": "2024"},
],
"Money": [{"start": 179, "end": 198, "label": "500 million dollars"}],
}
labels = text_labeler(text, labels) |
OK. Perhaps there is an opportunity to clarify the code doc here. The
|
You're right, I'll take care of it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've started receiving this error whenever I try to pass a label list as input to the text_labeler().
Dependencies:
python 3.11.4
streamlit==1.31.0
streamlit-annotation-tools==1.0.1
ERROR: text_labeler component is not presented. However, the annotations object is presented as expected
Chrome Inspector shows the following error, but JS is enabled. Same on Brave and Safari.
<noscript>You need to enable JavaScript to run this app.</noscript>
Removing the labels allows the text_labeler to render.
annotations = text_labeler(doc_text)
The text was updated successfully, but these errors were encountered: