Comments (3)
Look at the example https://github.com/rmarquet21/streamlit-annotation-tools/blob/master/examples/example.py
You have here the format of parameter labels
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)
from streamlit-annotation-tools.
OK. Perhaps there is an opportunity to clarify the code doc here.
The labels
input isn't a list
as defined in the code. It's actually a Dict.
def text_labeler(text: str, labels=[], in_snake_case=False):
"""Create a new instance of "text_labeler".
Parameters
----------
text : str
The text to be labeled
labels : list
from streamlit-annotation-tools.
You're right, I'll take care of it.
from streamlit-annotation-tools.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamlit-annotation-tools.