-
Notifications
You must be signed in to change notification settings - Fork 52
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
Include isArray and arrayShape #807
Conversation
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
@@ -106,6 +113,11 @@ | |||
"name": "record_set_plain_text/split", | |||
"description": "Split to which the example belongs to.", | |||
"dataType": "sc:Text", | |||
"references": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: references
coming after source
was more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree... I don't know why it got changed, maybe it started to order those alphabetically? I could change it back manually, shall I do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An array of strings used to control the order. We shouldn't do it manually but programmatically. But this is not prio at all - so we can probably let it like this if we don't have time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
As we discussed offline, arrayShape can be represented more compactly as a string that contains space separated dimensions, e.g., "1 2 -1 3", where -1 corresponds to a dimension where the length is not specified. Even though this approach is encoding structured information in a string, it's unambiguous and easy to parse, so I think it's acceptable. We already do accept such input in other places, e.g., for bounding boxes. |
python/mlcroissant/mlcroissant/_src/structure_graph/nodes/field.py
Outdated
Show resolved
Hide resolved
@marcenacp WDYT if I add a "LATEST_VERSION" attr to CroissantVersion and See example in cb40bea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Just a few nits.
Addresses: #649
Update: the final implementation uses:
======
Note that this is a bit different than the original proposal in #649 :
This is a bit difficult for us to process using mlcroissant... When we create the graph from the jsonld data, we would loose the order information; moreover, as we create a triple for each element in the
arrayShape
, and triples need to be unique, we would loose dimensions which have the same size.As an alternative I propose to use a
@list
, so we keep the order info more nicely and we don't loose data:WDYT?
In this PR:
isArray
andarrayShape
Still TODO: Remove
repeated
from all datasets and useisArray
andarrayShape
instead.