<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 26, 2017 at 6:42 PM, Tuấn Anh Lê <span dir="ltr"><<a href="mailto:tuananh.ke@gmail.com" target="_blank">tuananh.ke@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Mike,<br><br></div>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. <br></div></blockquote><div><br></div><div>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...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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?<br></div></blockquote><div><br></div><div>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:</div><div><br></div><div><div>>>> x.ep(10001).args.get('CARG')<br></div><div>'Abrams'</div></div><div><br></div><div>For convenience, I also define a "carg" property on EPs:</div><div><br></div><div><div>>>> x.ep(10001).carg</div><div>'Abrams'</div></div><div><br></div><div>These are essentially equivalent. If you just want to test for the presence of the CARG, you can do this:</div><div><br></div><div><div>>>> 'CARG' in x.ep(10001).args</div><div>True</div><div>>>> 'CARG' in x.ep(10000).args # 10000 is for proper_q</div><div>False</div></div><div><br></div><div>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:</div><div><br></div><div><div>>>> from delphin.mrs.components import nodes</div><div>>>> ns = {n.nodeid: n for n in nodes(x)}</div><div>>>> ns[10001].carg<br></div><div>'Abrams'</div></div><div><br></div><div>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:</div><div><br></div><div><div>>>> from delphin.mrs.xmrs import Dmrs</div><div>>>> d = Dmrs(nodes=ns.values())<br></div><div>>>> d.ep(10001).args<br></div><div>{'CARG': 'Abrams', 'ARG0': 'x5'}</div><div>>>> d.ep(10002).args # 10002 is for "slept"</div><div>{'ARG0': 'e6'}</div></div><div><br></div><div>If you also give it the links, it should be able to recreate the original (x)mrs.</div><div><br></div><div>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?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div><div class="gmail-h5"><br><div class="gmail_quote">On 27 July 2017 at 03:45, Michael Wayne Goodman <span dir="ltr"><<a href="mailto:goodmami@uw.edu" target="_blank">goodmami@uw.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Tuan Anh,<div><br></div><div>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 <a href="http://moin.delph-in.net/PredicateRfc" target="_blank">http://moin.delph-in.net/Pr<wbr>edicateRfc</a>) 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?<br></div><div><br></div><div>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: <a href="https://github.com/delph-in/pydelphin/issues/117" target="_blank">https://github.com/delph-<wbr>in/pydelphin/issues/117</a>.</div><div><br></div><div>Now back to your question, "named_rel" is called a GRAMMARPRED in PyDelphin because the predicate does not start with an underscore.</div></div><div class="gmail_extra"><div><div class="gmail-m_5258065618808295139m_-2284633896360486370h5"><br><div class="gmail_quote">On Wed, Jul 26, 2017 at 8:25 AM, Tuấn Anh Lê <span dir="ltr"><<a href="mailto:tuananh.ke@gmail.com" target="_blank">tuananh.ke@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi delphinians,<br><br></div>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.<br clear="all"></div><div><div><div><div><br><span style="color:rgb(0,0,0)"><span style="font-family:monospace,monospace">REALPRED 1<br>STRINGPRED 2<br><ElementaryPredication object (pron_rel (x24)) at 140241381023560> 0<br><ElementaryPredication object (pronoun_q_rel (x24)) at 140241380610120> 0<br><ElementaryPredication object (_have_v_1_rel (e25)) at 140241380610240> 1<br><ElementaryPredication object (_the_q_rel (x26)) at 140241380610360> 1<br><ElementaryPredication object (_pleasure_n_of_rel (x26)) at 140241380610480> 1<br><ElementaryPredication object (udef_q_rel (x27)) at 140241380610600> 0<br><ElementaryPredication object (nominalization_rel (x27)) at 140241380610720> 0<br><ElementaryPredication object (_make_v_1_rel (e28)) at 140241380610840> 1<br><ElementaryPredication object (_the_q_rel (x29)) at 140241380610960> 1<br><ElementaryPredication object (_doctor_n_1_rel (x29)) at 140241380611080> 1<br><ElementaryPredication object (def_explicit_q_rel (x31)) at 140241380611200> 0<br><ElementaryPredication object (poss_rel (e30)) at 140241380611320> 0<br><ElementaryPredication object (_acquaintance_n_1_rel (x31)) at 140241380611440> 1<br><ElementaryPredication object (_say_v_to_rel (e32)) at 140241380611560> 1<br><ElementaryPredication object (proper_q_rel (x33)) at 140241380611680> 0<br><span style="color:rgb(0,0,255)"><b><ElementaryPredication object (named_rel (x33)) at 140241380611800> 0</b></span><br><ElementaryPredication object (_and_c_rel (e34)) at 140241380611920> 1<br><ElementaryPredication object (_in_p_rel (e35)) at 140241380612040> 1<br><ElementaryPredication object (udef_q_rel (x37)) at 140241380612160> 0<br><ElementaryPredication object (_a+few_a_1_rel (e36)) at 140241380612280> 1<br><ElementaryPredication object (_word_n_of_rel (x37)) at 140241380612400> 1<br><ElementaryPredication object (pron_rel (x38)) at 140241380612520> 0<br><ElementaryPredication object (pronoun_q_rel (x38)) at 140241380612640> 0<br><ElementaryPredication object (_sketch_v_1_rel (e39)) at 140241380612760> 1<br><ElementaryPredication object (_out_p_rel (e40)) at 140241380612880> 1<br><ElementaryPredication object (free_relative_q_rel (x41)) at 140241380613000> 0<br><ElementaryPredication object (thing_rel (x41)) at 140241380613120> 0<br><ElementaryPredication object (_occur_v_to_rel (e42)) at 140241380613240> 1</span></span><br><br><br><div class="gmail-m_5258065618808295139m_-2284633896360486370m_1562247147066762726m_-8402390868988665582gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:small">Yours,</span><span class="gmail-m_5258065618808295139m_-2284633896360486370m_1562247147066762726HOEnZb"><font color="#888888"><br style="font-size:small"><span style="font-size:small">-- </span><br style="font-size:small"><div style="font-size:small"><div dir="ltr">Tuan Anh Le</div></div></font></span></div></div></div></div>
</div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="gmail-m_5258065618808295139m_-2284633896360486370HOEnZb"><font color="#888888">-- <br><div class="gmail-m_5258065618808295139m_-2284633896360486370m_1562247147066762726gmail_signature"><div dir="ltr">Michael Wayne Goodman<div>Ph.D. Candidate, UW Linguistics</div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br></div></div>-- <br><span class="gmail-"><div class="gmail-m_5258065618808295139m_-2284633896360486370gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:small">Yours,</span><br style="font-size:small"><span style="font-size:small">-- </span><br style="font-size:small"><div style="font-size:small"><div dir="ltr">Tuan Anh Le</div></div></div></div></div></div>
</span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Michael Wayne Goodman<div>Ph.D. Candidate, UW Linguistics</div></div></div>
</div></div>