Skip to content

Templatize comparative adjectives with respect to sort order. #38

@jaidevd

Description

@jaidevd

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:

  1. Find its lemma and inflected form and put them in a variable.
  2. Tie the lemma to the sort order.
  3. Automatically insert the antonym of the lemma if the sort order changes.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestnlpIssues related to NLP and smartness.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions