-
Notifications
You must be signed in to change notification settings - Fork 104
name, description language-tagged support #932
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
13c046f
name, description language tagged support POC
wardi 55a0730
existing tests passing
wardi 9aa58cb
multilingual test
wardi 3525826
test formatting of language tagged values
wardi 1af36a3
black reformatting
wardi 099d8c5
mypy fixes
wardi e2352de
pytype fix
wardi d78ea7a
black reformatting with --preview
wardi 6e2be57
isort
wardi 29cdc57
multilingual dataset example
wardi ab5ac04
minimal_multilingual: source for 1.1
wardi 2e381cd
improved translations from @ccl-core
wardi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| name,age | ||
| Alice,22 | ||
| Bob,23 | ||
| John,6 | ||
| Jane,53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| { | ||
| "@context": { | ||
| "@language": "en", | ||
| "@vocab": "https://schema.org/", | ||
| "arrayShape": "cr:arrayShape", | ||
| "citeAs": "cr:citeAs", | ||
| "column": "cr:column", | ||
| "conformsTo": "dct:conformsTo", | ||
| "cr": "http://mlcommons.org/croissant/", | ||
| "rai": "http://mlcommons.org/croissant/RAI/", | ||
| "data": { | ||
| "@id": "cr:data", | ||
| "@type": "@json" | ||
| }, | ||
| "dataType": { | ||
| "@id": "cr:dataType", | ||
| "@type": "@vocab" | ||
| }, | ||
| "description": {"@container": "@language"}, | ||
| "dct": "http://purl.org/dc/terms/", | ||
| "examples": { | ||
| "@id": "cr:examples", | ||
| "@type": "@json" | ||
| }, | ||
| "extract": "cr:extract", | ||
| "field": "cr:field", | ||
| "fileProperty": "cr:fileProperty", | ||
| "fileObject": "cr:fileObject", | ||
| "fileSet": "cr:fileSet", | ||
| "format": "cr:format", | ||
| "includes": "cr:includes", | ||
| "isArray": "cr:isArray", | ||
| "isLiveDataset": "cr:isLiveDataset", | ||
| "jsonPath": "cr:jsonPath", | ||
| "key": "cr:key", | ||
| "md5": "cr:md5", | ||
| "name": {"@container": "@language"}, | ||
| "parentField": "cr:parentField", | ||
| "path": "cr:path", | ||
| "recordSet": "cr:recordSet", | ||
| "references": "cr:references", | ||
| "regex": "cr:regex", | ||
| "repeated": "cr:repeated", | ||
| "replace": "cr:replace", | ||
| "samplingRate": "cr:samplingRate", | ||
| "sc": "https://schema.org/", | ||
| "separator": "cr:separator", | ||
| "source": "cr:source", | ||
| "subField": "cr:subField", | ||
| "transform": "cr:transform" | ||
| }, | ||
| "@type": "sc:Dataset", | ||
| "name": { | ||
| "en": "minimal_example_with_multilingual_descriptions", | ||
| "de": "minimales_Beispiel_mit_mehrsprachigen_Beschreibungen", | ||
| "fr": "exemple_minimal_avec_descriptions_multilingues" | ||
| }, | ||
| "description": { | ||
| "en": "This is a minimal example, including the required and the recommended fields in multiple languages.", | ||
| "de": "Dies ist ein Minimalbeispiel, das die erforderlichen und die empfohlenen Felder in mehreren Sprachen enthält.", | ||
| "fr": "Ceci est un exemple minimal, incluant les champs obligatoires et recommandés dans plusieurs langues." | ||
| }, | ||
| "conformsTo": "http://mlcommons.org/croissant/1.1", | ||
| "license": "https://creativecommons.org/licenses/by/4.0/", | ||
| "url": "https://example.com/dataset/recipes/minimal-recommended", | ||
| "distribution": [ | ||
| { | ||
| "@type": "cr:FileObject", | ||
| "@id": "minimal.csv", | ||
| "name": "minimal.csv", | ||
| "contentUrl": "data/minimal.csv", | ||
| "encodingFormat": "text/csv", | ||
| "sha256": "48a7c257f3c90b2a3e529ddd2cca8f4f1bd8e49ed244ef53927649504ac55354" | ||
| } | ||
| ], | ||
| "recordSet": [ | ||
| { | ||
| "@type": "cr:RecordSet", | ||
| "@id": "examples", | ||
| "name": { | ||
| "en": "examples", | ||
| "de": "Beispiele", | ||
| "fr": "exemples" | ||
| }, | ||
| "description": { | ||
| "en": "Records extracted from the example table, with their schema.", | ||
| "de": "Aus der Beispieltabelle extrahierte Datensätze mit ihrem Schema.", | ||
| "fr": "Enregistrements extraits de la table d'exemple, avec leur schéma." | ||
| }, | ||
| "field": [ | ||
| { | ||
| "@type": "cr:Field", | ||
| "@id": "examples/name", | ||
| "name": { | ||
| "en": "name", | ||
| "de": "Name", | ||
| "fr": "nom" | ||
| }, | ||
| "description": { | ||
| "en": "The first column contains the name.", | ||
| "de": "Die erste Spalte enthält den Namen.", | ||
| "fr": "La première colonne contient le nom." | ||
| }, | ||
| "dataType": "sc:Text", | ||
| "source": { | ||
| "fileObject": { | ||
| "@id": "minimal.csv" | ||
| }, | ||
| "extract": { | ||
| "column": "name" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "@type": "cr:Field", | ||
| "@id": "examples/age", | ||
| "name": { | ||
| "en": "age", | ||
| "de": "Alter", | ||
| "fr": "âge" | ||
| }, | ||
| "description": { | ||
| "en": "The second column contains the age.", | ||
| "de": "Die zweite Spalte enthält das Alter.", | ||
| "fr": "La deuxième colonne contient l'âge." | ||
| }, | ||
| "dataType": "sc:Integer", | ||
| "source": { | ||
| "fileObject": { | ||
| "@id": "minimal.csv" | ||
| }, | ||
| "extract": { | ||
| "column": "age" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| {"examples/name": "Alice", "examples/age": 22} | ||
| {"examples/name": "Bob", "examples/age": 23} | ||
| {"examples/name": "John", "examples/age": 6} | ||
| {"examples/name": "Jane", "examples/age": 53} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Question: do we need ONE-LANGUAGE-TAGGED and MANY-LANGUAGE-TAGGED?
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.
No, here "LANGUAGE-TAGGED" is short for "either one value or a dict of one or more language-tagged values"