用 Azure AI Content Understanding 把非结构化文件变成结构化数据

一句话概览 Azure AI Content Understanding 是微软在 Ignite 2024 发布的多模态内容理解服务,可把文档、图片、音频、视频中的信息按你定义的 schema 提取成结构化结果,适合做自动化流程和多模态 RAG 的数据加工。 前提与限制(先看这两点) 需要在支持的区域创建资源。我实践时可用区域包括 West US、Sweden Central、Australia East。官方文档也说明预览 API 的区域支持有限,具体以最新列表为准。 语言支持在不同模态上有差异。我体验时文档/图片主要以英文为主,音频/视频支持多语言;官方语言支持列表也提示以 OCR/语音转写的具体支持为准。 最小流程(精简版) 1) 建资源并连到 Foundry 在支持区域创建 Azure AI services multi-services 资源。 在 Azure AI Foundry 的管理中心添加该资源连接。 2) 创建 Content Understanding 项目 进入 Content Understanding 控制台,创建项目并选择 Blob Storage。完成后可在 Foundry 项目列表中管理。 3) 设计 Analyzer(核心价值) 上传样本文档,选择模板(例如 PDF 只能用 Document analysis)。 自定义字段名、说明、类型与抽取方式;系统会利用预训练模型 + 生成式能力做字段映射。 通过 Test analyzer 验证结果,达标后 Build。 4) 用 REST API 集成业务系统 调用 analyzers/{id}:analyze 发起分析,会返回 202 并在 Operation-Location 给出结果地址(异步)。 之后用结果 ID 拉取 JSON,结构化字段在 fields 里。 详细的API可以参考如下链接,如果需要,我后续会再写一篇文章详细介绍。 https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/quickstart/use-rest-api?tabs=portal%2Cdocument 典型能力速览(文章中的实测方向) 文档:无明确 Key 的人名、无表头表格、列表结构、重复项表格都能通过 schema 进行抽取。 图片:支持 Document analysis / Image analysis / Defect detection / Retail inventory management 等模板。 音频:语音转写、对话摘要、通话分析(情绪等)。 视频:分镜分析、媒体资产管理、广告分析,可按自定义字段输出结构化结果。 适合用在哪里 批量票据、合同、表单抽取 多模态 RAG 的数据清洗与结构化 音频/视频内容的可搜索化和资产管理 小结 这套流程的价值在于:把“非结构化内容”变成“可编排的结构化字段”。如果你正在做自动化流程、内容检索或 RAG,Content Understanding 是一条很直的路径。 ...

在 Linux 上无 sudo 运行 Docker:添加用户到 docker 组

总是 sudo docker ... 很烦?原因是当前用户不在 Docker 预期的用户组里。按下面的步骤操作,一次配置,之后就能直接运行 Docker。 为什么需要 docker 组 Docker 守护进程运行在 root 权限,出于安全默认只允许 docker 组的用户访问 Unix socket。 如果用户不在 docker 组,就会提示权限不足,只能临时用 sudo。 配置步骤 确认 docker 组存在(大多数发行版安装 Docker 时会自动创建): sudo groupadd docker 已有同名组会提示已存在,忽略即可。 将当前用户加入 docker 组: sudo usermod -aG docker $USER 刷新组信息(无需重启): newgrp docker 如果想更彻底,可重新登录或重启终端/桌面会话。 验证 docker run hello-world 能正常拉取并输出欢迎信息,说明已生效。 常见问题与提示 权限仍不足:确认当前终端已重新登录或执行过 newgrp docker,并用 id 检查 docker 组是否列出。 安全注意:把用户加入 docker 组等同授予 root 权限,请仅在可信环境操作;服务器上要限制登录账户。 WSL/云主机:WSL 需开启 systemd 或使用官方 Docker Desktop;云主机要记得开放所需镜像仓库访问并做好防火墙配置。 按上述步骤设置后,日常直接运行 docker ... 即可,无需再加 sudo。 ...

在 Mac 上配置 GitHub SSH 密钥:一步到位

需要在 Mac 上通过 SSH 访问 GitHub?下面这份笔记把生成密钥、添加公钥、配置多账号、测试连通性等步骤压缩在一篇里,按顺序操作即可。 1) 生成 SSH 密钥 ssh-keygen -t ed25519 -C "your_personal_email@example.com" 推荐 ED25519,安全性足够且生成速度快。 默认保存到 ~/.ssh/id_ed25519;如需区分用途,可改名为 id_rsa_personal 等。 2) 把密钥交给 ssh-agent eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 如果你给私钥加了密码,ssh-agent 会帮你缓存解密后的会话,避免频繁输入。 3) 在 GitHub 添加公钥 pbcopy < ~/.ssh/id_ed25519.pub 进入 GitHub 网页:Settings → SSH and GPG keys → New SSH key。 粘贴公钥并保存。 4) 配置 ~/.ssh/config(支持多账号) nano ~/.ssh/config 示例配置: # 个人账号 Host personal HostName github.com User git IdentityFile ~/.ssh/id_ed25519 # 公司账号 Host work HostName github.com User git IdentityFile ~/.ssh/id_rsa_work 克隆时对应使用 git@personal:owner/repo.git 或 git@work:owner/repo.git。 如果遇到“权限过高”报错,执行 chmod 600 ~/.ssh/id_ed25519。 5) 测试连接 ssh -T git@github.com 出现 “Hi xxx! You’ve successfully authenticated…” 即表示连通正常;如提示 host key 变更,确认无 MITM 风险后按提示处理。 ...

