You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nuggets should have a .clone() method, which copies a nugget but assigns a different set of FormHandler arguments. This would help auto-generate new nuggets.
fh_args= {'_sort': ['-rating']}
doc=nlp('James Stewart is the actor who has the highest rating.')
nugget=nlg.templatize(doc, fh_args, df)
new_nugget=nugget.clone({'_sort': ['rating']}) # note the change in sort ordernew_nugget.render(df)
# Katharine Hepburn is the actress who has the highest rating.
CAUTION: This will only work correctly if all tokens have been properly templatized. Note that the token "highest", left un-templatized, stays as it is even when the order of sorting changes. In this case, the token will have to be made sensitive to the sorting order (see #38) . But generally, any token left un-templatized may get affected.
The text was updated successfully, but these errors were encountered:
Nuggets should have a
.clone()
method, which copies a nugget but assigns a different set of FormHandler arguments. This would help auto-generate new nuggets.E.g, in the context of the actors dataset
CAUTION: This will only work correctly if all tokens have been properly templatized. Note that the token
"highest"
, left un-templatized, stays as it is even when the order of sorting changes. In this case, the token will have to be made sensitive to the sorting order (see #38) . But generally, any token left un-templatized may get affected.The text was updated successfully, but these errors were encountered: