[developers] STRINGPRED in MRS

Michael Wayne Goodman goodmami at uw.edu
Thu Jul 27 06:39:45 CEST 2017


On Wed, Jul 26, 2017 at 6:42 PM, Tuấn Anh Lê <tuananh.ke at gmail.com> wrote:

> Hi Mike,
>
> Thanks for answering :D. I think I misunderstood STRINGPRED flag in
> pyDelphin. I always think that there are 2 types of predicates, namely
> GRAMMARPRED and REALPRED. However I have encountered two different types of
> GRAMMARPRED, the one without cargs (such as pronoun_q_rel) and the one with
> carg (such as named_rel). I thought STRINGPRED was used to represent the
> GRAMMARPRED with CARG.
>

Ah I see. Unfortunately there is no predicate subcategorization that
indicates the presence of a constant argument. But, fortunately, there is
only one argument role for constant arguments (CARG), and nobody that I'm
aware of has chosen to rename it or add additional ones. The LKB and PET
allowed it to be customized via a *value-feats* parameter, but ACE just
assumes it will be "CARG", and nobody's complained about that yet. So I
think it's safe to assume it will be called "CARG". This assumption makes
the following easier...

Right now I'm transforming DMRS using pyDelphin and I'm looking for a way
> to find GRAMMARPRED with CARG because after each transformation pyDelphin
> take my CARGS out and hide them some where. I need the CARGS for other
> mapping though. Is there a way to accomplish this?
>

When working with Xmrs structures in PyDelphin, just look for "CARG" on an
EP's arguments. E.g. for some Xmrs object x that represents the sentence
"Abrams slept." where the named_rel EP has nodeid 10001:

>>> x.ep(10001).args.get('CARG')
'Abrams'

For convenience, I also define a "carg" property on EPs:

>>> x.ep(10001).carg
'Abrams'

These are essentially equivalent. If you just want to test for the presence
of the CARG, you can do this:

>>> 'CARG' in x.ep(10001).args
True
>>> 'CARG' in x.ep(10000).args  # 10000 is for proper_q
False

In DMRS, nodes do not contain information about the arguments the node
participates in; this information is stored in the links. However, CARGs
are special in that they become node attributes instead of links:

>>> from delphin.mrs.components import nodes
>>> ns = {n.nodeid: n for n in nodes(x)}
>>> ns[10001].carg
'Abrams'

If you try to recreate an Xmrs from Dmrs nodes and don't give it any links,
you will only get intrinsic arguments (ARG0s) and CARGs, and any other
arguments will be lost:

>>> from delphin.mrs.xmrs import Dmrs
>>> d = Dmrs(nodes=ns.values())
>>> d.ep(10001).args
{'CARG': 'Abrams', 'ARG0': 'x5'}
>>> d.ep(10002).args  # 10002 is for "slept"
{'ARG0': 'e6'}

If you also give it the links, it should be able to recreate the original
(x)mrs.

So I'm not sure what kind of transformation you are doing would cause the
CARG to be lost. Can you elaborate or provide a MWE (minimal working
example) that shows when the CARG is lost/hidden?


