Rule: Huggingface Text Classification (to category) (Huggingface)

Last updated on
25 February 2024

This page has not yet been reviewed by AI Interpolator maintainer(s) and added to the menu.

Base data:

Summary:
The Huggingface Text Classification rule, takes any text and uses one of the many Text Classification models and runs it and collects the output into a text list field or a taxonomy field using the Text Classification Task.

You can choose between using the free inference API where available or host a dedicated endpoint via their system.

If you run the model frequently or need to have it readily available, the dedicated endpoint is the only way to go.

You need to pre-generate all the possible values before running this rule in your text list or your taxonomy.

Note that if you want it to check all the fields that passes the threshold you need to have a multiple field, otherwise it would just save the best ranked.

Module needed:
Huggingface

Field types to populate:

  • List (text)
  • Reference (taxonomy term) (core Taxonomy module).

Base Fields types to use as context:

  • Text (plain)
  • Text (plain, long)
  • Text (formatted)
  • Text (formatted, long)
  • Text (formatted, long, with summary)

Extra Requirements:
You need a Huggingface account and in the case of using it in production, a setup endpoint on the dedicated endpoint api.

Extra Settings:

None

Extra Advanced Settings:

Type of Inference

Choose the type of inference to use, between the free API or the dedicated endpoint.

Huggingface Model

If you use the free API here, you have to give the namespace to a Text Classification model, that allows to use the free dedicated api.

Huggingface Endpoint URL

If you use the dedicated endpoint API here, you have to give the url to an endpoint that hosts a Text Classification model.

Threshold

The threshold that has to be reached to be filled in.

Possible example use cases:

Help improve this page

Page status: No known problems

You can: