Hugging Face

The Hugging Face component is an AI connector that allows users to connect the AI models served on the Hugging Face Platform. It can carry out the following tasks:

#Release Stage

Alpha

#Configuration

The component configuration is defined and maintained here.

#Connection

FieldField IDTypeNote
API Key (required)api_keystringFill your Hugging face API token. To find your token, visit https://huggingface.co/settings/tokens.
Base URL (required)base_urlstringHostname for the endpoint. To use Inference API set to https://api-inference.huggingface.co, for Inference Endpoint set to your custom endpoint.
Is Custom Endpoint (required)is_custom_endpointbooleanFill true if you are using a custom Inference Endpoint and not the Inference API.

#Supported Tasks

#Text Generation

Generating text is the task of producing new text. These models can, for example, fill in incomplete text or paraphrase.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_GENERATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
ParametersparametersobjectParameters
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Generated Textgenerated_textstringThe continuated string

#Fill Mask

Masked language modeling is the task of masking some of the words in a sentence and predicting which words should replace those masks.

InputIDTypeDescription
Task ID (required)taskstringTASK_FILL_MASK
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringa string to be filled from, must contain the [MASK] token (check model card for exact name of the mask)
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Resultsresultsarray[object]Results

#Summarization

Summarization is the task of producing a shorter version of a document while preserving its important information.

InputIDTypeDescription
Task ID (required)taskstringTASK_SUMMARIZATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
ParametersparametersobjectParameters
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Summary Textsummary_textstringThe string after summarization

#Text Classification

Text Classification is the task of assigning a label or class to a given text.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_CLASSIFICATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Resultsresultsarray[object]Results

#Token Classification

Token classification is a natural language understanding task in which a label is assigned to some tokens in a text.

InputIDTypeDescription
Task ID (required)taskstringTASK_TOKEN_CLASSIFICATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
ParametersparametersobjectParameters
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Resultsresultsarray[object]Results

#Translation

Translation is the task of converting text from one language to another.

InputIDTypeDescription
Task ID (required)taskstringTASK_TRANSLATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Translation Texttranslation_textstringThe string after translation

#Zero Shot Classification

Zero-shot text classification is a task in natural language processing where a model is trained on a set of labeled examples but is then able to classify new examples from previously unseen classes.

InputIDTypeDescription
Task ID (required)taskstringTASK_ZERO_SHOT_CLASSIFICATION
Model (required)modelstringThe Hugging Face model to be used
String Input (required)inputsstringString input
ParametersparametersobjectParameters
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Scoresscoresarray[number]a list of floats that correspond the the probability of label, in the same order as labels.
Labelslabelsarray[string]The list of strings for labels that you sent (in order)
Sequence (optional)sequencestringThe string sent as an input

#Question Answering

Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document.

InputIDTypeDescription
Task ID (required)taskstringTASK_QUESTION_ANSWERING
Model (required)modelstringThe Hugging Face model to be used
Inputs (required)inputsobjectInputs
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
AnsweranswerstringA string thatโ€™s the answer within the text.
Stop (optional)stopintegerThe index (string wise) of the stop of the answer within context.
Score (optional)scorenumberA float that represents how likely that the answer is correct
Start (optional)startintegerThe index (string wise) of the start of the answer within context.

#Table Question Answering

Table Question Answering (Table QA) is the answering a question about an information on a given table.

InputIDTypeDescription
Task ID (required)taskstringTASK_TABLE_QUESTION_ANSWERING
Model (required)modelstringThe Hugging Face model to be used
Inputs (required)inputsobjectInputs
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Aggregator (optional)aggregatorstringThe aggregator used to get the answer
AnsweranswerstringThe plaintext answer
Cells (optional)cellsarray[string]a list of coordinates of the cells contents
Coordinates (optional)coordinatesarray[array]a list of coordinates of the cells referenced in the answer

#Sentence Similarity

Sentence Similarity is the task of determining how similar two texts are.

InputIDTypeDescription
Task ID (required)taskstringTASK_SENTENCE_SIMILARITY
Model (required)modelstringThe Hugging Face model to be used
Inputs (required)inputsobjectInputs
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Scoresscoresarray[number]The associated similarity score for each of the given strings

#Conversational

Conversational response modelling is the task of generating conversational text that is relevant, coherent and knowledgable given a prompt.

InputIDTypeDescription
Task ID (required)taskstringTASK_CONVERSATIONAL
Model (required)modelstringThe Hugging Face model to be used
Inputs (required)inputsobjectInputs
ParametersparametersobjectParameters
OptionsoptionsobjectOptions for the model
OutputIDTypeDescription
Conversation (optional)conversationobjectA facility dictionnary to send back for the next input (with the new user input addition).
Generated Textgenerated_textstringThe answer of the bot

#Image Classification

Image classification is the task of assigning a label or class to an entire image.

InputIDTypeDescription
Task ID (required)taskstringTASK_IMAGE_CLASSIFICATION
Model (required)modelstringThe Hugging Face model to be used
Image (required)imagestringThe image file
OutputIDTypeDescription
Classesclassesarray[object]Classes

#Image Segmentation

Image Segmentation divides an image into segments where each pixel in the image is mapped to an object.

InputIDTypeDescription
Task ID (required)taskstringTASK_IMAGE_SEGMENTATION
Model (required)modelstringThe Hugging Face model to be used
Image (required)imagestringThe image file
OutputIDTypeDescription
Segmentssegmentsarray[object]Segments

#Object Detection

Object Detection models allow users to identify objects of certain defined classes.

InputIDTypeDescription
Task ID (required)taskstringTASK_OBJECT_DETECTION
Model (required)modelstringThe Hugging Face model to be used
Image (required)imagestringThe image file
OutputIDTypeDescription
Objectsobjectsarray[object]Objects

#Image To Text

Image to text models output a text from a given image.

InputIDTypeDescription
Task ID (required)taskstringTASK_IMAGE_TO_TEXT
Model (required)modelstringThe Hugging Face model to be used
Image (required)imagestringThe image file
OutputIDTypeDescription
TexttextstringGenerated text

#Speech Recognition

Automatic Speech Recognition (ASR), also known as Speech to Text (STT), is the task of transcribing a given audio to text.

InputIDTypeDescription
Task ID (required)taskstringTASK_SPEECH_RECOGNITION
Model (required)modelstringThe Hugging Face model to be used
Audio (required)audiostringThe audio file
OutputIDTypeDescription
TexttextstringThe string that was recognized within the audio file.

#Audio Classification

Audio classification is the task of assigning a label or class to a given audio.

InputIDTypeDescription
Task ID (required)taskstringTASK_AUDIO_CLASSIFICATION
Model (required)modelstringThe Hugging Face model to be used
Audio (required)audiostringThe audio file
OutputIDTypeDescription
Classesclassesarray[object]Classes

Last updated: 4/29/2024, 5:53:52 AM