Prefer Chinese company names in IPO reports

Request:
- Update the selected analyst reports so stock/company names include Chinese names and use Chinese names first.

Changes:
- Updated the selected T0 reports for 01392, 06067, 06106, and 06132 to show Chinese company names in the title and summary, with English names in parentheses.
- Added company_name_zh to the analyst dataset so report generation has access to Chinese names.
- Updated the report generator to prefer Chinese company names and fall back to English names only when Chinese names are unavailable.
- Filled Chinese company names for the selected tickers in ipo_master and refreshed snapshots.

Verification:
- Compiled build_analysis_dataset.py and generate_ipo_report.py.
- Ran generator dry-runs for 06132 and 01392 to confirm Chinese-first output.
- Ran SQLite integrity_check and foreign_key_check.
- Ran git diff --check.

Next useful context:
- Future generated analyst reports now use company_name_zh first when available.
This commit is contained in:
2026-06-15 15:11:15 +00:00
parent fcb795b583
commit 797bbde201
10 changed files with 327 additions and 313 deletions
+3
View File
@@ -310,6 +310,7 @@ def fetch_rows(conn: sqlite3.Connection) -> list[sqlite3.Row]:
SELECT
m.ticker,
m.company_name_en,
m.company_name_zh,
m.board,
m.status,
m.listing_date,
@@ -383,6 +384,7 @@ def build_records(rows: list[sqlite3.Row], as_of: str) -> list[dict[str, Any]]:
"analysis_as_of": as_of,
"ticker": row["ticker"],
"company_name_en": row["company_name_en"],
"company_name_zh": row["company_name_zh"],
"board": row["board"],
"status": row["status"],
"listing_date": row["listing_date"],
@@ -491,6 +493,7 @@ def write_dataset(records: list[dict[str, Any]], output_path: Path) -> None:
"analysis_as_of",
"ticker",
"company_name_en",
"company_name_zh",
"board",
"status",
"listing_date",
+13 -2
View File
@@ -150,6 +150,14 @@ def fmt_int(value: int | None) -> str:
return f"{value:,}"
def company_display_name(record: dict[str, str]) -> str:
chinese_name = record.get("company_name_zh") or ""
english_name = record.get("company_name_en") or ""
if chinese_name and english_name:
return f"{chinese_name}{english_name}"
return chinese_name or english_name or "未记录"
def parse_date(value: str) -> datetime | None:
if not value:
return None
@@ -407,14 +415,17 @@ def build_report(record: dict[str, str], rows: list[dict[str, str]], stage: str,
paths = source_paths(record, stage)
source_lines = [f"- `{path}`" for path in paths] or ["- 本阶段没有记录来源路径。"]
company_name = company_display_name(record)
title_name = record.get("company_name_zh") or record.get("company_name_en") or ""
title_prefix = f"{ticker} {title_name}" if title_name else ticker
lines = [
f"# {ticker} IPO 分析报告",
f"# {title_prefix} IPO 分析报告",
"",
"## 摘要",
"",
f"- 股票代码:`{ticker}`",
f"- 公司:{fmt_value(record['company_name_en'])}",
f"- 公司:{company_name}",
f"- 分析阶段:`{stage}`",
f"- 报告生成时间:`{as_of}`",
f"- 模型数据时间:`{dataset_as_of}`",