Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning nuggets with different FormHandler arguments #37

Open
jaidevd opened this issue Feb 10, 2020 · 0 comments
Open

Cloning nuggets with different FormHandler arguments #37

jaidevd opened this issue Feb 10, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request nlp Issues related to NLP and smartness.

Comments

@jaidevd
Copy link
Member

jaidevd commented Feb 10, 2020

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

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 order
new_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.

@jaidevd jaidevd added the enhancement New feature or request label Feb 10, 2020
@jaidevd jaidevd self-assigned this Feb 10, 2020
@jaidevd jaidevd added the nlp Issues related to NLP and smartness. label Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nlp Issues related to NLP and smartness.
Projects
None yet
Development

No branches or pull requests

1 participant