Skip to main content

Use Azure AI Language to generate abstractive summaries of documents.

Project description

Azure AI Language Custom Text Classification Tool for Prompt Flow

GitHub Actions Workflow Status PyPI - Version PyPI - Downloads

Based on promptflow-azure-ai-language

Name Description
Custom Text Classification Use Azure AI Language to generate abstractive summaries of documents

Requirements

PyPI package: promptflow-azure-ai-language.

  • For AzureML users: follow this wiki, starting from Prepare runtime.
  • For local users:
pip install promptflow-azure-ai-language

You may also want to install the Prompt flow for VS Code extension.

Prerequisites

The tool calls APIs from Azure AI Language. To use it, you must create a connection to an Azure AI Language resource. Create a Language Resource first, if necessary.

  • In Prompt flow, add a new CustomConnection.
    • Under the secrets field, specify the resource's API key: api_key: <Azure AI Language Resource api key>
    • Under the configs field, specify the resource's endpoint: endpoint: <Azure AI Language Resource endpoint>

Inputs

When a tool parameter is of type Document, it requires a dict object of this specification.

Example:

my_document = {
    "id": "1",
    "text": "This is some document text!",
    "language": "en"
}
Name Type Description Required
connection CustomConnection The created connection to an Azure AI Language resource. Yes
document Document The input document. Yes
project_name string The project to be called. Yes
deployment_name string The project deployment to be called. Yes
max_retries int The maximum number of HTTP request retries. Default value is 5. No
max_wait int The maximum wait time (in seconds) in-between HTTP requests. Default value is 60. No
parse_response bool Should the full API JSON output be parsed to extract the single task result. Default value is False. No

Outputs

  • When the input parameter parse_response is set to False (default value), the full API JSON response will be returned (as a dict object).
  • When the input parameter parse_response is set to True, the full API JSON response will be parsed to extract the single task result associated with the tool's given skill. Output will depend on the skill (but will still be a dict object). Refer to Azure AI Language's REST API reference for details on API response format, specific task result formats, etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page