Hacker News new | ask | show | jobs
by necubi 5694 days ago
Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others?

The inherent problem with NLP is that human languages are imprecise and ambiguous. For an example of the problems with NLP, try using Wolfram Alpha. While it returns useful results for many queries, as soon as you start off the beaten path it can become an exercise in frustration as you try to figure out exactly which format of words it will accept, especially as I know the mathematica command that would accomplish the desired goal (or can look it up quickly).

Obviously Alpha isn't the end-game of NLP and improvements can be made to accept more constructions. But ultimately, you're going to have to restrict yourself to a subset of your natural language's syntax, grammar and vocabulary, and I believe that learning what that subset is is far more difficult and frustrating than just learning a programming language.

Furthermore, merely knowing a NL programming language isn't enough to be a programmer--you still need to learn how to think logically and algorithmically, which seems to be the hard part for people new to programming.

4 comments

  Draw a circle.

  Color it red.

  Make it smaller.

  No, 5% bigger.

  Make the radius 5 units.
Refining specifications like that seems like the holy grail of movements like aspect-oriented programming, NLP or no. Separating concerns is a really good thing.

  circle = Circle(); // default origin, radius, color, etc.
  circle.set_visible(true)
  circle.color = RED
  circle.make_smaller()
  circle.set_radius(5)
// or whatever. just saying we can do approximately this already today, in most any modern language, as long as you're willing to express it in the prog language rather than the natural language. And I'm not sure having it expressed in a natural language is better in any significant way.
This only works if someone has added such an interface to every object in the programming language, the user is familiar with the dot-calls-method convention (and the state-is-modified convention), etc. I think to do actual programming it's probably best to use an actual programming language, as you do want all the details under control. To do what most people do with mathematica, however, (and the way most people use mathematica is more like the way they use an interpreter than the way they write in a source file, by trying out all sorts of combinations of some little pieces while they work out the actual problem they're trying to solve in their heads) it seems like a good idea, as you're just removing friction from the system (what if circle.make_smaller() was named circle.reduce_size()? Is this responsibility better offshored to an intellisense-like technology with heavy autocompletion? But in general I don't want to be told what to type, I want what I type to work)
Yes. Now make this actually render a circle after each step. And provide pronouns (anaphora) like this, it and the radius (inferred noun in some syntax). My whole point was about a) smart objects that have prepopulated fields with default values, and b) anaphora. I don't have an opinion about the natural language at this point.

And get rid of the set_visible.

This gradual construction and refinement of exactly what you want reminds me of a certain TNG episode where they do just this: http://memory-alpha.org/wiki/Schisms_%28episode%29
This is addressed in the article, and arguably the article's main point. Quoth:

"I have to say that something I thought would be a big issue is the vagueness of natural language. That one particular natural language input might equally well refer to many different precise programs.

"And I had imagined it would be a routine thing to have to generate test examples for the user in order to be able to choose between different possible programs.

"But in reality this seems to be quite rare: there is usually an “obvious” interpretation, that in typical Wolfram|Alpha style, one can put first—with the less obvious interpretations a click away."

> "Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others?"

When those things matter, more information will be required in both natural language and a high level programming language. On the other hand, when none of that really matters a high level programming language still requires all those items to be specified.

Like any level of abstraction, there are tradeoffs. On the other hand to explain how to submit a reply, I don't say:

   <form method="post" action="/r">
     <input type="hidden" name="fnid" value="7YwrNY6bwe"/>
     <textarea name="text" rows="6" cols="60"/>
     <br/>
     <br/>
     <input type="submit" value="reply"/>
   </form>
I say "press the button."

edit: html example to fit natural language model.

> Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others?

http://www.wolframalpha.com/input/?i=draw+a+red+circle

I was expecting it to be filled with red, not just have a very thin red border.
That is a good example of how people are not precise enough with their natural language to be computationally useful.
And yet, "draw a red enso"* just gives me a circle.

* http://images.google.com/images?q=enso

(The results for "bring me some delicious pho" are similarly unsatisfactory - it just tells me that delicious means "greatly pleasing or entertaining". Not news to me, pal!)