Elasticsearch:使用阿里云 AI 服务进行嵌入和重新排名

作者:来自 Elastic Tomás Murúa

将阿里云 AI 服务功能与 Elastic 结合使用。

更多阅读,请参阅 “Elasticsearch:使用阿里 infererence API 及 semantic text 进行向量搜索”。

在本文中,我们将介绍如何将阿里云 AI 功能与 Elasticsearch 集成,以提高语义搜索的相关性。

阿里云人工智能搜索是一种将高级人工智能功能与 Elasticsearch 工具相结合的解决方案,利用 Qwen LLM/DeepSeek-R1 系列提供高级推理和分类模型。在本文中,我们将使用同一作者撰写的小说和戏剧的描述来测试阿里巴巴重新排名和稀疏嵌入端点。

步骤

  1. 配置阿里云AI
  2. 创建 Elasticsearch 映射
  3. 将数据索引到 Elasticsearch 中
  4. 查询数据
  5. 奖励:完成回答问题

配置阿里云AI

阿里云 AI 重新排名和嵌入

开放推理阿里云(Open inference Alibaba Cloud)提供不同的服务。在此示例中,我们将使用阿加莎·克里斯蒂 (Agatha Christie) 的流行书籍和戏剧的描述来测试阿里云在语义搜索中的嵌入和重新排名端点。

阿里云 AI 重排名端点是一种语义重排名(semantic reranking)功能。这种重新排名使用机器学习模型根据搜索结果与查询的语义相似性对其进行重新排序。这使你可以在现有的全文搜索索引上使用开箱即用的语义搜索功能。

稀疏嵌入(sparse embedding)端点是一种大多数值为零的嵌入类型,使得相关信息更加突出。

获取阿里云 API Key

我们需要一个有效的 API 密钥来将阿里巴巴与 Elasticsearch 集成。要获取它,请按照下列步骤操作:

  • 从服务广场部分访问阿里云门户。
  • 转到左侧菜单 API Keys,如下所示。
  • 生成一个新的 API 密钥。

配置阿里巴巴端点

我们首先配置稀疏嵌入端点,将文本描述转换为语义向量:

嵌入端点

PUT _inference/sparse_embedding/alibabacloud_ai_search_sparse
{
    "service": "alibabacloud-ai-search",
    "service_settings": {
        "api_key": "<api_key>",
        "service_id": "ops-text-sparse-embedding-001",
        "host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
        "workspace": "default"
    }
}

然后我们将配置重新排序端点来重新组织结果。

重新排序端点

PUT _inference/rerank/alibabacloud_ai_search_rerank
{
    "service": "alibabacloud-ai-search",
    "service_settings": {
        "api_key": "<api_key>",
        "service_id": "ops-bge-reranker-larger",
        "host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
        "workspace": "default"
    }
}

现在端点已经配置完毕,我们可以准备 Elasticsearch 索引。

创建 Elasticsearch 映射

让我们配置映射。为此,我们需要组织带有描述的文本以及模型生成的向量。

我们将使用以下属性:

  • semantic_description:存储模型生成的嵌入并运行语义搜索。
  • description:我们将使用 “text” 类型来存储小说(novels)和戏剧(plays)的描述,并使用它们进行全文搜索。

我们将包含 copy_to 参数,以便文本和语义字段均可用于混合搜索:

PUT arts
{
  "mappings": {
    "properties": {
      "semantic_description": {
        "type": "semantic_text",
        "inference_id": "alibabacloud_ai_search_sparse"
      },
      "description": {
        "type": "text",
        "copy_to": "semantic_description"
      }
    }
  }
}

映射准备好后,我们现在可以索引数据。

将数据索引到 Elasticsearch 中

这是我们将在本示例中使用的包含描述的数据集。我们将使用 Elasticsearch Bulk API 对其进行索引。

POST arts/_bulk
{ "index": {} }
{ "description": " Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive." }
{ "index": {} }
{ "description": "The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020." }
{ "index": {} }
{ "description": "The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance." }
{ "index": {} }
{ "description": " Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later." }
{ "index": {} }
{ "description": " Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head." }
{ "index": {} }
{ "description": " The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today." }

请注意,前两篇文献《Black Coffee - 黑咖啡》和《The Mousetraps - 捕鼠器》是戏剧(plays),而其他的是小说(novels)。

查询数据

为了查看不同类型查询的结果,我们将依次运行不同的查询类型,首先进行语义查询,然后应用重新排序,最后结合两者。我们将使用相同的问题:"Which novel was written by Agatha Christie?"(阿加莎·克里斯蒂写了哪部小说?),期望获得三个明确提到 “novel” 的文档,以及一个包含 “book” 的文档。同时,两部戏剧(plays)应排在最后。

语义搜索

我们将开始查询 semantic_text 字段来询问:“Which novel was written by Agatha Christie?” 让我们看看会发生什么:

GET /arts/_search
{
  "_source": {
    "includes": [
      "description"
    ]
  },
  "query": {
    "semantic": {
      "field": "semantic_description",
      "query": "Which novel was written by Agatha Christie?"
    }
  }
}

响应是:

{
  "took": 1246,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 6,
      "relation": "eq"
    },
    "max_score": 0.1759066,
    "hits": [
      {
        "_index": "arts",
        "_id": "rdJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.1759066,
        "_source": {
          "description": " Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head."
        }
      },
      {
        "_index": "arts",
        "_id": "rNJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.17499167,
        "_source": {
          "description": " Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later."
        }
      },
      {
        "_index": "arts",
        "_id": "q9J4-ZMB36zj9EVTnMgJ",
        "_score": 0.16319725,
        "_source": {
          "description": "The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance."
        }
      },
      {
        "_index": "arts",
        "_id": "qtJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.15506727,
        "_source": {
          "description": "The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020."
        }
      },
      {
        "_index": "arts",
        "_id": "qdJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.14572844,
        "_source": {
          "description": " Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive."
        }
      },
      {
        "_index": "arts",
        "_id": "rtJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.13951442,
        "_source": {
          "description": " The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today."
        }
      }
    ]
  }
}

在这种情况下,响应优先考虑了大多数小说,但写着 “book” 的文档出现在最后。我们仍然可以通过重新排序来进一步优化结果。

通过重新排序优化结果

在这种情况下,我们将使用 _inference/rerank 请求来评估我们在第一个查询中获得的文档并提高它们在结果中的排名。

POST _inference/rerank/alibabacloud_ai_search_rerank
{
  "query": "Which novel was written by Agatha Christie?",
  "input": [
    "Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive.",
    "The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020.",
    " The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance.",
    " Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later.",
    " Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head.",
    " The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today."
  ]
}

响应是:

{
  "rerank": [
    {
      "index": 3,
      "relevance_score": 0.91086304
    },
    {
      "index": 4,
      "relevance_score": 0.8409133
    },
    {
      "index": 2,
      "relevance_score": 0.76838577
    },
    {
      "index": 5,
      "relevance_score": 0.2295352
    },
    {
      "index": 0,
      "relevance_score": 0.13846178
    },
    {
      "index": 1,
      "relevance_score": 0.06620602
    }
  ]
}

这里的回应表明,这两部剧现在都处于结果的底部。

语义搜索和重新排名端点相结合

使用检索器,我们将语义查询和重新排序合并到一个步骤中:

POST /arts/_search
{
  "_source": {
    "includes": ["description"]
  },
  "retriever": {
    "text_similarity_reranker": {
      "retriever": {
        "standard": {
          "query": {
            "semantic": {
              "field": "semantic_description",
              "query": "Which novel was written by Agatha Christie?"
            }
          }
        }
      },
      "field": "description",
      "rank_window_size": 10,
      "inference_id": "alibabacloud_ai_search_rerank",
      "inference_text": "Which novel was written by Agatha Christie?"
    }
  }
}

响应是:

  "took": 1568,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 6,
      "relation": "eq"
    },
    "max_score": 0.91086304,
    "hits": [
      {
        "_index": "arts",
        "_id": "rNJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.91086304,
        "_source": {
          "description": " Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later."
        }
      },
      {
        "_index": "arts",
        "_id": "rdJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.8409133,
        "_source": {
          "description": " Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head."
        }
      },
      {
        "_index": "arts",
        "_id": "q9J4-ZMB36zj9EVTnMgJ",
        "_score": 0.76838577,
        "_source": {
          "description": "The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance."
        }
      },
      {
        "_index": "arts",
        "_id": "rtJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.2295352,
        "_source": {
          "description": " The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today."
        }
      },
      {
        "_index": "arts",
        "_id": "qdJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.13846178,
        "_source": {
          "description": " Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive."
        }
      },
      {
        "_index": "arts",
        "_id": "qtJ4-ZMB36zj9EVTnMgJ",
        "_score": 0.06620602,
        "_source": {
          "description": "The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020."
        }
      }
    ]
  }
}

这里的结果与语义查询有所不同。我们可以看到,尽管文档中没有与 "novel" 完全匹配的内容,但包含 "book"(如 The Murder of Roger Ackroyd)的文档在排名中比第一次语义搜索时更靠前。此外,两部戏剧仍然排在最后,就像重新排序时一样。

奖励:使用 completion 来完成回答问题

通过嵌入和重新排名,我们可以满足搜索查询,但用户仍然会看到所有搜索结果而不是实际答案。

通过提供的示例,我们距离 RAG 实现只有一步之遥,我们可以将最佳结果 + 问题提供给 LLM 以获得正确答案。

幸运的是,阿里云AI服务还提供了一个 completion 端点服务,我们可以利用它来实现这一目的。

让我们创建端点

使用阿里 QWen 创建 Completion 终点:

PUT _inference/completion/alibabacloud_ai_search_completion
{
    "service": "alibabacloud-ai-search",
    "service_settings": {
        "host" : "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
        "api_key": "<api_key>",
        "service_id": "ops-qwen-turbo",
        "workspace" : "default"
    }
}

我们也可以使用 deepseek-r1 来创建:

PUT _inference/completion/alibabacloud_ai_search_completion_deepseek_r1
{
    "service": "alibabacloud-ai-search",
    "service_settings": {
        "host" : "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com",
        "api_key": "{{API_KEY}}",
        "service_id": "deepseek-r1",
        "workspace" : "default"
    }
}

现在,发送上一个查询的结果和问题:

使用阿里 QWen 来进行查询

POST _inference/completion/alibabacloud_ai_search_completion
{
  "input": """
    Answer the following question using the context provided:
    QUESTION: Which novel was written by Agatha Christie?
    CONTEXT:
    DOCUMENT1
    Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive.
    DOCUMENT2
    The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020.
    DOCUMENT3
    The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance.
    DOCUMENT4
    Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later.
    DOCUMENT5
    Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head."
    DOCUMENT6
    The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today.
    ANSWER:
    """
}

响应是:

{
  "completion": [
{
      "result": "Agatha Christie wrote several novels, including \"The Body in the Murder,\" \"Curtain: Poirot's Last Case,\" \"Death on the Nile,\" and \"The Murder of Roger Ackroyd.\""
    }
  ]
}

使用阿里 deepseek-r1 来进行查询

POST _inference/completion/alibabacloud_ai_search_completion_deepseek_r1?timeout=180s
{
  "input": "<|system|>
    你是一个机器人助手.</s>
    <|user|>
    CONTEXT:

    Black Coffee is a play by the British crime-fiction author Agatha Christie. In the play, a scientist discovers that someone in his household has stolen the formula for an explosive;
  
    The Mousetrap is a murder mystery play by Agatha Christie. The play opened in London's West End in 1952 and ran continuously until 16 March 2020;
  
    The Body in the Murder is a Miss Marple mystery novel published by Agatha Christie in 1942. The case involves the murder of two teenage girls who are similar in appearance;

    Agatha Christie's last published novel before she passed, Curtain: Poirot's Last Case is also her indelible detective's last appearance. Poirot and Hastings return to the very same house from The Mysterious Affairs at Styles over 30 years later;
    
    Death on the Nile is Agatha Christie's most daring travel mystery novel. The tranquillity of a cruise along the Nile is shattered by the discovery that Linnet Ridgeway has been shot through the head;

    The Murder of Roger Ackroyd was Agatha Christie’s first book to be published by William Collins in the spring of 1926. William Collins became part of HarperCollins and are still Christie’s publishers today;
    
    QUESTION: 
    Which novela were written by Agatha Christie?</s>
    <|assistant|>"
}

