轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥8起我的订单
文档
工具
提交工单页面收录
linto-platform-nlp-keyphrase-extraction

lintoai/linto-platform-nlp-keyphrase-extraction

lintoai

基于linto-platform-nlp-core构建的LinTO NLP关键词提取服务,支持REST API和Celery任务模式,可独立部署或集成到LinTO stack,采用spaCy组件化设计,支持GPU/CPU加速,用于从文本中提取关键短语。

下载次数: 0状态:社区镜像维护者:lintoai仓库类型:镜像最近更新:3 年前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

中文简介
下载命令
镜像标签列表与下载命令
轩辕镜像,让镜像更快,让人生更轻。
点击查看

linto-platform-nlp-keyphrase-extraction

镜像概述

本镜像用于构建LinTO的NLP服务:关键词提取(Keyphrase Extraction),基于https://github.com/linto-ai/linto-platform-nlp-core开发。可与https://github.com/linto-ai/linto-platform-stack一起部署,也可独立部署(详见下文开发部分)。

LinTO的NLP服务采用spaCy的核心设计理念:组件与管道。组件(位于components/目录下)与服务解耦,可轻松复用至其他spaCy项目,组件通过管道组织以实现特定NLP任务。

本服务支持两种启动方式:REST API和Celery任务,且均支持GPU与CPU模式。

核心功能与特性

  • 多部署模式:支持REST API(HTTP)和Celery任务两种服务模式
  • 硬件支持:兼容GPU加速(需安装NVIDIA Container Toolkit)和纯CPU运行
  • 多语言支持:默认支持法语(fr)和英语(en),可通过配置扩展
  • 组件化设计:基于spaCy的组件-管道架构,组件可独立复用
  • 可配置性:支持通过环境变量和API请求参数自定义提取参数

使用场景

  • 文本内容分析与摘要生成
  • 信息检索系统中的关键词提取
  • 文档自动标引与分类
  • NLP处理管道中的关键短语提取环节
  • 需要批量或异步处理的关键词提取任务(Celery模式)

使用方法

环境准备

  1. 安装依赖工具
    确保已安装:

    • Docker及Docker Compose
    • https://git-lfs.github.com/(用于下载模型文件)
    • 若使用GPU模式,需安装https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian及GPU驱动
  2. 下载模型文件
    将模型文件下载至主机的./assets目录(可自定义路径):

    bash
    cd linto-platform-nlp-keyphrase-extraction/
    bash scripts/download_models.sh
    
  3. 配置环境变量
    复制默认环境变量配置并修改:

    bash
    cp .envdefault .env
    
    环境变量描述默认值
    APP_LANG应用支持的语言列表(空格分隔)fr en
    ASSETS_PATH_ON_HOST主机上资产文件夹路径./assets
    ASSETS_PATH_IN_CONTAINER容器内模型文件挂载路径/app/assets
    LM_MAP语言与对应模型的JSON映射字符串{"fr":"sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2","en":"sentence-transformers/all-MiniLM-L6-v2"}
    SERVICE_MODE服务模式,可选"http"(REST API)或"task"(Celery任务)"http"
    CONCURRENCY最大并发请求数1
    USE_GPU是否使用GPU,可选"True"或"False"True
    SERVICE_NAME微服务名称kpe
    SERVICES_BROKER微服务通信的 broker 服务器URL"redis://localhost:6379"
    BROKER_PASSbroker服务器访问密码None

构建镜像

使用Docker命令构建:

bash
sudo docker build --tag lintoai/linto-platform-nlp-keyphrase-extraction:latest .

或使用Docker Compose构建:

bash
sudo docker-compose build

运行容器

GPU模式

bash
sudo docker run --gpus all \
--rm -p 80:80 \
-v $PWD/assets:/app/assets:ro \
--env-file .env \
lintoai/linto-platform-nlp-keyphrase-extraction:latest

CPU模式

CPU模式配置
  • 移除命令中的--gpus all参数
  • 在.env文件中设置USE_GPU=False

或使用Docker Compose运行:

bash
sudo docker-compose up
Docker Compose CPU模式配置
  • 从docker-compose.yml中移除runtime: nvidia配置
  • 在.env文件中设置USE_GPU=False

API使用说明

当SERVICE_MODE=http时,服务启动后可通过http://localhost/docs或http://localhost/redoc访问交互式API文档。

支持的语言与模型

语言代码({lang})模型大小
enhttps://huggingface.co/sentence-transformers/all-MiniLM-L6-v280 MB
frhttps://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2418 MB

API端点

http://localhost/kpe/{lang},其中{lang}为语言代码(如en或fr)。

请求示例

json
{
  "articles": [
    {
      "text": "Apple Inc. is an American multinational technology company that specializes in consumer electronics, computer software and online services."
    },
    {
      "text": "Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data. As a result, unsupervised learning algorithms must first self-discover any naturally occurring patterns in that training data set."
    }
  ]
}

响应示例

json
{
  "kpe": [
    {
      "text": "Apple Inc. is an American multinational technology company that specializes in consumer electronics, computer software and online services.",
      "keyphrases": [
        {
          "text": "apple",
          "score": 0.6539
        },
        {
          "text": "inc",
          "score": 0.3941
        },
        {
          "text": "company",
          "score": 0.2985
        },
        {
          "text": "multinational",
          "score": 0.2635
        },
        {
          "text": "electronics",
          "score": 0.2143
        }
      ]
    },
    {
      "text": "Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data. As a result, unsupervised learning algorithms must first self-discover any naturally occurring patterns in that training data set.",
      "keyphrases": [
        {
          "text": "unsupervised",
          "score": 0.6663
        },
        {
          "text": "learning",
          "score": 0.3155
        },
        {
          "text": "algorithms",
          "score": 0.3128
        },
        {
          "text": "algorithm",
          "score": 0.2494
        },
        {
          "text": "patterns",
          "score": 0.2476
        }
      ]
    }
  ]
}

