In context of the actors dataset,
doc = nlp('James Stewart has the highest rating.')
fh_args = {'_sort': ['-rating']}
nugget = templatize(doc, fh_args, df)
print(nugget)
{% set fh_args = {"_sort": ["-rating"]} %}
{% set df = U.gfilter(orgdf, fh_args.copy()) %}
{% set fh_args = U.sanitize_fh_args(fh_args, orgdf) %}
{# Do not edit above this line. #}
{{ df["name"].iloc[0] }} is the {{ G.singular(df["category"].iloc[-2]).lower() }} with the highest rating.
The adjective highest should be templatized in the following manner:
- Find its lemma and inflected form and put them in a variable.
- Tie the lemma to the sort order.
- Automatically insert the antonym of the lemma if the sort order changes.
In context of the actors dataset,
The adjective
highestshould be templatized in the following manner: