Skip to content
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

Preserve dataset structure #175

Merged
merged 10 commits into from
Aug 7, 2021

Conversation

illided
Copy link
Contributor

@illided illided commented Aug 5, 2021

This PR adds ability to recognize dataset structure (folders train, test, val) and recreate their structure in the final output directory.

Copy link
Contributor

@SpirinEgor SpirinEgor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but needs a little bit of change.
Also, could you write logic with datasets into docs/storage.md

Comment on lines 24 to 26
name: code2seq
length: 9
width: 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the config example?

parsingResultFactory.parseFiles(files) { parseResult ->
for (labeledResult in branch.process(parseResult)) {
storage.store(labeledResult)
for ((holdoutType, holdout) in holdouts) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name it holdoutPath

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But holdout type is File. Maybe holdoutDir?

@SpirinEgor
Copy link
Contributor

Resolve conflicts, please

@illided illided requested a review from SpirinEgor August 6, 2021 13:05
Comment on lines 46 to 51
private fun <T : Closeable, R> T.useSynchronously(callback: (T) -> R) =
this.use {
synchronized(this) {
callback(this)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks complicated ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add in storage interface syncronizedStore:

fun syncronizedStore(labeledResult: LabeledResult<out Node>) = syncronized {
    store(labeledResult)
}

}

private fun printHoldoutStat(files: List<File>, holdoutType: DatasetHoldout) {
var output = "${files.size} file(s) found"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use StringBuilder for manipulation with strings to avoid using mutable strings

@illided illided requested a review from SpirinEgor August 6, 2021 17:49
@SpirinEgor SpirinEgor merged commit d2344a4 into JetBrains-Research:master-dev Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants