How can Genifer be taught? A user can ask a query and force an answer. Then Genifer will generate a number of hypotheses in the KB that enable to infer that answer next time. Since some of these hypotheses can be wrong, the user should provide multiple examples to reduce the chance of wrong but accidentally correct hypotheses.
For example:
[ Sorry that this example is not related to programming... it's easier to think of a daily-life example. But I'll try to use programming examples as much as possible. ]
User: "Given: John eats spaghetti with Ben. Conclude: Ben eats spaghetti"
User: "Given: John eats spaghetti with Paul. Conclude: Paul eats spaghetti"
User: "Given: John dances with Mary. Conclude: Mary dances."
User: "Given: John eats spaghetti with meatball. Query: Does meatball eat spaghetti?"
Genifer: "Yes."
User: "That's incorrect."
etc etc ....
After the above session, an example rule that Genifer will have learnt is:
A VerbPhrase with B /\ B is a person -> B VerbPhrase
Notice that this rule may still have exceptions, but it is a useful rule.
Thus, inductive learning allows even lay people to teach Genifer. This is very important in our strategy to let online users contribute to the KB.
Some more examples with the word 'with':
- "factorial n" matches with "factorial 6" (pattern matching in Haskell)
- The function is evaluated with n = 6
- We can surround the function name with back-quotes
- [x,y,z] is a list with 3 elements
- Lists can be built with the : operator.
What needs to be taught?
Two areas:
1. semantics of basic / restricted English (with a vocabulary restricted to programming)
2. knowledge about programming
Possible first application areas:
- Find-and-replace, eg: "Find names of variables"
- Style checking (a good candidate because it only requires inference and pattern matching, no acting)
- String manipulation, eg: "Convert to camel case"
Sorry that this is still very vague... I have not figured out everything myself and need more time to think on it...
Have you considered teaming-up in a loose way with Stephen Reed's Texai project to benefit from the infrastructure he is developing?
ReplyDelete@lukasz:
ReplyDeleteI wanted to team up with Stephen Reed, but every time I tried to chat him up he's not very responsive. He's either uninterested in my inference engine or he is planning to brew his own?