Live data from Hacker News

Show HN: A tool that transforms your whole list with just one example

transformy.io

91–100 of 151 posts

Re: Show HN: A tool that transforms your whole list with just one example

#92

This is neat. I find myself wanting more detail on what works, though. For example, I c/ped your original example and tried "Roberto C. from Brazil." It didn't infer that C. meant to truncate the last name, so everything ended up "John C." No biggie, but trying to figure out what does and doesn't work aside from tokenized string formatting was a bummer. Having the uppercase example led me to believe it could do more…

I made a list of restaurants:

Input:

  taco bell 1
  mcdonalds 2
  wendys 3
  bojangles 4
  dairy queen 5
Ex: 1. Taco Bell

Output:

  1. Taco Bell
  . Mcdonalds 2
  . Wendys 3
  . Bojangles 4
  5. Dairy Queen
? When I take the spaces out of the restaurants I get:

New Input:

  tacobell 1
  mcdonalds 2
  wendys 3
  bojangles 4
  dairyqueen 5
Ex: 1. TacoBell

New Output:

  1. Tacobell
  2. Mcdonalds
  3. Wendys
  4. Bojangles
  5. Dairyqueen

Re: Show HN: A tool that transforms your whole list with just one example

#95
post #15

Amazing tool. Feature requests: allow for more than one example. Input: {"class": "101", "students": 101} {"class": "201", "students": 80} {"class": "202", "students": 50} {"class": "301", "students": 120} Example: Class 101 has 101 students Output: Class 101 has 101 students Class 201 has 201 students Class 202 has 202 students Class 301 has 301 students Right now the first line cannot have any ambiguity. This is fi…

Class 201 has 80 students

Re: Show HN: A tool that transforms your whole list with just one example

#96
post #89
post #59

Earlier quoted context omitted.

It's more accurate to call it "programming by example", which is a much older term, in common use, and actually means "creating programs by example". http://en.wikipedia.org/wiki/Programming_by_example Sketching means to provide a partial specification, of which details are filled in by the system. But in this case, the user is providing a full description of a single concrete example. These are different concepts.

Thanks for the clarification, they are similar but not the same. It looks like _sketching_ is more analogous to using Hindley-Milner for filling in gaps in an executable spec, where as Programming by Example infers code from data (examples). There is a wealth of interesting material referenced in http://web.media.mit.edu/~lieber/Your-Wish-Intro.html

Sketching is a superset of programming by example. In examples, you only get input/output pairs, which as this thread shows, infers frustratingly close but wrong programs.

In sketching, the input and output can also includes partial programs (sketches), so you can mark what you like, tweak, etc, and it fills in the rest.

Increasing usability, the fragments can be in different languages. For example, input can be simple C and some test data, and output can be CUDA GPU code or pthread mutex locking schemes.

For Graphistry.com, we believe in these techniques for ETL and sketching visualizations.

(Also, sketching normally uses machine learning or SAT/SMT solvers: types are more typically used for input hints.)

Re: Show HN: A tool that transforms your whole list with just one example

#98
post #15

Amazing tool. Feature requests: allow for more than one example. Input: {"class": "101", "students": 101} {"class": "201", "students": 80} {"class": "202", "students": 50} {"class": "301", "students": 120} Example: Class 101 has 101 students Output: Class 101 has 101 students Class 201 has 201 students Class 202 has 202 students Class 301 has 301 students Right now the first line cannot have any ambiguity. This is fi…

Class 201 has 80 students

Right, but if you have a thousand items, with a dozen fields each, you can't be sure the one example you've picked will resolve all ambiguities. But if you could supply four or five example lines, the chances of ambiguity drop off.

Re: Show HN: A tool that transforms your whole list with just one example

#100
post #68

Avi Bryant demo'd this exact concept at an old CUSEC: https://vimeo.com/4763707#t=27m20s I wish I knew which paper he was referring to - it's a great feature :).

For more, I gave a feel for how to rethink the full data pipeline using these ideas @ Strange Loop: http://www.infoq.com/presentations/dsl-visualization . It pulls on several projects from program synthesis @ berkeley. (These directly led to applications mentioned here like flashfill.)
Post reply on HN