연습: 배포된 모델 사용해 보기
이 연습에서는 자연어를 사용하여 완성 플레이그라운드에서 Azure OpenAI 배포와 상호 작용합니다.
자연어 생성 AI를 사용하는 ChatGPT와 같은 애플리케이션에 익숙할 수 있지만 이러한 모델을 챗봇 이상에 사용할 수 있습니다. 이러한 모델의 다른 유용한 애플리케이션을 살펴보겠습니다.
참고 항목
이 연습을 완료하려면 다음이 필요합니다.
- Azure 구독 무료로 만듭니다.
- 원하는 Azure 구독의 Azure OpenAI에 액세스합니다. 현재 이 서비스에 대한 액세스 권한은 애플리케이션을 통해서만 부여됩니다. https://aka.ms/oai/access에서 이 양식을 작성하여 Azure OpenAI에 대한 액세스를 신청합니다.
- 모델이 배포된 Azure OpenAI 리소스. 모델 배포에 대한 자세한 내용은 Azure OpenAI 서비스 리소스 만들기 및 배포를 참조하세요.
먼저 Azure OpenAI 완성 기능 플레이그라운드를 열고 모델 배포 선택을 통해 시작해 보겠습니다.
정보 추출
이 예제에서는 샘플 텍스트와 명령으로 구성된 프롬프트를 사용하여 정보를 추출하는 방법을 알아봅니다.
다음 텍스트를 복사하여 완성 텍스트 상자에 붙여넣습니다.
Extract the person's name, company name, location, and phone number from the text below. Hello. My name is Robert Smith. I'm calling from Contoso Insurance, Delaware. My colleague mentioned that you are interested in learning about our comprehensive benefits policy. Could you give me a call back at (555) 346-9322 when you get a chance so we can go over the benefits?생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
Person: Robert Smith Company: Contoso Insurance Location: Delaware Phone: (555) 346-9322
이 예제에서는 자연어 지침을 사용하여 정보를 추출하기 위해 프롬프트를 데이터와 결합했습니다. 모델은 텍스트에서 이름, 회사, 위치 및 전화 번호를 추출했습니다.
참고 항목
프롬프트 및 원본 데이터를 수정하여 다른 정보를 추출할 수 있습니다.
입력 추출 및 출력 형식 지정
다음 연습에서는 LLM(큰 언어 모델)에 텍스트를 테이블로 구성하도록 요청합니다. 이 예제에서는 LLM이 서식을 생성하고 서식화할 수 있음을 보여 줍니다.
완성 텍스트 상자를 지웁니다. 그런 다음, 다음 텍스트를 붙여넣습니다.
There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them. Please make a table summarizing the fruits from Goocrux | Fruit | Color | Flavor | | Neoskizzles | Purple | Sweet | | Loheckles | Grayish blue | Tart |생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
| Fruit | Color | Flavor | | Neoskizzles | Purple | Sweet | | Loheckles | Grayish blue | Tart | | Pounits | Bright green | Savory | | Loopnovas | Neon pink | Cotton candy | | Glowls | Pale orange | Sour/Bitter |
이 예제에서 모델은 원하는 출력 형식인 헤더 행과 몇 가지 예제로 준비됩니다.
다른 서식을 사용해 보세요. JSON
일부 텍스트를 제공하면 LLM에서 테이블을 생성할 수 있지만 LLM에 JSON 형식으로 데이터를 반환하도록 요청할 수도 있습니다.
완성 텍스트 상자를 지웁니다. 그런 다음, 다음 텍스트를 붙여넣습니다.
There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy. There are also loheckles, which are a grayish blue fruit and are very tart, a little bit like a lemon. Pounits are a bright green color and are more savory than sweet. There are also plenty of loopnovas which are a neon pink flavor and taste like cotton candy. Finally, there are fruits called glowls, which have a very sour and bitter taste which is acidic and caustic, and a pale orange tinge to them. Please make a table summarizing the fruits from Goocrux, Also make a JSON array summarizing the fruits from Goocrux. | Fruit | Color | Flavor | | Neoskizzles | Purple | Sweet | | Loheckles | Grayish blue | Tart |생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
| Loopnovas | Neon pink | Cotton candy | | Glowls | Pale orange | Sour/Bitter | ` { "fruits": [ { "fruit": "Neoskizzles", "color": "Purple", "flavor": "Sweet" }, { "fruit": "Loheckles", "color": "Grayish blue", "flavor": "Tart" }, { "fruit": "Pounits", "color": "Bright green", "flavor": "Savory" }, { "fruit": "Loopnovas", "color": "Neon pink", "flavor": "Cotton candy" }, { "fruit": "Glowls", "color": "Pale orange", "flavor": "Sour/Bitter" } ]
이 예제에서 모델은 JSON 형식으로 과일 및 해당 특성의 JSON 배열을 반환했습니다. LLM은 원하는 것과 원하는 방법을 모두 제공할 수 있습니다.
콘텐츠 분류
이 연습에서는 LLM을 사용하여 콘텐츠를 다른 범주로 정렬합니다.
완성 텍스트 상자를 지웁니다. 그런 다음, 다음 텍스트를 붙여넣습니다.
Classify the following news headline into 1 of the following categories: Business, Tech, Politics, Sport, Entertainment Headline 1: Donna Steffensen Is Cooking Up a New Kind of Perfection. The internet's most beloved cooking guru has a buzzy new book and a fresh new perspective. Category: Entertainment Headline 2: Major Retailer Announces Plans to Close Over 100 Stores. Category:생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
Headline 2: Major Retailer Announces Plans to Close Over 100 Stores Category: Business
헤드라인과 범주의 한 가지 예를 제공하고 모델에 두 번째 예제를 분류하도록 요청했습니다. 이 예제에서는 원샷 학습을 설명합니다. 단 하나의 예제를 사용하면 모델이 일반화하여 새 예제를 분류할 수 있습니다.
참고 항목
두 번째 헤드라인을 변경하여 다른 범주를 생성할 수 있습니다. 다음은 시도할 수 있는 몇 가지 예제 헤드라인입니다.
- Jets가 다시 졌습니다!
- 오바마, 재선 출마 발표
- 장외 거래에서 Microsoft 상승세
- 20nm 프로세스는 더 많은 밀도와 더 나은 전력 가치를 제공합니다.
콘텐츠 요약
요약된 콘텐츠는 더 긴 텍스트 블록이 말하는 내용을 빠르게 이해하려는 경우에 유용할 수 있습니다. 이 기능은 LLM에 기본 제공되어 있습니다.
완성 텍스트 상자를 지웁니다. 그런 다음, 다음 텍스트를 붙여넣습니다.
At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks. TL;DR생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
At the intersection of monolingual text, audio or visual sensory signals, and multilingual capabilities lies the "XYZ-code," a joint representation allowing for the transfer of learning in AI systems, according to Microsoft's Xuedong Huang. The CTO of Azure AI Services said the company's aim is to create pre-trained models that will enable machines to jointly learn representations and support a broad range of downstream AI tasks.
이 예제에서는 TL;DR을(를) 사용하여(너무 길어서 읽지 않음) 모델이 더 큰 텍스트의 짧은 요약을 만들도록 했습니다.
새 콘텐츠 생성
학습 데이터에서 유사한 콘텐츠의 빈도에 따라 출력이 생성되더라도 생성 AI 모델은 존재하지 않는 새로운 콘텐츠를 생성할 수 있습니다.
완성 텍스트 상자를 지웁니다. 그런 다음, 다음 텍스트를 붙여넣습니다.
Write a limerick about the Python programming language생성을 선택합니다. 출력은 다음 텍스트와 유사합니다.
There once was a language named Python Whose syntax was easy and quite fun It could handle big data And was used by NASA So learn it and you'll be second to none!
리머릭은 어땠나요? 마음에 들지 않으면 항상 완성 플레이그라운드에 파란색 원형 화살표 아이콘을 사용하여 새 리머릭을 생성하도록 요청할 수 있습니다.