[Promptflow] Add model assets for Azure AI Language Prompt Flow gallery examples. (#2766)

* add assets for promptflow-azure-ai-language example flows

* remove follow-up tasks from analyze conversations example flow
This commit is contained in:
Sean Murray 2024-04-25 18:59:13 -07:00 коммит произвёл GitHub
Родитель 956ba085df
Коммит 2f23da9ed8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 318 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,4 @@
extra_config: model.yaml
spec: spec.yaml
type: model
categories: ["prompt flow"]

Просмотреть файл

@ -0,0 +1,115 @@
The "Analyze Conversations" is a standard model that utilizes Azure AI Language to perform various analyzes on text-based conversations. Azure AI language hosts pre-trained, task-oriented, and optimized conversation focused ML models, including various summarization aspects, PII entity extraction, etc.
### Inference samples
Inference type|CLI|VS Code Extension
|--|--|--|
Real time|<a href="https://microsoft.github.io/promptflow/how-to-guides/deploy-a-flow/index.html" target="_blank">deploy-promptflow-model-cli-example</a>|<a href="https://microsoft.github.io/promptflow/how-to-guides/deploy-a-flow/index.html" target="_blank">deploy-promptflow-model-vscode-extension-example</a>
Batch | N/A | N/A
### Sample inputs and outputs (for real-time inference)
#### Sample input
```json
{
"inputs": {
"transcript_path": "<path_to_txt_file>"
}
}
```
#### Sample output
Note: output has been shortened.
```json
{
"outputs": {
"narrative_summary": {
"summaries": [
{
"aspect": "narrative",
"text": "Ann Johnson, the host of \"Afternoon Cyber Tea\", welcomed the president of Microsoft Americas on the show. The president, who has a background in SAP and Standard Register, is known for her passion for building teams and developing individuals. She also serves as a board member for digital cloud and advisory services for Avanade and is an avid cyclist.",
"contexts": [
{
"conversationItemId": "1",
"offset": 0,
"length": 962
}
]
}
],
"id": "58",
"warnings": []
},
"recap_summary": {
"summaries": [
{
"aspect": "recap",
"text": "The speaker, Generic, is the president of Microsoft Americas and has a long career in technology. She shares her experience and leadership philosophy, emphasizing the importance of team and accountability. She also encourages organizations to support aspiring women leaders by showing up as an ally and providing resources. Generic encourages everyone to advocate for women in technology and encourages them to share their knowledge and experience.",
"contexts": [
{
"conversationItemId": "1",
"offset": 0,
"length": 962
}
]
}
],
"id": "58",
"warnings": []
},
"chapter_title": {
"summaries": [
{
"aspect": "chapterTitle",
"text": "Aftermath Cyber Tea: Exploring the Intersection of Innovation and Cybersecurity",
"contexts": [
{
"conversationItemId": "1",
"offset": 0,
"length": 962
},
{
"conversationItemId": "2",
"offset": 0,
"length": 334
}
]
}
],
"id": "58",
"warnings": []
},
"pii": {
"id": "58",
"conversationItems": [
{
"id": "1",
"redactedContent": {
"text": "Welcome to \"Afternoon Cyber Tea\" where we explore the intersection of innovation and cybersecurity. I am your host ***********. From the front lines of the digital defense to groundbreaking advancements shaping our digital future, we will bring you the latest insights, expert interviews, and captivating stories to stay one step ahead. [ Music ] Today we have a very special episode of \"Afternoon Cyber Tea\". I am thrilled, excited to be joined by ******** who is the president of Microsoft Americas. *** leads the $70 billion business responsible for delivering the full product and services portfolio of Microsoft to customers based in the United States, Canada, and Latin America. *** is a self-described \"team oriented\" leader with a passion for building teams and developing individuals. *** currently serves as a board member for digital cloud and advisory services for Avanade and serves as a board member for the famed luxury lifestyle leader ************."
},
"entities": [
{
"text": "Ann Johnson",
"category": "Person",
"offset": 115,
"length": 11,
"confidenceScore": 0.72
}
]
}
],
"warnings": []
},
"key_phrases": {
"id": "1",
"keyPhrases": [
"famed luxury lifestyle leader",
"large German software company",
"Afternoon Cyber Tea"
],
"warnings": []
}
}
}
```

Просмотреть файл

@ -0,0 +1,8 @@
path:
container_name: models
container_path: samples/analyze_conversations/v1
storage_name: pfazurelangstorage
type: azureblob
publish:
description: description.md
type: custom_model

Просмотреть файл

@ -0,0 +1,12 @@
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: analyze-conversations
path: ./
properties:
is-promptflow: true
azureml.promptflow.section: gallery
azureml.promptflow.type: standard
azureml.promptflow.name: Analyze Conversations
azureml.promptflow.description: Use Azure AI Language to analyze conversations & meetings.
inference-min-sku-spec: 2|0|14|28
inference-recommended-sku: Standard_DS3_v2
version: 1

Просмотреть файл

@ -0,0 +1,4 @@
extra_config: model.yaml
spec: spec.yaml
type: model
categories: ["prompt flow"]

Просмотреть файл

@ -0,0 +1,144 @@
The "Analyze Documents" is a standard model that utilizes Azure AI Language to perform various analyzes on text-based documents. Azure AI language hosts pre-trained, task-oriented, and optimized document focused ML models, such as summarization, sentiment analysis, entity extraction, etc.
### Inference samples
Inference type|CLI|VS Code Extension
|--|--|--|
Real time|<a href="https://microsoft.github.io/promptflow/how-to-guides/deploy-a-flow/index.html" target="_blank">deploy-promptflow-model-cli-example</a>|<a href="https://microsoft.github.io/promptflow/how-to-guides/deploy-a-flow/index.html" target="_blank">deploy-promptflow-model-vscode-extension-example</a>
Batch | N/A | N/A
### Sample inputs and outputs (for real-time inference)
#### Sample input
```json
{
"inputs": {
"document_path": "<path_to_txt_file>",
"language": "en"
}
}
```
#### Sample output
Note: output has been shortened.
```json
{
"outputs": {
"extractive_summary": {
"id": "2",
"sentences": [
{
"text": "\"With *********, we're making the era of AI real for ****** and businesses around the world,\" said *************, ********* and *********************** of *********.",
"rankScore": 0.62,
"offset": 682,
"length": 165
},
{
"text": "\"We're rapidly infusing AI into every layer of the tech stack and for every function and business process to drive increased productivity for our *********.\"",
"rankScore": 1,
"offset": 848,
"length": 157
},
{
"text": "Pacific time (5:30 p.m. Eastern time) ***** to discuss details of the company's performance for the quarter and certain forward-looking information.",
"rankScore": 0.98,
"offset": 4290,
"length": 148
}
],
"warnings": []
},
"abstractive_summary": {
"summaries": [
{
"text": "The company announced the results for the quarter ended ******************, with revenue, operating income, net income, and diluted earnings per share. The company returned $9.1 billion to its share buybacks and dividends in the first quarter of 2024.",
"contexts": [
{
"offset": 0,
"length": 11915
}
]
}
],
"id": "2",
"warnings": []
},
"sentiment": {
"id": "3",
"sentiment": "neutral",
"confidenceScores": {
"positive": 0.02,
"neutral": 0.96,
"negative": 0.02
},
"sentences": [
{
"sentiment": "neutral",
"confidenceScores": {
"positive": 0.02,
"neutral": 0.95,
"negative": 0.04
},
"offset": 0,
"length": 152,
"text": "The company announced the results for the quarter ended ******************, with revenue, operating income, net income, and diluted earnings per share. "
},
{
"sentiment": "neutral",
"confidenceScores": {
"positive": 0.01,
"neutral": 0.97,
"negative": 0.01
},
"offset": 152,
"length": 99,
"text": "The company returned $9.1 billion to its share buybacks and dividends in the first quarter of 2024."
}
],
"warnings": []
},
"recognized_entities": {
"id": "2",
"entities": [
{
"text": "AI",
"category": "Skill",
"type": "Skill",
"offset": 872,
"length": 2,
"confidenceScore": 1,
"tags": [
{
"name": "Skill",
"confidenceScore": 1
}
]
}
],
"warnings": []
},
"pii": {
"redactedText": "********* Cloud Strength Drives First-Quarter Results\n**************** | *********************\nShare on ******** (opens new window)\n \nShare on ******** (opens new window)\n \nShare on ******* (opens new window)\nREDMOND, Wash. — ************* — *************** ***** announced the following results for the quarter ended ******************, compared to the corresponding period of the prior fiscal year:\n\nRevenue was $56.5 billion, up 13% (up 12% in constant currency)\nOperating income was $26.9 billion, up 25% (up 24% in constant currency)\nNet income was $22.3 billion, up 27% (up 26% in constant currency)\nDiluted earnings per share were $2.99, up 27% (up 26% in constant currency)\n\"With *********, we're making the era of AI real for ****** and businesses around the world,\" said *************, ********* and *********************** of *********. \"We're rapidly infusing AI into every layer of the tech stack and for every function and business process to drive increased productivity for our *********.\"\n\n\"Consistent execution by our sales teams and ******** drove a strong start to the fiscal year with ********* Cloud revenue of $31.8 billion, up 24% (up 23% in constant currency) year-over-year,\" said ********, ************************ and *********************** at *********.",
"id": "1",
"entities": [
{
"text": "Microsoft",
"category": "Organization",
"offset": 0,
"length": 9,
"confidenceScore": 0.66
}
{
"text": "http://www.microsoft.com/en-us/investor.",
"category": "URL",
"offset": 11875,
"length": 40,
"confidenceScore": 0.8
}
],
"warnings": []
}
}
}
```

Просмотреть файл

@ -0,0 +1,8 @@
path:
container_name: models
container_path: samples/analyze_documents/v1
storage_name: pfazurelangstorage
type: azureblob
publish:
description: description.md
type: custom_model

Просмотреть файл

@ -0,0 +1,12 @@
$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: analyze-documents
path: ./
properties:
is-promptflow: true
azureml.promptflow.section: gallery
azureml.promptflow.type: standard
azureml.promptflow.name: Analyze Documents
azureml.promptflow.description: Use Azure AI Language to analyze text & documents.
inference-min-sku-spec: 2|0|14|28
inference-recommended-sku: Standard_DS3_v2
version: 1

Просмотреть файл

@ -0,0 +1,5 @@
[
{
"transcript_path": "./transcript.txt"
}
]

Просмотреть файл

@ -0,0 +1,6 @@
[
{
"document_path": "./document1.txt",
"language": "en"
}
]