eglassman / prose

Microsoft Program Synthesis using Examples SDK is a framework of technologies for the automatic generation of programs from input-output examples. This repo includes samples and sample data for the Microsoft Program Synthesis using Example SDK.
https://microsoft.github.io/prose/
Other
2 stars 0 forks source link

Write out json file with attributes: extracted_text, filename, region_start, region_end, label #3

Closed eglassman closed 7 years ago

eglassman commented 7 years ago

Label examples: Header (optional parent nodes) Body (optional parent nodes) Aux js library load d3 library load style d3 data load callback d3 load argument

eglassman commented 7 years ago

@Steven-Hewitt, in the code you committed in order to close #4, there was an example of a label for the data load callback. That's where a lot of the heart of d3 code lives. I would prioritize getting program synthesis to learn that label, first. If you then create this JSON for all the 50 files and the data-load-callback label, we can use that to programmatically insert that class in spans around the callbacks in our index50.html file (therefore addressing and closing #2).

eglassman commented 7 years ago

I just committed my updates to the VS Solution file so it writes out of a csv-like thing to the console, which I'm going to use as a starting point for more rendering explorations.

eglassman commented 7 years ago

Okay, this is what I'll do next. Stealing this back from you. ;)

eglassman commented 7 years ago

Wrote out data in json-like format to console. Still needs to be saved as json file by hand, but I think that shouldn't be automated yet.

eglassman commented 7 years ago

Unfortunately, it's not well-formed JSON. It doesn't have \n where it should: image

Trying to write out the json now using http://stackoverflow.com/questions/16921652/how-to-write-a-json-file-in-c

eglassman commented 7 years ago

@Steven-Hewitt I got stuck trying to write out well-formed JSON files with multiple line values. It's not completely necessary, though. I'll continue without it for now. If you can figure out how to do it, can you show me how?

Steven-Hewitt commented 7 years ago

Sounds good, I'll try to do that before I go to sleep tonight. If not, first thing tomorrow.

eglassman commented 7 years ago

While this wasn't necessary to complete my simplest prototype tonight, it will be really helpful to have this, for debugging and additional prototyping purposes. Thanks in advance, @Steven-Hewitt!

eglassman commented 7 years ago

I updated the title of this issue to reflect the fact that the critical missing pieces are

Steven-Hewitt commented 7 years ago

I think I'm done, but my tests are getting caught up on a thing that didn't seem to be an issue when you were running the code during our meeting where LearnHTMLlang is failing to actually learn.

Don't feel comfortable uploading/closing issue until I have that worked out, but hopefully that'll be soon.

image

eglassman commented 7 years ago

@Steven-Hewitt Weird, okay! Want to swing by my desk and we can look at it together? Andrew and Gustavo are also comfortable with C# --> JSON.

Steven-Hewitt commented 7 years ago

@eglassman Sure! Since I'm working from my desktop, I'll get the current updates on my laptop so that I can check in tomorrow (or, failing that, set up VNC so I can remotely connect).

eglassman commented 7 years ago

@Steven-Hewitt I'm here in the lab until 5. Want to swing by? In the meantime, I've sent a message about this to Andrew and Gustavo.

eglassman commented 7 years ago

@Steven-Hewitt Gustavo's response:

var submissionsToJson = JsonConvert.SerializeObject(submissions); File.WriteAllText("submissionsResults.json", submissionsToJson);

In the meantime, I'm printing to the console stuff that I can copy and paste into a file for prototyping purposes.

eglassman commented 7 years ago

Done.