Document-Knowledge-Mining-Solution-Accelerator

Document-Knowledge-Mining-Solution-Accelerator

Azure OpenAI Service와 Azure AI Document Intelligence를 기반으로 구축된, 비정형, 다중모드 문서에서 요약, 엔터티, 메타데이터를 처리하고 추출하여 데이터를 검색하고 채팅할 수 있는 솔루션.

아키텍처 그림

  1. 실제 엔터티 추출 : 사람, 제품, 이벤트 장소 또는 행동과 같은 고유한 정보를 처리하고 추출

  2. 채팅 기반 Insight discovery : 모든 인덱싱 된 assets, 단일 assets, 선택한 assets 세트 또는 사용자 주도 키워드 검색을 기반으로 생성된 asset 목록과 채팅 가능

  3. 텍스트 및 문서 데이터 분석 : 문서, 손글씨 텍스트, 차트, 그래프, 표 및 양식 필드를 포함한 다중 모드 문서의 내용을 분석, 비교 및 요약하여 심층적인 통찰력을 제공

  4. 프롬프트 제안 가이드 : 프롬프트 문의를 기반으로 다음 질문 세트를 제안

  5. 다중 모드 정보 처리 : 여러 콘텐츠 유형과 다양한 형식의 지식을 처리하고 추출

대량의 데이터를 신속하게 분석하고, 관련 제안을 생성하여 빠르고 쉽게 추론할 수 있도록 도와준다.

Prerequisites

Powershell 설치

1
2
% brew install powershell/tap/powershell
% pwsh

macOS에 Azure CLI 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ brew update && brew install azure-cli

% az --version
azure-cli 2.67.0

core 2.67.0
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/usr/local/Cellar/azure-cli/2.67.0_1/libexec/bin/python'
Extensions directory '/Users/leehamin/.azure/cliextensions'

Python (Darwin) 3.12.8 (main, Dec 3 2024, 18:42:41) [Clang 16.0.0 (clang-1600.0.26.4)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

kubectl 설치

1
2
3
4
5
6
7
8
9
10
% sudo az aks install-cli
Password:
The detected architecture of current device is "x86_64", and the binary for "amd64" will be downloaded. If the detection is wrong, please download and install the binary corresponding to the appropriate architecture.
No version specified, will get the latest version of kubectl from "https://dl.k8s.io/release/stable.txt"
Downloading client to "/usr/local/bin/kubectl" from "https://dl.k8s.io/release/v1.32.0/bin/darwin/amd64/kubectl"
Please ensure that /usr/local/bin is in your search PATH, so the `kubectl` command can be found.
No version specified, will get the latest version of kubelogin from "https://api.github.com/repos/Azure/kubelogin/releases/latest"
Downloading client to "/tmp/tmpdiem7i3s/kubelogin.zip" from "https://github.com/Azure/kubelogin/releases/download/v0.1.6/kubelogin.zip"
Moving binary to "/usr/local/bin/kubelogin" from "/tmp/tmpdiem7i3s/bin/darwin_amd64/kubelogin"
Please ensure that /usr/local/bin is in your search PATH, so the `kubelogin` command can be found.

aks-preview 설치

Azure CLI의 extension으로서 AKS를 운영할 수 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 % az extension add --name aks-preview
No stable version of 'aks-preview' to install. Preview versions allowed.
The installed extension 'aks-preview' is in preview.

% az extension list
/usr/local/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/batch/models/_models_py3.py:4839: SyntaxWarning: invalid escape sequence '\s'
"""A Job Preparation Task to run before any Tasks of the Job on any given
[
{
"experimental": false,
"extensionType": "whl",
"name": "aks-preview",
"path": "/Users/leehamin/.azure/cliextensions/aks-preview",
"preview": true,
"version": "13.0.0b2"
}
]

Helm 설치

k8s의 패키지 매니저이다.

1
2
3
% brew install helm
% helm version
version.BuildInfo{Version:"v3.16.4", GitCommit:"7877b45b63f95635153b29a42c0c2f4273ec45ca", GitTreeState:"dirty", GoVersion:"go1.23.4"}

Docker Desktop 설치

서비스를 컨테이너화 하고 Azure Container Registry로 배포하기 위하여 도커 데스크탑을 설치한다.
Deploy script를 실행하기 전에 도커 데스크탑이 실행중인지 확인 필요하다.

Azure Access

subscription-level이 Owner나 User Access Administrator role로 필요하다.

Regional Availability

Azure 서비스와 모델이 지역별로 제공 여부가 제한된다.

Azure Open AI (GPT-4o mini)

  • 사용 모델 : 이 솔루션은 GPT-4o mini와 text-embedding-3-large 모델을 사용한다.
  • 제공 지역 : 해당 모델들은 현재 다음 지역에서만 사용 가능
    • West US3
    • East US
    • East US2
    • SwedenCentral

Azure AI Document Intelligence

  • 사용 API 버전 : 이 솔루션은 2023-10-31-preview 또는 그 이후 버전의 Document Intelligence를 사용한다.
  • 제공 지역 : 현재 해당 API는 East US 지역에서만 사용 가능하다.
  • 배포 지역 제한 : 이 모델은 반드시 East US 지역에 배포 되어야 한다.

Deployment

자동화 된 배포 단계

  1. Azure 리소스 배포
  2. Azure 리소스에서 Secrets 가져오기
  3. 애플리케이션 Config 파일에 Secrets 업데이트
  4. Azure App Configuration에 Application Config 설정
  5. 애플리케이션 컴파일, 이미지 빌드 및 Azire Container Registry에 푸시
  6. k8s 클러스터 인프라 구성
  7. k8s 구성 파일 업데이트
  8. 인증서, 인그레스 컨트롤러, 애플리케이션 이미지를 ACR에서 배포

Deployment Script 실행

1
2
3
4
5
% git clone https://github.com/microsoft/Document-Knowledge-Mining-Solution-Accelerator.git

# Powershell에서
% cd Document-Knowledge-Mining-Solution-Accelerator
> .\resourcedeployment.ps1

실행 시 에러 발생

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  _____                                        _                                               
| __ \ | |
| | | | ___ ___ _ _ _ __ ___ ___ _ __ | |_
| | | |/ _ \ / __| | | | '_ _ \ / _ \ '_ \| __|
| |__| | (_) | (__| |_| | | | | | | __/ | | | |_
|_____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__| __ __ _ _
| |/ / | | | | | \/ (_) (_)
| ' / _ __ _____ _| | ___ __| | __ _ ___ | \ / |_ _ __ _ _ __ __ _
| < | '_ \ / _ \ \ /\ / / |/ _ \/ _ |/ _ |/ _ \ | |\/| | | '_ \| | '_ \ / _ |
| . \| | | | (_) \ V V /| | __/ (_| | (_| | __/ | | | | | | | | | | | | (_| |
|_|\_\_| |_|\___/ \_/\_/ |_|\___|\__,_|\__, |\___| |_| |_|_|_| |_|_|_| |_|\__, |
_____ _ _ _ __/ | _ __/ |
/ ____| | | | | (_) |___/ /\ | | |___/ |
| (___ ___ | |_ _| |_ _ ___ _ __ / \ ___ ___ ___| | ___ _ __ __ _| |_ ___ _ __
\___ \ / _ \| | | | | __| |/ _ \| '_ \ / /\ \ / __/ __/ _ \ |/ _ \ '__/ _ | __/ _ \| '__|
____) | (_) | | |_| | |_| | (_) | | | | / ____ \ (_| (_| __/ | __/ | | (_| | || (_) | |
|_____/ \___/|_|\__,_|\__|_|\___/|_| |_| /_/ \_\___\___\___|_|\___|_| \__,_|\__\___/|_|


Please enter your Azure subscription ID to deploy your resources
> : ???
Please enter the Azure Data Center Region to deploy your resources
Available regions are:
EastUS, EastUS2, WestUS, WestUS2, WestUS3, CentralUS, NorthCentralUS, SouthCentralUS, WestEurope, NorthEurope, SoutheastAsia, EastAsia, JapanEast, JapanWest, AustraliaEast, AustraliaSoutheast, CentralIndia, SouthIndia, CanadaCentral, CanadaEast, UKSouth, UKWest, FranceCentral, FranceSouth, KoreaCentral, KoreaSouth, GermanyWestCentral, GermanyNorth, NorwayWest, NorwayEast, SwitzerlandNorth, SwitzerlandWest, UAENorth, UAECentral, SouthAfricaNorth, SouthAfricaWest, BrazilSouth, BrazilSoutheast, QatarCentral, ChinaNorth, ChinaEast, ChinaNorth2, ChinaEast2
> : KoreaCentral
Please enter the Azure Data Center Region to deploy your GPT model
Available regions are:
EastUS, EastUS2, SwedenCentral, WestUS3
> : EastUS
Please enter your email address for certificate management
> : hamin.lee@kt.com
***********************************************
* Step 1 : Deploy Azure resources *
***********************************************
Log in to Azure.....

A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance. Trace ID: 4b59632c-1d82-4588-85b4-abc86f4f1000 Correlation ID: e4938e47-8a82-462e-80a7-e83facbe56a5 Timestamp: 2024-12-18 08:38:47Z
Interactive authentication is needed. Please run:
az login
The subscription of '80083cf5-0434-4e94-b9a4-9f8ba244207e' doesn't exist in cloud 'AzureCloud'.
Switched subscription to '80083cf5-0434-4e94-b9a4-9f8ba244207e'

Deploying Azure resources in KoreaCentral region.....

Started Deploying Knowledge Mining Solution Accelerator Service Azure resources.....

Evaluating Deployment resource availabilities to preview changes...
ERROR: Error while attempting to retrieve the latest Bicep version: HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /BicepLatestRelease (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)'))).
There might be something wrong with your deployment.

Reference

Knowledge Mining/Conversation knowledge mining solution accelerator

Author

hamin

Posted on

2024-12-17

Updated on

2024-12-18

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.