[developers] Generation from MRS (via command-line)

Dominikus Wetzel dwetzel at coli.uni-sb.de
Mon Dec 12 06:19:58 CET 2011


Thanks to another hint by Stephan Oepen, I now get properly separable 
realizations. For reference: changing ~a to ~s helps by surrounding the 
realizations with double quotes.

(format stream "~s~%"
   (lkb::generate-from-mrs
     (mrs::read-single-mrs-xml-from-string<xml mrs>)
   :nanalyses<limit>)) )


Thanks for your help!
Best, Dominikus


On Friday 09,December,2011 03:31 PM, Dominikus Wetzel wrote:
> Thanks for the quick answer!
>
> In fact I have wrapped the call to "generate-from-mrs" with "format"
> which renders the output as a string:
>
> (format stream "~a~%"
> (lkb::generate-from-mrs
> (mrs::read-single-mrs-xml-from-string<xml mrs>)
> :nanalyses<limit>)) )
>
> So, indeed, the pretty printing you mentioned makes sense.
> Unfortunately, the pretty printer does not print double quotes around
> each list element, which is why it seems that the generated sentences
> are just concatenated.
>
> Now, I know the source of the problem. Off to writing up the solution to
> it ...
>
> Thank a lot again,
> Dominikus
>
>
>
> On Friday 09,December,2011 03:09 PM, Stephan Oepen wrote:
>> hi dominikus,
>>
>> i took a quick look at the code in lingo/lkb/src/mrs/generate.lisp,
>> and it appears generate-from-mrs() calls through a number of
>> function, to in the end return multiple values(), of which the first
>> is the result of extract-strings-from-gen-record().
>>
>> that function should return a list of strings, i.e. i suspect in the
>> output below you might have omitted the double quotes that
>> bracket each realization in the list?
>>
>> when printing the return value of a function, lisp will call its
>> built-in pretty printer, which will seek to serialize the object in
>> a manner that respects the active column width (i suspect
>> 80 characters by default). hence, i would think you get your
>> list broken across two lines.
>>
>> best, oe
>>
>>
>> On Fri, Dec 9, 2011 at 07:48, Dominikus Wetzel<dwetzel at coli.uni-sb.de>
>> wrote:
>>> Dear all,
>>>
>>> I opted for a different approach and use a modified version of the
>>> generate
>>> script, essentially directly calling the following lisp function:
>>>
>>> (lkb::generate-from-mrs
>>> (mrs::read-single-mrs-xml-from-string<xml mrs>)
>>> :nanalyses<limit>))
>>>
>>> However, the output of this function is not entirely clear. The most
>>> crucial
>>> part for me is the first return value, i.e. the realizations:
>>>
>>> (It doesn't taste very good. It does not taste very good.
>>> It does not taste very good.)
>>>
>>>
>>> The unclear part is why sometimes two (or even more) realizations are
>>> "on
>>> the same line" and sometimes only one (which is what I would expect).
>>>
>>> Can anyone give me a hint? Can this behavior be changed?
>>>
>>> Thanks a lot in advance,
>>> Dominikus
>>>
>>>
>>>
>>>
>>>
>>> On Tuesday 15,November,2011 05:20 PM, Dominikus Wetzel wrote:
>>>>
>>>> Dear all,
>>>>
>>>> My intention is to generate from (manipulated) MRSs.
>>>>
>>>> I was hoping to be able to use the $LOGONROOT/generate script. To my
>>>> understanding (and also as http://moin.delph-in.net/ItsdbProfile#result
>>>> somehow suggests), I would need a tsdb result file as input, which
>>>> contains at least the MRSs. However, the generate script
>>>> ($LOGONROOT/generate --binary --erg myprofile) attempts to parse again
>>>> (i.e. content is created in the tsdb parse file). And more importantly,
>>>> it doesn't generate any output into the new tsdb result file.
>>>>
>>>> I have tried out various combinations of input files and their contents
>>>> (e.g. providing tsdb item file with dummy values, providing the tsdb
>>>> parse file, ...).
>>>>
>>>> I'd be glad if anyone could let me know, ...
>>>>
>>>> a) ... whether generating from MRSs is possible with the generate
>>>> script
>>>> b) ... if yes, what input files are needed and what content they
>>>> have to
>>>> provide
>>>>
>>>> Thanks very much in advance.
>>>> Best wishes, Dominikus
>>
>>
>>



More information about the developers mailing list