:由于 DeepSeek 的推理时间比较长,所以,我们把 timeout 参数设置为 180s。

推理的结果如下:

{
  "completion": [
    {
      "result": """<think>
Okay, let's see. The user is asking which novels were written by Agatha Christie based on the given context. First, I need to go through each item in the context and determine if it's a novel. The user mentioned "novela," which I think is Spanish for "novel," so they're asking about novels, not plays or other works.

Looking at the context entries one by one:

1. **Black Coffee** is described as a play by Christie. So that's a play, not a novel. Exclude.

2. **The Mousetrap** is a murder mystery play, opened in London's West End. Definitely a play, not a novel. Exclude.

3. **The Body in the Murder** is listed as a Miss Marple mystery novel published in 1942. Wait, the title here might be a bit off. Agatha Christie wrote a novel called "The Body in the Library," which is a Miss Marple story from 1942. Maybe the user made a typo. Assuming it's "The Body in the Library," then yes, that's a novel. But the title given is "The Body in the Murder," which I don't recall. Need to check if that's a real title or a mistake. However, since the context says it's a Miss Marple novel published in 1942, I'll proceed with that, even if the title is slightly wrong. So include as a novel.

4. **Curtain: Poirot's Last Case** is mentioned as her last published novel before she passed. So that's a novel. Include.

5. **Death on the Nile** is described as a travel mystery novel. That's a novel. Include.

6. **The Murder of Roger Ackroyd** was her first book published by William Collins. That's a novel. Include.

So the novels listed here are: The Body in the Murder (assuming typo), Curtain, Death on the Nile, and The Murder of Roger Ackroyd. However, "The Body in the Murder" might actually be "The Body in the Library," which is the correct title. But since the user provided that exact title, I should list it as given, even if there's an error. Alternatively, note the possible typo.

Also, check if there are other works mentioned. The other entries are plays. So the answer should list the four novels mentioned in the context, being careful with the title accuracy.
</think>

The novels written by Agatha Christie mentioned in the context are:  

1. **The Body in the Murder** (likely a typo for *The Body in the Library*, a Miss Marple novel published in 1942).  
2. **Curtain: Poirot's Last Case** (her final published novel featuring Hercule Poirot).  
3. **Death on the Nile** (a travel mystery novel set on a Nile cruise).  
4. **The Murder of Roger Ackroyd** (her breakthrough novel published in 1926).  

*Note*:  
- *Black Coffee* and *The Mousetrap* are plays, not novels.  
- If "The Body in the Murder" is intended to refer to *The Body in the Library*, the latter is the correct title of Christie's 1942 Miss Marple novel."""
    }
  ]
}

结论

将阿里云 AI 搜索与 Elasticsearch 集成,使我们能够轻松访问完成、嵌入和重新排名模型,并将其合并到我们的搜索管道中。

我们可以借助检索器单独或一起使用重新排序和嵌入端点。

我们还可以引入 completion 端点来完成 RAG 端到端实现。

想要获得 Elastic 认证吗?了解下一期 Elasticsearch 工程师培训何时举行!

Elasticsearch 包含许多新功能,可帮助你为你的用例构建最佳的搜索解决方案。深入了解我们的示例笔记本以了解更多信息,开始免费云试用,或立即在本地机器上试用 Elastic。

原文:Embeddings and reranking with Alibaba Cloud AI Service - Elasticsearch Labs

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/978781.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

面试问题——如何解决移动端1px 边框问题?

