DeepSeekWorkPlanningAI score · 85/100AI-assisted edit · no obvious prompt-injection riskDeepSeek API Docs

Turn News into Structured JSON with DeepSeek

Paste news text → model extracts entity, time, and summary into a fixed JSON schema → output ready for parsing

BeginnerStepsPromptTip
Who
Users or developers who need to extract key information from unstructured text
You get
A standardized JSON with entity, time, and summary fields for downstream processing
You need
DeepSeek

Constraints

Prerequisites: access to DeepSeek chat or API. No additional tools or account permissions needed. Cost conditions unknown. Input is any news text; output is JSON with fixed fields. Note: the system prompt shows the field name "entiry", which appears to be a typo, but the official assistant example correctly uses "entity".

What they did

DeepSeek published a "Structured Output" template in its official API docs prompt library, demonstrating how to use a system prompt to constrain the model to convert news text into a fixed-field JSON.

How it went

In the official example, after inputting the SpaceX Falcon 9 launch news, the model produced JSON containing entity, time, and summary fields, with the time formatted as YYYY-mm-dd HH:MM:SS as required (author_report / official_demo).

Worth knowing

1. The system prompt spells the field name "entiry", but the official assistant example correctly uses "entity"; verify field names in actual use. 2. The source only demonstrates news text; effectiveness on other text types (e.g., financial reports, chat logs) is unverified. 3. It is unclear whether API JSON mode / response_format parameters are required. 4. Cost and rate limits are unknown.

Steps

  1. Set the system prompt

    In the DeepSeek conversation, paste the following system prompt into the system / role setting field (or API system message). This prompt defines the JSON output format.

    Execution prompt · Source text。DeepSeek system / role field

    用户将提供给你一段新闻内容,请你分析新闻内容,并提取其中的关键信息,以 JSON 的形式输出,输出的 JSON 需遵守以下的格式:
    
    {
      "entiry": <新闻实体>,
      "time": <新闻时间,格式为 YYYY-mm-dd HH:MM:SS,没有请填 null>,
      "summary": <新闻内容总结>
    }
  2. Send the news text

    Paste the full news article into the user message. Below is the complete example provided by the source.

    Execution prompt · Source text。DeepSeek user input field

    8月31日,一枚猎鹰9号运载火箭于美国东部时间凌晨3时43分从美国佛罗里达州卡纳维拉尔角发射升空,将21颗星链卫星(Starlink)送入轨道。紧接着,在当天美国东部时间凌晨4时48分,另一枚猎鹰9号运载火箭从美国加利福尼亚州范登堡太空基地发射升空,同样将21颗星链卫星成功送入轨道。两次发射间隔65分钟创猎鹰9号运载火箭最短发射间隔纪录。
    
    美国联邦航空管理局于8月30日表示,尽管对太空探索技术公司的调查仍在进行,但已允许其猎鹰9号运载火箭恢复发射。目前,双方并未透露8月28日助推器着陆失败事故的详细信息。尽管发射已恢复,但原计划进行五天太空活动的“北极星黎明”(Polaris Dawn)任务却被推迟。美国太空探索技术公司为该任务正在积极筹备,等待美国联邦航空管理局的最终批准后尽快进行发射。
  3. Receive and parse the JSON output

    The model will return JSON wrapped in a Markdown code block. Copy the JSON content for downstream parsing. The official example output is shown in the source.

Prompt you can copy

Execution prompt · Source text。DeepSeek system / role field; replace with your news text before sending

This block is the prompt. Ads are never placed here.

用户将提供给你一段新闻内容,请你分析新闻内容,并提取其中的关键信息,以 JSON 的形式输出,输出的 JSON 需遵守以下的格式:

{
  "entiry": <新闻实体>,
  "time": <新闻时间,格式为 YYYY-mm-dd HH:MM:SS,没有请填 null>,
  "summary": <新闻内容总结>
}

Copy the system prompt into the system setting, then send your news text.

Source

DeepSeek 官方提示词:把文本整理成结构化 JSON 输出 · DeepSeek · DeepSeek API Docs · 2026-04-17T05:05:00Z

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related