组件配置

本服务基于https://github.com/MaartenGr/KeyBERT封装,支持以下配置参数:

参数类型默认值描述
candidatesList[str]null用于提取的候选关键词/关键短语列表,而非从文档中提取
diversityFloat0.5当use_mmr=True时,结果的多样性(0-1之间)
keyphrase_ngram_rangeTuple[int, int][1,1]提取的关键词/关键短语的词长范围
min_dfint1当提取多个文档的关键词时,词在所有文档中的最小出现频率
nr_candidatesint20当use_maxsum=True时,考虑的候选词数量
seed_keywordsList[str]null引导关键词提取的种子词,通过调整相似度引导提取方向
stop_wordsUnion[str, List[str]]null需从文档中移除的停用词
top_nint5返回的top N关键词/关键短语数量
use_maxsumboolfalse是否使用最大和相似度选择关键词/关键短语
use_mmrboolfalse是否使用最大边际相关性(MMR)选择关键词/关键短语

运行时配置示例

可在API请求中通过component_cfg参数自定义配置:

json
{
  "articles": [
    {
      "text": "Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data."
    }
  ],
  "component_cfg": {
    "kpe": {"keyphrase_ngram_range": [2,2], "top_n": 1}
  }
}

响应:

json
{
  "kpe": [
    {
      "text": "Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data.",
      "keyphrases": [
        {
          "text": "unsupervised learning",
          "score": 0.7252
        }
      ]
    }
  ]
}

Celery任务模式测试

环境准备

  1. 本地安装Redis并启动:

    bash
    redis-server --protected-mode no --bind 0.0.0.0 --loglevel debug
    
  2. 配置.env文件:

    • 设置SERVICE_MODE=task
    • 设置SERVICES_BROKER=redis://172.17.0.1:6379(172.17.0.1为Docker默认网关)
  3. 启动容器(使用上述docker run或docker-compose up命令)

测试脚本

在本地运行以下Python脚本调用Celery任务:

python
from docker.xuanyuan.run/celery import Celery
celery = Celery(broker='redis://localhost:6379/0', backend='redis://localhost:6379/1')
r = celery.send_task(
    'kpe_task', 
    (
        'en', 
        [
            "Apple Inc. is an American multinational technology company that specializes in consumer electronics, computer software and online services.",
            "Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data."
        ],
        {"kpe": {"top_n": 3}}
    ),
    queue='kpe')
print(r.get())

高级用法

关于最大和相似度(Max Sum Similarity)、最大边际相关性(MMR)等用于多样化提取结果的高级功能,可参考https://maartengr.github.io/KeyBERT/guides/quickstart.html#usage和技术文章了解详细原理。

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 linto-platform-nlp-keyphrase-extraction 镜像标签

docker pull docker.xuanyuan.run/lintoai/linto-platform-nlp-keyphrase-extraction:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull lintoai/linto-platform-nlp-keyphrase-extraction:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

爱快 4.0 · iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

专属域名用法

专属域名 · 开启停用 · 多仓库

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

docker.sock / daemon

账号

失败是否计费

manifest · blob · 计费

申请开票(企业 / 个人)

开票 · 发票 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
lintoai/linto-platform-nlp-keyphrase-extraction
定价查看流量套餐与价格
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥8/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 linto-platform-nlp-keyphrase-extraction 镜像推荐

lintoai/linto-platform-stt logo

lintoai/linto-platform-stt

lintoai
LinTO-platform-stt是LinTO栈中的转录服务,可作为独立转录服务使用或在微服务架构中通过消息代理连接器部署,支持LinTO和Vosk模型,提供HTTP、任务和WebSocket三种服务模式,满足音频转录需求。
10万+ 次下载
2 年前更新
lintoai/linto-platform-admin logo

lintoai/linto-platform-admin

lintoai
LinTO平台的主要Web界面,作为LinTO客户端(语音应用或设备)的中央管理器,用于创建和管理工作流、安装技能、监控设备及编辑训练NLU模型等。
10万+ 次下载
4 年前更新
lintoai/linto-platform-nlp-core logo

lintoai/linto-platform-nlp-core

lintoai
linto-platform-nlp-core是一个核心Docker镜像,包含所有LinTO NLP服务(如命名实体识别、关键词提取、抽取式摘要、主题建模)的通用依赖。
5万+ 次下载
3 年前更新
lintoai/linto-platform-stt-standalone-worker logo

lintoai/linto-platform-stt-standalone-worker

lintoai
语音转文本独立工作器,通过HTTP API处理WAV音频文件的Docker镜像。
5 次收藏50万+ 次下载
4 年前更新
lintoai/linto-platform-nlp-keyword-extraction logo

lintoai/linto-platform-nlp-keyword-extraction

lintoai
基于linto-platform-nlp-core的LinTO NLP关键词提取服务,支持通过HTTP API独立部署或作为微服务连接消息代理(RabbitMQ、Redis、Amazon SQS),提供文本关键词提取功能,适用于文本分析场景。
1万+ 次下载
4 年前更新
lintoai/linto-platform-overwatch logo

lintoai/linto-platform-overwatch

lintoai
LinTO平台的核心服务,作为LinTO客户端群的MQTT全局订阅者,负责将所有事件注册到持久存储,并支持多种认证系统。
10万+ 次下载
4 年前更新

查看更多 linto-platform-nlp-keyphrase-extraction 相关镜像