比 Postman 更清爽的 API 客户端:Paw

最近在找Mac OS下 Postman 的替代,发现 Paw 更轻量、界面简洁,体验不错,记录一下下载入口和使用亮点。 下载入口 官方网站: https://paw.cloud/ macOS App(原生应用,交互流畅)。 为什么喜欢 Paw 原生界面清爽,启动快,调试时视觉干扰少。 支持 REST 与 GraphQL,请求编辑器直接高亮/自动补全。 环境变量和动态值(如时间戳、哈希签名)配置简单。 内置响应预览与格式化,方便看 JSON/HTML。 团队协作可选同步与分享(需账号),个人单机使用也流畅。 常用场景 本地接口联调:快速构造请求、切环境、带鉴权头。 调试第三方 API:保存请求模板,避免重复拼装。 回归测试:跑一遍关键接口并查看返回差异。 如果你觉得 Postman 过重或界面杂乱,不妨试试 Paw,当作更干净的小巧替代。

如何将 Python 脚本部署到 Azure Container Apps Job

前言 最近在项目里需要把一个 Python 脚本放到 Azure Container Apps (ACA) 的 Job 中定时/按需运行,整理了一套最小示例,方便之后复用。 前提条件 已创建 Azure Container Registry (ACR),并确认所在的 resource group、位置。 已安装 Docker 与 Azure CLI,且可登录对应 Azure 订阅(具备推送镜像、创建 ACA Job 的权限)。 已准备好要运行的 Azure resource group(示例命令里用 RESOURCE_GROUP 占位)。 步骤 1. 准备程序 示例脚本会读取环境变量并打印日志,适合作为健康检查或批处理任务的模板。 main.py import logging import os import time logging.basicConfig( level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s", ) def main(): job_name = os.getenv("JOB_NAME", "demo-job") sleep_seconds = int(os.getenv("SLEEP_SECONDS", "5")) logging.info("Job %s started", job_name) for i in range(sleep_seconds): logging.info("Running step %s/%s", i + 1, sleep_seconds) time.sleep(1) logging.info("Job %s completed", job_name) if __name__ == "__main__": main() Dockerfile ...

Install Langfuse on Your Local Device

Why I run Langfuse locally Langfuse helps me see prompt + completion tokens, latency, and traces for LLM calls. The hosted version is great, but for experiments I prefer local: No data leaves my machine I can pin versions and test breaking changes safely Faster iterations because logs and DB are local Homepage: langfuse.com Prereqs Docker + Docker Compose Git ~2 GB free RAM for the Postgres + app containers Step-by-step: bring up Langfuse Clone the repo git clone https://github.com/langfuse/langfuse.git cd langfuse Set env vars (example .env) POSTGRES_PASSWORD=langfuse LANGFUSE_INIT_USER_EMAIL=me@example.com LANGFUSE_INIT_USER_PASSWORD=changeme Use throwaway values locally; swap to strong secrets in real deployments. ...

Samolink Handy Tools

Faster Linker: Turn Page Data into Instant Shortcuts

Why Faster Linker Exists Copying a case number from your ticket queue, pasting it into the CRM, then repeating the routine for log viewers or onboarding docs is a guaranteed focus killer. Faster Linker turns that tedious workflow into a single click. Configure it once, and the extension watches the current page for the bits of information you care about, wraps them into reusable templates, and offers them as buttons in the popup. ...

Samolink Handy Tools

My Public IP

🌐 My Public IP – Chrome Extension Tired of typing “What is my IP” into search engines? **My Public IP ** is a lightweight Chrome extension that instantly displays your public IPv4 address in a beautiful popup — with a one-click copy button! ✨ Features ✅ Instantly fetches your IPv4 address 📋 One-click copy to clipboard 🧼 Minimalist and clean interface 🚀 Lightweight & fast 🔒 No data collected or stored 📥 Installation Get the extension from the Chrome Web Store: ...

Samolink Handy Tools

Japanese Era Converter

🗓️ Japanese Era Converter Effortlessly convert Western (Gregorian) calendar years into their corresponding Japanese era names and imperial years. ✨ Features 🏯 Input any year from 645 AD to the present 📅 Get the Japanese era name (e.g. Reiwa, Heisei, Showa) 📆 Displays the year in the era (e.g. Reiwa 7) 👑 Shows the reigning Emperor of the time 🧪 Example Input: 2025 Output: Reiwa 7 (令和7年), Emperor: Naruhito (今上天皇) 🎌 Why Use This Tool? Understanding Japanese historical dates is essential for: ...

Samolink Handy Tools

Password Generator

🔐 Password Generator – Chrome Extension Create strong, secure passwords instantly — right from your browser. ⚡ What It Does The Password Generator Chrome Extension lets you generate highly secure, random passwords with a single click. It’s perfect for anyone who values online security and wants a quick, reliable way to create passwords without opening a separate app or website. 🧰 Features ✅ One-click password creation 🔧 Customizable length (1–50 characters) 🆎 Character options: Uppercase (A–Z) Lowercase (a–z) Numbers (0–9) Symbols (!@#$) 📋 Copy-to-clipboard support 🌐 Runs directly in your browser toolbar 🚀 How to Use Click the extension icon in your Chrome toolbar. Adjust the password length and character types to your liking. Hit “Generate Password.” Click Copy to copy the password to your clipboard. Use it when signing up for services, updating credentials, or anytime you need a strong password on the fly. ...