面试问题——如何解决移动端1px 边框问题&#xff1f; 最近&#xff0c;不少小伙伴向我反映&#xff0c;他们在面试中频繁被问到关于1px边框的问题。这个看似老生常谈的话题&#xff0c;没想到在面试中的出现率依然这么高&#xff0c;着实让我有些意外。对于那些对这个问题感到…

Redis的介绍、安装和配置

文章目录 一、redis官网二、redis是什么三、能干嘛 总体功能一图概述优势小总结 三、Redis的下载与安装 Redis的安装Redis迭代演化和Redis7新特性新特性部分说明Redis的安装 安装步骤总结 Redis的卸载 一、redis官网 https://redis.io/ 中文官网&#xff1a;http://www.red…

首次使用WordPress建站的经验分享(一)

之前用过几种内容管理系统(CMS),如:dedeCMS、phpCMS、aspCMS,主要是为了前端独立建站,达到预期的效果,还是需要一定的代码基础的,至少要有HTML、Css、Jquery基础。 据说WordPress 是全球最流行的内容管理系统CMS,从现在开始记录一下使用WordPress 独立建站的步骤 选购…

spring结合mybatis多租户实现单库分表

实现单库分表 思路&#xff1a;student表数据量大&#xff0c;所以将其进行分表处理。一共有三个分表&#xff0c;分别是student0&#xff0c;student1&#xff0c;student2&#xff0c;在新增数据的时候&#xff0c;根据请求头中的meta-tenant参数决定数据存在哪张表表。 数…

Spring Boot集成Spring Security之HTTP请求授权

一、HTTP请求授权工作原理 ​ 基于Spring Security最新的Http请求授权讲解&#xff0c;不再使用旧版的请求授权 授权过滤器AuthorizationFilter获取认证信息 调用RequestMatcherDelegatingAuthorizationManager的check方法验证该用户是否具有该请求的授权 RequestMatcherDele…

Docker搭建基于Rust语言的云原生可观测平台OpenObserve

文章目录 前言1. 安装Docker2. 创建并启动OpenObserve容器3. 本地访问测试4. 公网访问本地部署的OpenObserve4.1 内网穿透工具安装4.2 创建公网地址 5. 配置固定公网地址 前言 嘿&#xff0c;朋友们&#xff0c;今天我们要聊聊一个能让你在云原生世界里大展身手的秘密武器——…

批量给 Word 添加或设置页眉页脚/页码

在 Word 文档中我们可以设置各种各样的页眉页脚信息&#xff0c;比如设置页码信息、在页眉页脚中插入公司的 logo 信息、联系方式信息等等。当我们有大量的文档需要设置或者修改页眉页脚的时候&#xff0c;今天介绍的方法就可以帮我们快速的完成。 使用场景 批量给 Word 文档设…

安卓 SpannableString的使用 给文字末尾几个小尾巴

效果一&#xff1a; 效果二&#xff1a; 其实我们知道如果想实现效果一很简单&#xff0c;两个textview横向布局一下就可以了&#xff0c;但是如果想要是实现效果二怎么办呢。据我所知对于前端开发来说其实效果二也很简单&#xff0c;前端甚至可以轻松实现富文本&#xff0c;但…

opencv:距离变换 cv2.distanceTransform

函数 cv2.distanceTransform() 用于计算图像中每一个非零点像素与其最近的零点像素之间的距离&#xff08;Distance Transform&#xff0c; DT算法&#xff09;,输出的是保存每一个非零点与最近零点的距离信息&#xff1b;图像上越亮的点&#xff0c;代表了离零点的距离越远。 …

ArcGIS Pro中打造精美高程渲染图的全面指南

一、引言 高程渲染图是地理信息系统&#xff08;GIS&#xff09;中用于展示地形地貌的重要工具。一张精美的高程渲染图&#xff0c;不仅能够清晰地呈现地形的起伏变化&#xff0c;还能增强视觉表现力&#xff0c;使得数据更加生动、直观。ArcGIS Pro作为一款强大的GIS软件&…

[Python学习日记-84] 进程理论

[Python学习日记-84] 进程理论 简介 进程的概念 并发与并行的区别 进程并发的实现 简介 进程理论是计算机科学中一种重要的概念&#xff0c;用来描述操作系统中执行的程序实例。在操作系统中&#xff0c;每个程序的执行被称为一个进程。进程理论研究进程的创建、调度、通信…

信息系统的安全防护

文章目录 引言**1. 物理安全****2. 网络安全****3. 数据安全****4. 身份认证与访问控制****5. 应用安全****6. 日志与监控****7. 人员与管理制度****8. 其他安全措施****9. 安全防护框架**引言 从技术、管理和人员三个方面综合考虑,构建多层次、多维度的安全防护体系。 信息…

分布式主键生成服务

目录 一、使用线程安全的类——AtomicInteger或者AtomicLong 二、主键生成最简单写法(不推荐) 三、主键生成方法一&#xff1a;Long型id生成——雪花算法 四、主键生成方法二&#xff1a;流水号 (一)流水号概述 (二)添加配置 1.pom.xml 2.application.properties 3.创…

Linux 环境“从零”部署 MongoDB 6.0:mongosh 安装与数据操作全攻略

前提 完成linux平台部署MongoDB【部署教程】且完成mongosh的安装 由于本人使用的是6.0版本的MongoDB&#xff0c;新版本 MongoDB&#xff08;尤其是 6.0 及以上版本&#xff09;已经不再默认捆绑传统的 mongo shell&#xff0c;而改用新的 MongoDB Shell&#xff08;mongosh&am…

使用Docker将ros1自定义消息通过rosjava_bootstrap生成jar包

文章目录 预准备环境rosjava_bootstrap坏消息好消息 环境安装docker安装rosjava_bootstrap仓库rosjava_center仓库修改rosjava_bootstrap代码拉取docker镜像放置自己的自定义消息 启动docker编译 预准备环境 rosjava_bootstrap rosjava_bootstrap是将自定义的ROS消息生成java…

RNN,LSTM,GRU三种循环网络的对比

1. 三种网络在准确率的对比 2. 三种网络在损失值的对比 3. 三种网络在计算时间的对比 4. RNN&#xff08;传统循环神经网络&#xff09; 主要特点&#xff1a; RNN 是最基础的循环神经网络&#xff0c;通过 递归 计算每个时间步的输出。在每个时间步&#xff0c;RNN 会将当前…

hackmyvm-hero

信息收集 ┌──(root㉿kali)-[/home/kali/Desktop/hackmyvm] └─# arp-scan -I eth1 192.168.56.0/24 Interface: eth1, type: EN10MB, MAC: 00:0c:29:34:da:f5, IPv4: 192.168.56.103 Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan) 192…

纷析云:赋能企业财务数字化转型的开源解决方案

在企业数字化转型的浪潮中&#xff0c;财务管理的高效与安全成为关键。纷析云凭借其开源、安全、灵活的财务软件解决方案&#xff0c;为企业提供了一条理想的转型路径。 一、开源的力量&#xff1a;自主、安全、高效 纷析云的核心优势在于其100%开源的财务软件源码。这意味着…

异常c/c++

目录 1.c语言传统处理错误方式 1、终止程序 2、返回错误码 2.c异常概念 3.异常的使用 3.1异常的抛出与捕获 3.2异常安全&#xff08;还有一些异常重新抛出&#xff09; 3.3异常规范 4.自定义异常体系 5.c标准库的异常体系 6.异常优缺点 1、优点 2、缺点 7、补充 1.…

SAP-ABAP:使用ST05(SQL Trace)追踪结构字段来源的步骤

ST05 是 SAP 提供的 SQL 跟踪工具&#xff0c;可以记录程序运行期间所有数据库操作&#xff08;如 SELECT、UPDATE、INSERT&#xff09;。通过分析跟踪结果&#xff0c;可以精准定位程序中结构字段对应的数据库表。 步骤1&#xff1a;激活ST05跟踪 事务码 ST05 → 点击 Activa…