SentimentAnalysisTransformers
Python template · sinapsis_huggingface_transformers.templates.sentiment_analysis_transformers
Overview
This template collects all the content in the text packets and runs inference using the sentiment-analysis task within the pipeline. Depending on the model, the label can be as simple as positive-negative or more complex.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-huggingface-transformers==1.0.0uv pip install sinapsis-huggingface-transformers==1.0.0uv add sinapsis-huggingface-transformers==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: "zero-shot-classification"
Optional
Default: null
Model from Huggingface hub that accepts sentiment-analysis or zero-short-classification in the pipeline. Options for zero-shot-classification:"MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli", "facebook/bart-large-mnli",… Read full field description
Model from Huggingface hub that accepts sentiment-analysis or zero-short-classification in the pipeline. Options for zero-shot-classification:"MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli", "facebook/bart-large-mnli", "MoritzLaurer/deberta-v3-base-zeroshot-v2.0", "joeddav/xlm-roberta-large-xnli" Options for sentiment-analysis: "finiteautomata/bertweet-base-sentiment-analysis", "distilbert/distilbert-base-uncased-finetuned-sst-2-english", "nlptown/bert-base-multilingual-uncased-sentiment", "tabularisai/multilingual-sentiment-analysis",
Optional
Default: "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
Optional
Default: "float16"
Optional
Default: "/home/ariel/.cache/sinapsis"
Optional
Default: null
Required
Default: null
Optional
Default: "float16"
Optional
Default: null
A dictionary of advanced parameters passed directly to the model's `generate` method for fine-tuning the pipeline generation.
Optional
Default: null
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: SentimentAnalysisTransformers
class_name: SentimentAnalysisTransformers
template_input: InputTemplate
attributes:
model_path: '/path/to/model'Show schema-based configuration skeleton
templates:
- template_name: "SentimentAnalysisTransformers"
class_name: "SentimentAnalysisTransformers"
attributes:
seed: null
task: "zero-shot-classification"
model_path: "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
torch_dtype: "float16"
model_cache_dir: "/home/ariel/.cache/sinapsis"
pipeline_kwargs:
device: "<required>"
torch_dtype: "float16"
inference_kwargs:
generate_kwargs: null
Inheritance
sinapsis_huggingface_transformers.templates.base_transformers.TransformersBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.