TransWikia.com

How can I generate natural language sentences given logical structures that contain the subject, verb and target?

Artificial Intelligence Asked by Onza on January 21, 2021

I have a group of structures in a program that are very specific on their meaning, eg. this is a piece of code

randomItem = objects.concept.random("buyable")
idea.example(objects.concept.random("family", "friend")).does({
    action: "go",
    target: object.concent.random("shop")
}).then({
    action: "buys",
    target: randomItem,
    several: true
}).then({
    question: true,
    action: "know",
    property: "amount",
    target: randomItem,
    several: true
})

I have worked with natural language parsers before.

How do I go and transform this to Natural Language (the other way around), is there any way or method; I have logical structures in which I know who is the subject, what the verb and target.

Which methods can I use to generate language from this?

2 Answers

Look at MUMBLE, which is a kind of transducer working from Conceptual Dependency structures (which are similar to what you've got) and produce English output.

A Lisp implementation of Meehan's TALESPIN program, which includes a simplified version of MUMBLE can be found here: https://github.com/lispm/CommonLispCode/blob/master/micro-talespin.lisp -- the generator part starts at about line 1030. It should be easy to follow, even if you do not know Lisp.

Answered by Oliver Mason on January 21, 2021

It might be simpler to generate the language output yourself since you've already got a concrete concept structure in code.

Maybe you'll also want to be aware of potential future applications such as parsing your own output back to the inputs.

With that said, you could investigate Markov Chains or Google around a bit for Natural Language Processing and Natural Language Generation.

https://stackoverflow.com/questions/33068943/library-for-generating-natural-language-verbs-in-javascript

Answered by razodactyl on January 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP