추론 API 활용
원본 보기추론 API 활용
이 튜토리얼의 안내는 다양한 서비스와 함께 추론 API 워크플로를 사용해 데이터에 시맨틱 검색을 수행하는 방법을 보여줍니다.
Elastic Stack에서 시맨틱 검색을 가장 쉽게 수행하는 방법은 semantic_text 엔드투엔드 튜토리얼을 참고하세요.
다음 예시에서는 아래를 사용합니다:
- Cohere용
embed-english-v3.0모델 - HuggingFace의
all-mpnet-base-v2모델 - OpenAI의 2세대 임베딩 모델인
text-embedding-ada-002 - Azure AI Studio 또는 Azure OpenAI를 통해 사용할 수 있는 모델
- Google Vertex AI용
text-embedding-004모델 - Mistral용
mistral-embed모델 - Amazon Bedrock용
amazon.titan-embed-text-v1모델 - AlibabaCloud AI용
ops-text-embedding-zh-001모델
Cohere와 OpenAI의 모든 모델을 사용할 수 있으며, 모두 추론 API에서 지원됩니다. HuggingFace에서 사용할 수 있는 권장 모델 목록은 API 문서의 지원 모델 목록을 참고하세요.
아래 위젯에서 사용하려는 서비스의 이름을 클릭하면 해당 안내를 확인할 수 있습니다.
Cohere 서비스와 함께 추론 API를 사용하려면 Cohere 계정이 필요합니다.
ELSER는 Elastic이 학습시킨 모델입니다. Elasticsearch 배포판이 있다면 elasticsearch 서비스와 함께 추론 API를 사용하는 데 별도의 요구 사항이 없습니다.
HuggingFace 서비스와 함께 추론 API를 사용하려면 HuggingFace 계정이 필요합니다.
OpenAI 서비스와 함께 추론 API를 사용하려면 OpenAI 계정이 필요합니다.
- Azure 구독
- 사용하려는 Azure 구독에서 Azure OpenAI에 대한 액세스 권한. https://aka.ms/oai/access의 양식을 작성해 Azure OpenAI 액세스를 신청할 수 있습니다.
- Azure OpenAI Studio에 배포된 임베딩 모델.
- Azure 구독
- Azure AI Studio에 대한 액세스 권한
- 배포된 임베딩 또는 채팅 완성 모델.
- Google Cloud 계정
- Google Cloud의 프로젝트
- 프로젝트에서 활성화된 Vertex AI API
- Google Vertex AI API용 유효한 서비스 계정
- 서비스 계정에는 Vertex AI User 역할과
aiplatform.endpoints.predict권한이 있어야 합니다.
- La Plateforme의 Mistral 계정
- 해당 계정에서 생성한 API 키
- Amazon Bedrock에 접근할 수 있는 AWS 계정
- Amazon Bedrock 접근에 사용할 액세스 키와 시크릿 키 한 쌍
- AlibabaCloud에 접근할 수 있는 AlibabaCloud 계정
- API 키 섹션에서 해당 계정으로 생성한 API 키
추론 생성 API를 사용해 추론 엔드포인트를 만듭니다:
PUT _inference/text_embedding/cohere_embeddings
{
"service": "cohere",
"service_settings": {
"api_key": "<api_key>",
"model_id": "embed-english-v3.0",
"embedding_type": "byte"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는cohere_embeddings입니다. - Cohere 계정의 API 키입니다. API 키는 Cohere 대시보드의 API 키 섹션에서 확인할 수 있습니다. API 키는 한 번만 제공하면 됩니다. 추론 조회 API는 API 키를 반환하지 않습니다.
- 사용할 임베딩 모델의 이름입니다. Cohere 임베딩 모델 목록은 여기에서 확인할 수 있습니다.
이 모델을 사용할 때 dense_vector 필드 매핑에 권장되는 유사도 척도는 dot_product입니다. Cohere 모델의 경우 임베딩이 단위 길이로 정규화되므로 dot_product와 cosine 척도는 동일합니다.
PUT _inference/sparse_embedding/elser_embeddings
{
"service": "elastic",
"service_settings": {
"model_id": "elser_model_2",
"num_allocations": 1,
"num_threads": 1
}
}
- 경로의 태스크 유형은
sparse_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는elser_embeddings입니다.
ELSER 모델을 미리 다운로드하고 배포할 필요는 없습니다. 위 API 요청이 모델이 아직 다운로드되지 않았다면 다운로드한 뒤 배포합니다.
Kibana Console을 사용할 때 응답에 502 bad gateway 오류가 나타날 수 있습니다. 이 오류는 대개 모델이 백그라운드에서 다운로드되는 동안 발생한 타임아웃을 의미합니다. 다운로드 진행 상황은 Machine Learning UI에서 확인할 수 있습니다. Python 클라이언트를 사용한다면 timeout 파라미터를 더 큰 값으로 설정할 수 있습니다.
먼저 Hugging Face 엔드포인트 페이지에서 새 추론 엔드포인트를 만들어 엔드포인트 URL을 확보해야 합니다. 새 엔드포인트 생성 페이지에서 all-mpnet-base-v2 모델을 선택한 다음, Advanced configuration 섹션에서 Sentence Embeddings 태스크를 선택합니다. 엔드포인트를 생성합니다. 엔드포인트 초기화가 끝나면 URL을 복사합니다. 이 URL은 다음 추론 API 호출에 필요합니다.
PUT _inference/text_embedding/hugging_face_embeddings
{
"service": "hugging_face",
"service_settings": {
"api_key": "<access_token>",
"url": "<url_endpoint>"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는hugging_face_embeddings입니다. - 유효한 HuggingFace 액세스 토큰입니다. 계정 설정 페이지에서 확인할 수 있습니다.
- Hugging Face에서 생성한 추론 엔드포인트 URL입니다.
PUT _inference/text_embedding/openai_embeddings
{
"service": "openai",
"service_settings": {
"api_key": "<api_key>",
"model_id": "text-embedding-ada-002"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는openai_embeddings입니다. - OpenAI 계정의 API 키입니다. OpenAI API 키는 OpenAI 계정의 API 키 섹션에서 확인할 수 있습니다. API 키는 한 번만 제공하면 됩니다. 추론 조회 API는 API 키를 반환하지 않습니다.
- 사용할 임베딩 모델의 이름입니다. OpenAI 임베딩 모델 목록은 여기에서 확인할 수 있습니다.
이 모델을 사용할 때 dense_vector 필드 매핑에 권장되는 유사도 척도는 dot_product입니다. OpenAI 모델의 경우 임베딩이 단위 길이로 정규화되므로 dot_product와 cosine 척도는 동일합니다.
PUT _inference/text_embedding/azure_openai_embeddings
{
"service": "azureopenai",
"service_settings": {
"api_key": "<api_key>",
"resource_name": "<resource_name>",
"deployment_id": "<deployment_id>",
"api_version": "2024-02-01"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는azure_openai_embeddings입니다. - Azure OpenAI 서비스에 접근하기 위한 API 키입니다. 대신
api_key자리에entra_id를 제공할 수도 있습니다. 추론 조회 API는 이 정보를 반환하지 않습니다. - Azure 리소스의 이름입니다.
- 배포한 모델의 id입니다.
모델을 생성한 뒤 배포가 사용 가능한 상태가 되기까지 몇 분이 걸릴 수 있습니다. 위와 같이 모델을 생성했는데 404 오류 메시지를 받는다면 몇 분 기다린 후 다시 시도하세요. 또한 이 모델을 사용할 때 dense_vector 필드 매핑에 권장되는 유사도 척도는 dot_product입니다. Azure OpenAI 모델의 경우 임베딩이 단위 길이로 정규화되므로 dot_product와 cosine 척도는 동일합니다.
PUT _inference/text_embedding/azure_ai_studio_embeddings
{
"service": "azureaistudio",
"service_settings": {
"api_key": "<api_key>",
"target": "<target_uri>",
"provider": "<provider>",
"endpoint_type": "<endpoint_type>"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는azure_ai_studio_embeddings입니다. - Azure AI Studio에 배포한 모델에 접근하기 위한 API 키입니다. 모델 배포의 개요 페이지에서 확인할 수 있습니다.
- Azure AI Studio에 배포한 모델에 접근하기 위한 대상 URI입니다. 모델 배포의 개요 페이지에서 확인할 수 있습니다.
cohere나openai같은 모델 제공자입니다.- 배포된 엔드포인트 유형입니다. "종량제" 배포의 경우
token, 실시간 배포 엔드포인트의 경우realtime이 될 수 있습니다.
모델을 생성한 뒤 배포가 사용 가능한 상태가 되기까지 몇 분이 걸릴 수 있습니다. 위와 같이 모델을 생성했는데 404 오류 메시지를 받는다면 몇 분 기다린 후 다시 시도하세요. 또한 이 모델을 사용할 때 dense_vector 필드 매핑에 권장되는 유사도 척도는 dot_product입니다.
PUT _inference/text_embedding/google_vertex_ai_embeddings
{
"service": "googlevertexai",
"service_settings": {
"service_account_json": "<service_account_json>",
"model_id": "text-embedding-004",
"location": "<location>",
"project_id": "<project_id>"
}
}
- 경로에 따라 태스크 유형은
text_embedding입니다.google_vertex_ai_embeddings는 추론 엔드포인트의 고유 식별자(inference_id)입니다. - Google Vertex AI API용 JSON 형식의 유효한 서비스 계정입니다.
- 사용 가능한 모델 목록은 Text embeddings API 페이지를 참고하세요.
- 추론 태스크에 사용할 위치의 이름입니다. 사용 가능한 위치는 Generative AI on Vertex AI locations를 참고하세요.
- 추론 태스크에 사용할 프로젝트의 이름입니다.
PUT _inference/text_embedding/mistral_embeddings
{
"service": "mistral",
"service_settings": {
"api_key": "<api_key>",
"model": "<model_id>"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는mistral_embeddings입니다. - Mistral API에 접근하기 위한 API 키입니다. Mistral 계정의 API Keys 페이지에서 확인할 수 있습니다.
- Mistral 임베딩 모델 이름입니다. 예를 들어
mistral-embed입니다.
PUT _inference/text_embedding/amazon_bedrock_embeddings
{
"service": "amazonbedrock",
"service_settings": {
"access_key": "<aws_access_key>",
"secret_key": "<aws_secret_key>",
"region": "<region>",
"provider": "<provider>",
"model": "<model_id>"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는amazon_bedrock_embeddings입니다. - 액세스 키는 Amazon Bedrock에 접근할 사용자 계정의 AWS IAM 관리 페이지에서 확인할 수 있습니다.
- 시크릿 키는 지정한 액세스 키와 쌍을 이루는 키여야 합니다.
- 모델이 호스팅된 리전을 지정합니다.
- 모델 제공자를 지정합니다.
- 사용할 모델의 모델 ID 또는 ARN입니다.
PUT _inference/text_embedding/alibabacloud_ai_search_embeddings
{
"service": "alibabacloud-ai-search",
"service_settings": {
"api_key": "<api_key>",
"service_id": "<service_id>",
"host": "<host>",
"workspace": "<workspace>"
}
}
- 경로의 태스크 유형은
text_embedding이며, 추론 엔드포인트의 고유 식별자인inference_id는alibabacloud_ai_search_embeddings입니다. - AlibabaCloud AI Search API에 접근하기 위한 API 키입니다. API 키는 AlibabaCloud 계정의 API 키 섹션에서 확인할 수 있습니다. API 키는 한 번만 제공하면 됩니다. 추론 조회 API는 API 키를 반환하지 않습니다.
- AlibabaCloud AI Search 임베딩 모델 이름입니다. 예를 들어
ops-text-embedding-zh-001입니다. - AlibabaCloud AI Search 호스트 주소의 이름입니다.
- AlibabaCloud AI Search 워크스페이스의 이름입니다.
대상 인덱스, 즉 입력 텍스트를 기반으로 모델이 생성할 임베딩을 담을 인덱스의 매핑을 먼저 만들어야 합니다. 대상 인덱스에는 사용한 모델의 출력을 색인하기 위해, 대부분의 모델에서는 dense_vector 필드 유형의 필드가, elasticsearch 서비스처럼 희소 벡터 모델을 쓰는 경우에는 sparse_vector 필드 유형의 필드가 있어야 합니다.
PUT cohere-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1024,
"element_type": "byte"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 사용하는 모델의 Cohere 문서에서 이 값을 확인하세요.
- 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT elser-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "sparse_vector"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- ELSER의 경우 토큰을 담을 필드는
sparse_vector필드입니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT hugging-face-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 768,
"element_type": "float"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 HuggingFace 모델 문서에서 확인하세요.
- 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT openai-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1536,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 사용하는 모델의 OpenAI 문서에서 이 값을 확인하세요.
- OpenAI 임베딩은 단위 길이로 정규화되므로 유사도 계산에 더 빠른
dot_product함수를 사용할 수 있습니다. 어떤 유사도 함수를 사용할지는 OpenAI 문서에서 확인할 수 있습니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT azure-openai-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1536,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 사용하는 모델의 Azure OpenAI 문서에서 이 값을 확인하세요.
- Azure OpenAI 임베딩은 단위 길이로 정규화되므로 유사도 계산에는
dot_product함수를 사용해야 합니다. 모델 사양에 대한 자세한 내용은 Azure OpenAI embeddings 문서를 참고하세요. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT azure-ai-studio-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1536,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 Azure AI Studio 배포의 모델 카드에서 확인할 수 있습니다.
- Azure AI Studio 임베딩의 경우 유사도 계산에는
dot_product함수를 사용해야 합니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT google-vertex-ai-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 768,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 임베딩을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 임베딩을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 Google Vertex AI 모델 레퍼런스에서 확인할 수 있습니다.
dims를 지정하지 않으면 추론 API가 출력 차원 수를 자동으로 계산하려고 시도합니다. - Google Vertex AI 임베딩의 경우 유사도 계산에는
dot_product함수를 사용해야 합니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는
text입니다.
PUT mistral-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1024,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 Mistral 모델 레퍼런스에서 확인할 수 있습니다.
- Mistral 임베딩의 경우 유사도 계산에는
dot_product함수를 사용해야 합니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT amazon-bedrock-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1024,
"element_type": "float",
"similarity": "dot_product"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 사용하는 기반 모델에 따라 다를 수 있습니다. Amazon Titan 모델 또는 Cohere Embeddings 모델 문서를 참고하세요.
- Amazon Bedrock 임베딩의 경우 유사도 계산에 Amazon titan 모델은
dot_product함수를, Cohere 모델은cosine을 사용해야 합니다. - 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
PUT alibabacloud-ai-search-embeddings
{
"mappings": {
"properties": {
"content_embedding": {
"type": "dense_vector",
"dims": 1024,
"element_type": "float"
},
"content": {
"type": "text"
}
}
}
}
- 생성된 토큰을 담을 필드의 이름입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다.
- 토큰을 담을 필드는
dense_vector필드입니다. - 모델의 출력 차원 수입니다. 이 값은 사용하는 기반 모델에 따라 다를 수 있습니다. AlibabaCloud AI Search 임베딩 모델 문서를 참고하세요.
- 밀집 벡터 표현을 생성할 원본 필드의 이름입니다. 이 예시에서 필드 이름은
content입니다. 다음 단계의 추론 파이프라인 설정에서 이 이름을 참조해야 합니다. - 필드 유형이며, 이 예시에서는 text입니다.
추론 프로세서가 포함된 인제스트 파이프라인을 만들고, 위에서 생성한 모델을 사용해 파이프라인으로 수집되는 데이터에 추론을 수행합니다.
PUT _ingest/pipeline/cohere_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "cohere_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/elser_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "elser_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/hugging_face_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "hugging_face_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/openai_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "openai_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/azure_openai_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "azure_openai_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/azure_ai_studio_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "azure_ai_studio_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/google_vertex_ai_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "google_vertex_ai_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/mistral_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "mistral_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/amazon_bedrock_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "amazon_bedrock_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
PUT _ingest/pipeline/alibabacloud_ai_search_embeddings_pipeline
{
"processors": [
{
"inference": {
"model_id": "alibabacloud_ai_search_embeddings",
"input_output": {
"input_field": "content",
"output_field": "content_embedding"
}
}
}
]
}
- 추론 생성 API로 만든 추론 엔드포인트의 이름이며, 해당 단계에서는
inference_id로 부릅니다. - 추론 과정의
input_field와 추론 결과를 담을output_field를 정의하는 설정 객체입니다.
이 단계에서는 이후 추론 인제스트 파이프라인에서 임베딩을 생성하는 데 사용할 데이터를 적재합니다.
MS MARCO Passage Ranking 데이터셋의 부분집합인 msmarco-passagetest2019-top1000 데이터셋을 사용합니다. 이 데이터셋은 200개의 쿼리로 구성되며, 각 쿼리에는 관련된 텍스트 구절 목록이 함께 있습니다. 해당 데이터셋에서 모든 고유 구절과 그 ID를 추출해 tsv 파일로 정리해 두었습니다.
파일을 내려받은 뒤 Machine Learning UI의 Data Visualizer를 사용해 클러스터에 업로드하세요. 데이터 분석이 끝나면 Override settings를 클릭합니다. Edit field names에서 첫 번째 열에는 id를, 두 번째 열에는 content를 지정합니다. Apply를 클릭한 다음 Import를 클릭합니다. 인덱스 이름을 test-data로 지정하고 Import를 클릭합니다. 업로드가 완료되면 182,469개의 문서를 가진 test-data 인덱스를 확인할 수 있습니다.
선택한 모델을 사용하는 추론 파이프라인을 통해 데이터를 리인덱싱해 텍스트로부터 임베딩을 생성합니다. 이 단계에서는 reindex API를 사용해 파이프라인을 통한 데이터 수집을 시뮬레이션합니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "cohere-embeddings",
"pipeline": "cohere_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
Cohere 계정의 요청 제한이 리인덱싱 처리량에 영향을 줄 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "elser-embeddings",
"pipeline": "elser_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "hugging-face-embeddings",
"pipeline": "hugging_face_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "openai-embeddings",
"pipeline": "openai_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
OpenAI 계정의 요청 제한이 리인덱싱 처리량에 영향을 줄 수 있습니다. 이런 경우 size를 3 또는 그와 비슷한 수준의 값으로 변경하세요.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "azure-openai-embeddings",
"pipeline": "azure_openai_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
Azure OpenAI 계정의 요청 제한이 리인덱싱 처리량에 영향을 줄 수 있습니다. 이런 경우 size를 3 또는 그와 비슷한 수준의 값으로 변경하세요.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "azure-ai-studio-embeddings",
"pipeline": "azure_ai_studio_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
Azure AI Studio 모델 배포에 요청 제한이 걸려 있어 리인덱싱 처리량에 영향을 줄 수 있습니다. 이런 경우 size를 3 또는 그와 비슷한 수준의 값으로 변경하세요.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "google-vertex-ai-embeddings",
"pipeline": "google_vertex_ai_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신됩니다. 덕분에 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "mistral-embeddings",
"pipeline": "mistral_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "amazon-bedrock-embeddings",
"pipeline": "amazon_bedrock_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "test-data",
"size": 50
},
"dest": {
"index": "alibabacloud-ai-search-embeddings",
"pipeline": "alibabacloud_ai_search_embeddings_pipeline"
}
}
- 리인덱싱의 기본 배치 크기는 1000입니다.
size를 더 작은 값으로 줄이면 리인덱싱 진행 상황이 더 빠르게 갱신되므로 진행 상태를 가까이 추적하고 오류를 일찍 발견할 수 있습니다.
이 호출은 진행 상황을 모니터링할 수 있는 태스크 ID를 반환합니다:
GET _tasks/<task_id>
큰 데이터셋을 리인덱싱하면 시간이 오래 걸릴 수 있습니다. 데이터셋의 일부만 사용해 이 워크플로를 테스트할 수 있습니다. 리인덱싱 작업을 취소하고 이미 리인덱싱된 부분집합에 대해서만 임베딩을 생성하면 됩니다. 다음 API 요청은 리인덱싱 태스크를 취소합니다:
POST _tasks/<task_id>/_cancel
데이터셋이 임베딩으로 보강되면 시맨틱 검색으로 데이터를 조회할 수 있습니다. 밀집 벡터 모델의 경우, k-최근접 이웃(kNN) 벡터 검색 API에 query_vector_builder를 전달하고 쿼리 텍스트와 임베딩 생성에 사용한 모델을 지정합니다. ELSER 같은 희소 벡터 모델의 경우에는 sparse_vector 쿼리를 사용하고, 임베딩 생성에 사용한 모델과 함께 쿼리 텍스트를 지정합니다.
리인덱싱 과정을 취소했다면 데이터의 일부에 대해서만 쿼리를 실행하게 되며, 이는 결과의 품질에 영향을 줍니다.
GET cohere-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "cohere_embeddings",
"model_text": "Muscles in human body"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 cohere-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "cohere-embeddings",
"_id": "-eFWCY4BECzWLnMZuI78",
"_score": 0.737484,
"_source": {
"id": 1690948,
"content": "Oxygen is supplied to the muscles via red blood cells. Red blood cells carry hemoglobin which oxygen bonds with as the hemoglobin rich blood cells pass through the blood vessels of the lungs.The now oxygen rich blood cells carry that oxygen to the cells that are demanding it, in this case skeletal muscle cells.ther ways in which muscles are supplied with oxygen include: 1 Blood flow from the heart is increased. 2 Blood flow to your muscles in increased. 3 Blood flow from nonessential organs is transported to working muscles."
}
},
{
"_index": "cohere-embeddings",
"_id": "HuFWCY4BECzWLnMZuI_8",
"_score": 0.7176013,
"_source": {
"id": 1692482,
"content": "The thoracic cavity is separated from the abdominal cavity by the diaphragm. This is a broad flat muscle. (muscular) diaphragm The diaphragm is a muscle that separate…e the thoracic from the abdominal cavity. The pelvis is the lowest part of the abdominal cavity and it has no physical separation from it Diaphragm."
}
},
{
"_index": "cohere-embeddings",
"_id": "IOFWCY4BECzWLnMZuI_8",
"_score": 0.7154432,
"_source": {
"id": 1692489,
"content": "Muscular Wall Separating the Abdominal and Thoracic Cavities; Thoracic Cavity of a Fetal Pig; In Mammals the Diaphragm Separates the Abdominal Cavity from the"
}
},
{
"_index": "cohere-embeddings",
"_id": "C-FWCY4BECzWLnMZuI_8",
"_score": 0.695313,
"_source": {
"id": 1691493,
"content": "Burning, aching, tenderness and stiffness are just some descriptors of the discomfort you may feel in the muscles you exercised one to two days ago.For the most part, these sensations you experience after exercise are collectively known as delayed onset muscle soreness.urning, aching, tenderness and stiffness are just some descriptors of the discomfort you may feel in the muscles you exercised one to two days ago."
}
},
(...)
]
GET elser-embeddings/_search
{
"query":{
"sparse_vector":{
"field": "content_embedding",
"inference_id": "elser_embeddings",
"query": "How to avoid muscle soreness after running?"
}
},
"_source": [
"id",
"content"
]
}
그 결과로 cohere-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "elser-embeddings",
"_id": "ZLGc_pABZbBmsu5_eCoH",
"_score": 21.472063,
"_source": {
"id": 2258240,
"content": "You may notice some muscle aches while you are exercising. This is called acute soreness. More often, you may begin to feel sore about 12 hours after exercising, and the discomfort usually peaks at 48 to 72 hours after exercise. This is called delayed-onset muscle soreness.It is thought that, during this time, your body is repairing the muscle, making it stronger and bigger.You may also notice the muscles feel better if you exercise lightly. This is normal.his is called delayed-onset muscle soreness. It is thought that, during this time, your body is repairing the muscle, making it stronger and bigger. You may also notice the muscles feel better if you exercise lightly. This is normal."
}
},
{
"_index": "elser-embeddings",
"_id": "ZbGc_pABZbBmsu5_eCoH",
"_score": 21.421381,
"_source": {
"id": 2258242,
"content": "Photo Credit Jupiterimages/Stockbyte/Getty Images. That stiff, achy feeling you get in the days after exercise is a normal physiological response known as delayed onset muscle soreness. You can take it as a positive sign that your muscles have felt the workout, but the pain may also turn you off to further exercise.ou are more likely to develop delayed onset muscle soreness if you are new to working out, if you’ve gone a long time without exercising and start up again, if you have picked up a new type of physical activity or if you have recently boosted the intensity, length or frequency of your exercise sessions."
}
},
{
"_index": "elser-embeddings",
"_id": "ZrGc_pABZbBmsu5_eCoH",
"_score": 20.542095,
"_source": {
"id": 2258248,
"content": "They found that stretching before and after exercise has no effect on muscle soreness. Exercise might cause inflammation, which leads to an increase in the production of immune cells (comprised mostly of macrophages and neutrophils). Levels of these immune cells reach a peak 24-48 hours after exercise.These cells, in turn, produce bradykinins and prostaglandins, which make the pain receptors in your body more sensitive. Whenever you move, these pain receptors are stimulated.hey found that stretching before and after exercise has no effect on muscle soreness. Exercise might cause inflammation, which leads to an increase in the production of immune cells (comprised mostly of macrophages and neutrophils). Levels of these immune cells reach a peak 24-48 hours after exercise."
}
},
(...)
]
GET hugging-face-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "hugging_face_embeddings",
"model_text": "What's margin of error?"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 hugging-face-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "hugging-face-embeddings",
"_id": "ljEfo44BiUQvMpPgT20E",
"_score": 0.8522128,
"_source": {
"id": 7960255,
"content": "The margin of error can be defined by either of the following equations. Margin of error = Critical value x Standard deviation of the statistic. Margin of error = Critical value x Standard error of the statistic. If you know the standard deviation of the statistic, use the first equation to compute the margin of error. Otherwise, use the second equation. Previously, we described how to compute the standard deviation and standard error."
}
},
{
"_index": "hugging-face-embeddings",
"_id": "lzEfo44BiUQvMpPgT20E",
"_score": 0.7865497,
"_source": {
"id": 7960259,
"content": "1 y ou are told only the size of the sample and are asked to provide the margin of error for percentages which are not (yet) known. 2 This is typically the case when you are computing the margin of error for a survey which is going to be conducted in the future."
}
},
{
"_index": "hugging-face-embeddings1",
"_id": "DjEfo44BiUQvMpPgT20E",
"_score": 0.6229427,
"_source": {
"id": 2166183,
"content": "1. In general, the point at which gains equal losses. 2. In options, the market price that a stock must reach for option buyers to avoid a loss if they exercise. For a call, it is the strike price plus the premium paid. For a put, it is the strike price minus the premium paid."
}
},
{
"_index": "hugging-face-embeddings1",
"_id": "VzEfo44BiUQvMpPgT20E",
"_score": 0.6034223,
"_source": {
"id": 2173417,
"content": "How do you find the area of a circle? Can you measure the area of a circle and use that to find a value for Pi?"
}
},
(...)
]
GET openai-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "openai_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 openai-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "openai-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "openai-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "openai-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
GET azure-openai-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "azure_openai_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 azure-openai-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "azure-openai-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "azure-openai-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "azure-openai-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
GET azure-ai-studio-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "azure_ai_studio_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 azure-ai-studio-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "azure-ai-studio-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "azure-ai-studio-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "azure-ai-studio-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
GET google-vertex-ai-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "google_vertex_ai_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 mistral-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "google-vertex-ai-embeddings",
"_id": "Ryv0nZEBBFPLbFsdCbGn",
"_score": 0.86815524,
"_source": {
"id": 3041038,
"content": "For example, the cost of the fuel could be 96.9, the amount could be 10 pounds, and the distance covered could be 80 miles. To convert between Litres per 100KM and Miles Per Gallon, please provide a value and click on the required button.o calculate how much fuel you'll need for a given journey, please provide the distance in miles you will be covering on your journey, and the estimated MPG of your vehicle. To work out what MPG you are really getting, please provide the cost of the fuel, how much you spent on the fuel, and how far it took you."
}
},
{
"_index": "google-vertex-ai-embeddings",
"_id": "w4j0nZEBZ1nFq1oiHQvK",
"_score": 0.8676357,
"_source": {
"id": 1541469,
"content": "This driving cost calculator takes into consideration the fuel economy of the vehicle that you are travelling in as well as the fuel cost. This road trip gas calculator will give you an idea of how much would it cost to drive before you actually travel.his driving cost calculator takes into consideration the fuel economy of the vehicle that you are travelling in as well as the fuel cost. This road trip gas calculator will give you an idea of how much would it cost to drive before you actually travel."
}
},
{
"_index": "google-vertex-ai-embeddings",
"_id": "Hoj0nZEBZ1nFq1oiHQjJ",
"_score": 0.80510974,
"_source": {
"id": 7982559,
"content": "What's that light cost you? 1 Select your electric rate (or click to enter your own). 2 You can calculate results for up to four types of lights. 3 Select the type of lamp (i.e. 4 Select the lamp wattage (lamp lumens). 5 Enter the number of lights in use. 6 Select how long the lamps are in use (or click to enter your own; enter hours on per year). 7 Finally, ..."
}
},
(...)
]
GET mistral-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "mistral_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 mistral-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "mistral-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "mistral-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "mistral-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
GET amazon-bedrock-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "amazon_bedrock_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 amazon-bedrock-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "amazon-bedrock-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "amazon-bedrock-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "amazon-bedrock-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
GET alibabacloud-ai-search-embeddings/_search
{
"knn": {
"field": "content_embedding",
"query_vector_builder": {
"text_embedding": {
"model_id": "alibabacloud_ai_search_embeddings",
"model_text": "Calculate fuel cost"
}
},
"k": 10,
"num_candidates": 100
},
"_source": [
"id",
"content"
]
}
그 결과로 alibabacloud-ai-search-embeddings 인덱스에서 쿼리와 의미상 가장 가까운 상위 10개 문서를 쿼리와의 근접도 순으로 정렬해 받습니다:
"hits": [
{
"_index": "alibabacloud-ai-search-embeddings",
"_id": "DDd5OowBHxQKHyc3TDSC",
"_score": 0.83704096,
"_source": {
"id": 862114,
"body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes."
}
},
{
"_index": "alibabacloud-ai-search-embeddings",
"_id": "ajd5OowBHxQKHyc3TDSC",
"_score": 0.8345704,
"_source": {
"id": 820622,
"body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances."
}
},
{
"_index": "alibabacloud-ai-search-embeddings",
"_id": "Djd5OowBHxQKHyc3TDSC",
"_score": 0.8327426,
"_source": {
"id": 8202683,
"body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel."
}
},
(...)
]
Elasticsearch Python 클라이언트를 사용하는 대화형 Colab 노트북 형식의 튜토리얼도 있습니다: