Slashdot Mirror


Metafor: Translating Natural Language to Code

vivin writes "Computer programming is second nature to most of the Slashdot crowd. However, this is not true for the vast majority of people. Formal programming languages are not as expressive or flexible as natural languages. This becomes more evident when we try to translate user requirements into actual code. Researchers at MIT have come up with a program that bridges this gap. It's not so much a tool that turns English into code, as it is a program that translates requirements (in English) to code. When Metafor analyzes English, nouns phrases become objects, verbs become functions, and adjectives become object attributes (or properties). In addition to helping programmers visualize their program better, I think it also promotes writing concise (and therefore) requirements and descriptions. Metafor doesn't handle run-on sentences (or bad English) that well." Update For for the dupe. Not going well. Appreciate all the hate mail. Really encourages improvement.

6 of 475 comments (clear)

  1. Rules by igny · · Score: 4, Interesting

    How hard is it to change rules of treating the sentences? Can Metaphor learn Chinese, for example?

    --
    In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
  2. Doomed to fail? by PissingInTheWind · · Score: 4, Interesting

    From Dijkstra's timeless "How do we tell truths that might hurt?":

    Projects promoting programming in "natural language" are intrinsically doomed to fail.

    He said that 30 years ago. People still don't listen.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
  3. Re:Other uses? by AKAImBatman · · Score: 4, Interesting
    Just a thought, but wouldn't it be easier to produce a specialized programming language for this? The instructions could then be pivoted into either a readable recipe, or commands for a robotic machine. Something like this:
    Ingredients
    {
    2 egg;
    1 tsp vanilla;
    4 cups flour;
    }

    Equipment
    {
    mixing bowl;
    oven;
    12x6 inch pan;
    }

    Directions
    {
    preheat oven 450 degrees farenheit;

    break 2 egg into mixing bowl;
    pour 1 tsp vanilla into mixing bowl;
    pour 4 cups flour into mixing bowl;

    mix mixing bowl;
    pour mixing bowl into 12x6 inch pan;
    place 12x6 inch pan into oven;

    bake 15 minutes;
    }
  4. Time flies like an arrow by Viking+Coder · · Score: 5, Interesting

    When a Harvard natural language parser was given the phrase "Time flies like an arrow," in the 1960s it identified the following five parse trees in reponse.

    1) Time proceeds as quickly as an arrow proceeds.
    2) Measure the speed of flies in the same way that you measure the speed of an arrow.
    3) Measure the speed of flies in the same way that an arrow measures the speed of flies.
    4) Measure the speed of flies that resemble an arrow.
    5) Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    I would guess the source code for those five different interpretations would be, well, different. (The fifth one is my favorite.)

    --
    Education is the silver bullet.
  5. Re:About your update, Taco by Tim+C · · Score: 5, Interesting

    Seems to me that a slashdot employee has one or more of four duties:

    1) pick stories to post
    2) sell advertising
    3) maintain the servers
    4) design and implement additions, bug fixes, etc

    Now, I'm not a subscriber, but I don't see much in the way of 4), even for features that the readership is crying out for, or that make financial sense for slashdot (such as moving to CSS for layout). I thought that /. got most of its advertising through the OSDN network, so I'd imagine that 2) is more or less minimal (and with /.'s fame, shouldn't be too hard anyway). That leaves 3) and 1). I have no idea about the time requirements of 3), but I can imagine that it might keep a couple of people busy full time.

    That seems to me to leave an awful lot of time left over for 1), picking stories to post. And yet, it seems like every day or two there is a dupe, every week or so there is a downright inaccurate (or even lying) summary or headline posted, and every month or so something that's accurately summarised, but the source is just plain made up or wrong.

    I know that the FAQ states that the editors don't check the stories for factual correctness, but Taco (et al) I ask you this: what do you do all day?

  6. Re:It's actually sorta important! by A+beautiful+mind · · Score: 5, Interesting

    Dear CmdrTaco!

    Please state your requirements about a dupe checker, between realistic boundaries.
    Things like - integration into the accepting stories interface seamlessly, spamassassin style dupe detector with a point based system, or even coding bayesian algorithms - are possible.

    I'm willing to (help to) code it. With two conditions. You'll apply it and use it. If this happens i'm predicting a serious decline in dupe stories and posts.

    If you fail to do this or you're not interested in this offer, then STOP being pissed, put up with the hate mail, the accusations about ad revenues, and use the bloody search function.

    Just to make sure this offer reaches you i'm going to mail it to you, and continue to do so - in regular periods - until i get some kind of reply, either a yay or a nay.

    Yours, a beautiful mind

    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say