>
> On 27 July 2017 at 03:45, Michael Wayne Goodman <goodmami at uw.edu> wrote:
>
>> Hi Tuan Anh,
>>
>> The thinking of subtypes of predicates has changed over the years, and as
>> a result there's numerous overlapping terms for various things. I believe
>> that the current consensus (documented on http://moin.delph-in.net/Pr
>> edicateRfc) is that there are two main axes of subcategorization for
>> predicate symbols: abstract vs surface and string vs type (with "real"
>> predicates being a decomposed form of surface preds). But I suspect what
>> you mean by STRINGPRED is not the same thing as described on the wiki?
>>
>> I'm afraid PyDelphin is a bit behind the times WRT these definitions of
>> predicates, and instead follows mostly what was described in the MRS DTD
>> (as I understood it at the time). Therefore currently PyDelphin calls
>> predicates beginning with an underscore a "stringpred", regardless of
>> whether the symbol was quoted or not. I.e., it should be called
>> "surfacepred" or something. Abstract predicates are called "grammarpred" in
>> PyDelphin. I have created a ticket for this bug:
>> https://github.com/delph-in/pydelphin/issues/117.
>>
>> Now back to your question, "named_rel" is called a GRAMMARPRED in
>> PyDelphin because the predicate does not start with an underscore.
>>
>> On Wed, Jul 26, 2017 at 8:25 AM, Tuấn Anh Lê <tuananh.ke at gmail.com>
>> wrote:
>>
>>> Hi delphinians,
>>>
>>> I'm working on predicate mapping and found that named_rel are not
>>> STRINGPRED when processed by pyDelphin.Are these expected behaviours? Can
>>> someone please shed some light for me on this matter :D Thank you.
>>>
>>> REALPRED 1
>>> STRINGPRED 2
>>> <ElementaryPredication object (pron_rel (x24)) at 140241381023560> 0
>>> <ElementaryPredication object (pronoun_q_rel (x24)) at 140241380610120> 0
>>> <ElementaryPredication object (_have_v_1_rel (e25)) at 140241380610240> 1
>>> <ElementaryPredication object (_the_q_rel (x26)) at 140241380610360> 1
>>> <ElementaryPredication object (_pleasure_n_of_rel (x26)) at
>>> 140241380610480> 1
>>> <ElementaryPredication object (udef_q_rel (x27)) at 140241380610600> 0
>>> <ElementaryPredication object (nominalization_rel (x27)) at
>>> 140241380610720> 0
>>> <ElementaryPredication object (_make_v_1_rel (e28)) at 140241380610840> 1
>>> <ElementaryPredication object (_the_q_rel (x29)) at 140241380610960> 1
>>> <ElementaryPredication object (_doctor_n_1_rel (x29)) at
>>> 140241380611080> 1
>>> <ElementaryPredication object (def_explicit_q_rel (x31)) at
>>> 140241380611200> 0
>>> <ElementaryPredication object (poss_rel (e30)) at 140241380611320> 0
>>> <ElementaryPredication object (_acquaintance_n_1_rel (x31)) at
>>> 140241380611440> 1
>>> <ElementaryPredication object (_say_v_to_rel (e32)) at 140241380611560> 1
>>> <ElementaryPredication object (proper_q_rel (x33)) at 140241380611680> 0
>>> *<ElementaryPredication object (named_rel (x33)) at 140241380611800> 0*
>>> <ElementaryPredication object (_and_c_rel (e34)) at 140241380611920> 1
>>> <ElementaryPredication object (_in_p_rel (e35)) at 140241380612040> 1
>>> <ElementaryPredication object (udef_q_rel (x37)) at 140241380612160> 0
>>> <ElementaryPredication object (_a+few_a_1_rel (e36)) at 140241380612280>
>>> 1
>>> <ElementaryPredication object (_word_n_of_rel (x37)) at 140241380612400>
>>> 1
>>> <ElementaryPredication object (pron_rel (x38)) at 140241380612520> 0
>>> <ElementaryPredication object (pronoun_q_rel (x38)) at 140241380612640> 0
>>> <ElementaryPredication object (_sketch_v_1_rel (e39)) at
>>> 140241380612760> 1
>>> <ElementaryPredication object (_out_p_rel (e40)) at 140241380612880> 1
>>> <ElementaryPredication object (free_relative_q_rel (x41)) at
>>> 140241380613000> 0
>>> <ElementaryPredication object (thing_rel (x41)) at 140241380613120> 0
>>> <ElementaryPredication object (_occur_v_to_rel (e42)) at
>>> 140241380613240> 1
>>>
>>>
>>> Yours,
>>> --
>>> Tuan Anh Le
>>>
>>
>>
>>
>> --
>> Michael Wayne Goodman
>> Ph.D. Candidate, UW Linguistics
>>
>
>
>
> --
> Yours,
> --
> Tuan Anh Le
>



-- 
Michael Wayne Goodman
Ph.D. Candidate, UW Linguistics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/developers/attachments/20170726/8ce97a96/attachment.html>


More information about the developers mailing list