Sentiment Classification (google/flan-ul2)

POST {{baseUrl}}/ml/v1/text/generation?version=2023-05-29

Request Params

KeyDatatypeRequiredDescription
versionstring

Request Body

{"input"=>"Classify this review as positive or negative.\n\nReview: The studio has embraced the poetry in craftsmanship and ushered in the most beautiful stop-motion animation film in years.\nClassification:", "parameters"=>{"decoding_method"=>"greedy", "max_new_tokens"=>1, "min_new_tokens"=>0, "repetition_penalty"=>1}, "model_id"=>"google/flan-ul2", "project_id"=>"{{projectId}}", "moderations"=>{"hap"=>{"input"=>{"enabled"=>true, "threshold"=>0.5, "mask"=>{"remove_entity_value"=>true}}, "output"=>{"enabled"=>true, "threshold"=>0.5, "mask"=>{"remove_entity_value"=>true}}}}}

RESPONSES

status: OK

{"model_id":"google/flan-ul2","created_at":"2024-04-05T21:43:36.801Z","results":[{"generated_text":"positive","generated_token_count":1,"input_token_count":40,"stop_reason":"max_tokens"}],"system":{"warnings":[{"message":"This model is a Non-IBM Product governed by a third-party license that may impose use restrictions and other obligations. By using this model you agree to its terms as identified in the following URL.","id":"disclaimer_warning","more_info":"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx"}]}}