{"id":31042,"date":"2026-05-01T08:42:51","date_gmt":"2026-05-01T00:42:51","guid":{"rendered":"http:\/\/139.9.1.231\/?p=31042"},"modified":"2026-05-01T08:42:53","modified_gmt":"2026-05-01T00:42:53","slug":"homophone-repl","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2026\/05\/01\/homophone-repl\/","title":{"rendered":"\u4e2d\u6587\u540c\u97f3\u5b57\u66ff\u6362ASR\u7ea0\u9519\u7cfb\u7edf\u6280\u672f\u5b9e\u73b0"},"content":{"rendered":"\n<p><strong><a href=\"https:\/\/mp.weixin.qq.com\/s\/-ogLq6RIYFF4kN5yQsExwA\" data-type=\"URL\" data-id=\"https:\/\/mp.weixin.qq.com\/s\/-ogLq6RIYFF4kN5yQsExwA\">\u539f\u521b\uff1a\u667a\u58f0\u5de5\u574a<\/a><\/strong><\/p>\n\n\n\n<p><a href=\" https:\/\/github.com\/xinliu9451\/homophone-repla \"> <em>https:\/\/github.com\/xinliu9451\/homophone-repla<\/em> <\/a><\/p>\n\n\n\n<h2>1. \u6280\u672f\u6982\u8ff0 (Technical Overview)<\/h2>\n\n\n\n<p>\u672c\u7cfb\u7edf\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\u4e2d\u6587\u540c\u97f3\u5b57\/\u8bcd\u7ea0\u9519\u5f15\u64ce\uff0c\u65e8\u5728\u89e3\u51b3\u4e2d\u6587\u8bed\u97f3\u8bc6\u522b\uff08ASR\uff09\u540e\u5904\u7406\u6216\u6587\u672c\u8f93\u5165\u4e2d\u5e38\u89c1\u7684\u540c\u97f3\u5b57\u9519\u8bef\u95ee\u9898\u3002\u7cfb\u7edf\u91c7\u7528&nbsp;<strong>\u79bb\u7ebf\u6a21\u578b\u6784\u5efa<\/strong>&nbsp;\u4e0e&nbsp;<strong>\u5728\u7ebf\u5b9e\u65f6\u63a8\u7406<\/strong>&nbsp;\u76f8\u7ed3\u5408\u7684\u67b6\u6784\uff0c\u5229\u7528&nbsp;<strong>\u6709\u9650\u72b6\u6001\u8f6c\u6362\u5668 (FST)<\/strong>&nbsp;\u6280\u672f\u5b9e\u73b0\u5927\u89c4\u6a21\u89c4\u5219\u7684\u9ad8\u6548\u5339\u914d\u4e0e\u66ff\u6362\u3002<\/p>\n\n\n\n<h3>1.1 \u6838\u5fc3\u6280\u672f\u6808 (Technology Stack)<\/h3>\n\n\n\n<ul><li><strong>\u6784\u5efa\u7aef (Build Time)<\/strong>:<ul><li><strong>Python<\/strong>: \u811a\u672c\u8bed\u8a00\uff0c\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u6a21\u578b\u751f\u6210\u3002<\/li><li><strong>Pynini<\/strong>: Google \u5f00\u53d1\u7684 Python \u5e93\uff0c\u7528\u4e8e\u6784\u5efa\u3001\u64cd\u4f5c\u548c\u4f18\u5316\u6709\u9650\u72b6\u6001\u673a\uff08FST\uff09\u3002\u5b83\u57fa\u4e8e OpenFST \u5e93\uff0c\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u7684 Python \u63a5\u53e3\u6765\u5b9a\u4e49\u8bed\u6cd5\u89c4\u5219\u3002<\/li><\/ul><\/li><li><strong>\u8fd0\u884c\u7aef (Runtime)<\/strong><ul><li><strong>C++<\/strong>: \u6838\u5fc3\u5f15\u64ce\u5f00\u53d1\u8bed\u8a00\uff0c\u4fdd\u8bc1\u9ad8\u6027\u80fd\u548c\u4f4e\u5ef6\u8fdf\u3002<strong><\/strong><\/li><\/ul><\/li><li><strong>CppJieba<\/strong>: \u7ed3\u5df4\u5206\u8bcd\u7684 C++ \u7248\u672c\uff0c\u63d0\u4f9b\u9ad8\u6548\u7684\u4e2d\u6587\u5206\u8bcd\u548c\u8bcd\u6027\u6807\u6ce8\u529f\u80fd\u3002<strong><\/strong><\/li><li><strong>KaldiFST (kaldifst)<\/strong>: Kaldi \u8bed\u97f3\u8bc6\u522b\u5de5\u5177\u5305\u4e2d\u7684 FST \u5904\u7406\u7ec4\u4ef6\uff08\u63d0\u53d6\u7248\uff09\uff0c\u7528\u4e8e\u5728 C++ \u73af\u5883\u4e0b\u52a0\u8f7d\u548c\u6267\u884c OpenFST \u6a21\u578b\u3002<strong><\/strong><\/li><li><strong>CMake<\/strong>: \u8de8\u5e73\u53f0\u6784\u5efa\u7cfb\u7edf\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2>2. \u6838\u5fc3\u6280\u672f\u6d41\u7a0b\u4e0e\u5b9e\u73b0\u7ec6\u8282 (Implementation Details)<\/h2>\n\n\n\n<p>\u7cfb\u7edf\u7684\u5b9e\u73b0\u5206\u4e3a\u4e24\u4e2a\u4e3b\u8981\u9636\u6bb5\uff1a<strong>\u79bb\u7ebf FST \u7ea0\u9519\u6a21\u578b\u751f\u6210<\/strong>&nbsp;\u548c&nbsp;<strong>\u5728\u7ebf\u7ea0\u9519\u63a8\u7406<\/strong>\u3002<\/p>\n\n\n\n<h3>2.1 \u9636\u6bb5\u4e00\uff1a\u79bb\u7ebf FST \u7ea0\u9519\u6a21\u578b\u751f\u6210 (Offline Model Generation)<\/h3>\n\n\n\n<p>\u8be5\u9636\u6bb5\u7684\u76ee\u6807\u662f\u5c06\u4eba\u5de5\u7ef4\u62a4\u7684\u201c\u62fc\u97f3-\u6c49\u5b57\u201d\u66ff\u6362\u89c4\u5219\u7f16\u8bd1\u6210\u4e00\u4e2a\u9ad8\u6548\u7684\u4e8c\u8fdb\u5236 FST \u6587\u4ef6 (<code>replace.fst<\/code>)\u3002<\/p>\n\n\n\n<h3>2.1.1 \u89c4\u5219\u5b9a\u4e49\u4e0e\u6784\u5efa<\/h3>\n\n\n\n<p><strong>\u4ee3\u7801\u4f4d\u7f6e<\/strong>:&nbsp;<code>homophone-replacer\/make_replace\/main.py<\/code><\/p>\n\n\n\n<p><strong>\u5b9e\u73b0\u6b65\u9aa4<\/strong>:<\/p>\n\n\n\n<p>1.<strong>\u5f15\u5165\u5e93<\/strong>: \u4f7f\u7528\u00a0<code>pynini<\/code>\u00a0\u5e93\uff0c\u5b83\u662f\u751f\u6210 FST \u7684\u6838\u5fc3\u5de5\u5177\u3002<\/p>\n\n\n\n<p>2.<strong>\u5b9a\u4e49\u5b57\u7b26\u96c6 (Sigma)<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \u5b9a\u4e49\u5168\u96c6\uff0cutf8.VALID_UTF8_CHAR.star \u8868\u793a\u4efb\u610f\u5408\u6cd5\u7684 UTF-8 \u5b57\u7b26\u4e32\u5e8f\u5217<\/code><code>sigma = utf8.VALID_UTF8_CHAR.star<\/code><\/pre>\n\n\n\n<p>\u8fd9\u662f FST \u4e2d\u7684\u201c\u901a\u914d\u7b26\u201d\u6982\u5ff5\uff0c\u7528\u4e8e\u5904\u7406\u90a3\u4e9b\u4e0d\u9700\u8981\u66ff\u6362\u7684\u80cc\u666f\u6587\u672c\u3002\u00a0 \u00a0 \u00a0<\/p>\n\n\n\n<p>3. \u6784\u5efa\u66ff\u6362\u89c4\u5219 (Cross Products):\u00a0\u00a0<\/p>\n\n\n\n<p>\u4f7f\u7528\u00a0<code>pynini.cross(input, output)<\/code>\u00a0\u5b9a\u4e49\u5355\u4e2a\u66ff\u6362\u5bf9\u3002\u8f93\u5165\u662f<strong>\u62fc\u97f3\u5e8f\u5217<\/strong>\uff08\u4e0d\u5e26\u58f0\u8c03\u6216\u5e26\u6570\u5b57\u58f0\u8c03\u5747\u53ef\uff0c\u53d6\u51b3\u4e8e\u8bbe\u8ba1\uff09\uff0c\u8f93\u51fa\u662f<strong>\u76ee\u6807\u6c49\u5b57<\/strong>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \u793a\u4f8b\uff1a\u5c06\u62fc\u97f3 \"dan1ni2er3bo1wei2\" \u66ff\u6362\u4e3a \"\u4e39\u5c3c\u5c14\u00b7\u6ce2\u7ef4\"<\/code>\n<code>rule1 = pynini.cross(\"dan1ni2er3bo1wei2\", \"\u4e39\u5c3c\u5c14\u00b7\u6ce2\u7ef4\")# \u652f\u6301\u591a\u5bf9\u4e00\u6620\u5c04\uff08\u7ea0\u9519\u6838\u5fc3\uff09\uff1a\u5c06\u9519\u8bef\u7684\u62fc\u97f3\u5f62\u5f0f\u4e5f\u6620\u5c04\u5230\u6b63\u786e\u6c49\u5b57<\/code>\n<code>rule10 = pynini.cross(\"dan1ni2er3bo1wei4\", \"\u4e39\u5c3c\u5c14\u00b7\u6ce2\u7ef4\")<\/code><\/pre>\n\n\n\n<p>\u00a0 4.<strong>\u89c4\u5219\u5e76\u96c6 (Union) \u4e0e\u4f18\u5316<\/strong>:\u00a0\u00a0 \u00a0 \u5c06\u6240\u6709\u72ec\u7acb\u7684\u89c4\u5219\u901a\u8fc7\u201c\u6216\u201d\u8fd0\u7b97 (<code>|<\/code>) \u5408\u5e76\u4e3a\u4e00\u4e2a\u5927\u7684\u72b6\u6001\u673a\uff0c\u5e76\u8c03\u7528\u00a0<code>.optimize()<\/code>\u00a0\u8fdb\u884c\u786e\u5b9a\u5316\uff08Determinization\uff09\u548c\u6700\u5c0f\u5316\uff08Minimization\uff09\uff0c\u4ee5\u51cf\u5c0f\u6a21\u578b\u4f53\u79ef\u5e76\u63d0\u9ad8\u641c\u7d22\u901f\u5ea6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;rule&nbsp;= (rule1 | rule10 | rule2 | ...).optimize()<\/code><\/pre>\n\n\n\n<p>\u00a0 \u00a05. \u4e0a\u4e0b\u6587\u91cd\u5199 (Context-Dependent Rewrite):\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4f7f\u7528\u00a0<code>cdrewrite<\/code>\u00a0\u7f16\u8bd1\u6700\u7ec8\u7684\u66ff\u6362\u8f6c\u6362\u5668\u3002\u867d\u7136\u6b64\u5904\u4e0a\u4e0b\u6587\u4e3a\u7a7a\uff08\u5373\u65e0\u6761\u4ef6\u66ff\u6362\uff09\uff0c\u4f46\u00a0<code>cdrewrite<\/code>\u00a0\u4f1a\u5904\u7406\u590d\u6742\u7684\u8fb9\u754c\u60c5\u51b5\uff0c\u5e76\u5141\u8bb8\u66ff\u6362\u89c4\u5219\u5728\u6587\u672c\u6d41\u4e2d\u591a\u6b21\u5e94\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># cdrewrite(\u89c4\u5219, \u5de6\u4e0a\u4e0b\u6587, \u53f3\u4e0a\u4e0b\u6587, \u5b57\u7b26\u96c6)<\/code><code>rule = cdrewrite(rule, \"\", \"\", sigma)<\/code><\/pre>\n\n\n\n<p>&nbsp; &nbsp; 6. \u5e8f\u5217\u5316: \u5c06\u7f16\u8bd1\u597d\u7684 FST \u5199\u5165&nbsp;<code>replace.fst<\/code>&nbsp;\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n\n\n\n<h3>2.1.2 \u6280\u672f\u96be\u70b9<\/h3>\n\n\n\n<p>\u2022<strong>\u89c4\u5219\u51b2\u7a81\u7ba1\u7406<\/strong>: \u5f53\u5b58\u5728\u5305\u542b\u5173\u7cfb\u7684\u89c4\u5219\uff08\u5982\u00a0<code>ping1<\/code>\u00a0\u548c\u00a0<code>ping1guo3<\/code>\uff09\u65f6\uff0cFST \u9700\u8981\u6b63\u786e\u5904\u7406\u201c\u6700\u957f\u5339\u914d\u201d\u4f18\u5148\uff0c\u8fd9\u901a\u5e38\u7531 FST \u7684\u6743\u91cd\u6216\u00a0<code>cdrewrite<\/code>\u00a0\u7684\u5de6\/\u53f3\u6700\u957f\u5339\u914d\u7b56\u7565\u4fdd\u8bc1\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u6a21\u578b\u4f53\u79ef\u63a7\u5236<\/strong>: \u968f\u7740\u89c4\u5219\u6570\u91cf\u589e\u52a0\uff0cFST \u72b6\u6001\u7a7a\u95f4\u53ef\u80fd\u6307\u6570\u7ea7\u589e\u957f\u3002\u901a\u8fc7\u00a0<code>optimize()<\/code>\u00a0\u8fdb\u884c\u6700\u5c0f\u5316\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u6b65\u9aa4\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>2.2 \u9636\u6bb5\u4e8c\uff1a\u5728\u7ebf\u7ea0\u9519\u63a8\u7406 (Online Inference)<\/h3>\n\n\n\n<p>\u8be5\u9636\u6bb5\u5728 C++ \u73af\u5883\u4e2d\u8fd0\u884c\uff0c\u52a0\u8f7d&nbsp;<code>replace.fst<\/code>\uff0c\u5bf9\u8f93\u5165\u7684\u4e2d\u6587\u6587\u672c\u8fdb\u884c\u5b9e\u65f6\u7ea0\u9519\u3002<\/p>\n\n\n\n<h3>2.2.1 \u521d\u59cb\u5316 (Initialization)<\/h3>\n\n\n\n<p>1.<strong>\u52a0\u8f7d\u5206\u8bcd\u5668<\/strong>: \u521d\u59cb\u5316\u00a0<code>JiebaWrapper<\/code>\uff0c\u52a0\u8f7d\u00a0<code>jieba.dict.utf8<\/code>\u00a0\u7b49\u8bcd\u5178\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>2.<strong>\u52a0\u8f7d\u62fc\u97f3\u6620\u5c04<\/strong>: \u8bfb\u53d6\u00a0<code>lexicon.txt<\/code>\uff0c\u6784\u5efa\u00a0<code>word2pron_<\/code>\u00a0\u54c8\u5e0c\u8868\uff08<code>std::unordered_map<\/code>\uff09\uff0c\u7528\u4e8e\u5c06\u4e2d\u6587\u8bcd\u8f6c\u6362\u4e3a\u62fc\u97f3\u3002<\/p>\n\n\n\n<p>3.<strong>\u52a0\u8f7d FST \u6a21\u578b<\/strong>: \u4f7f\u7528\u00a0<code>kaldifst::TextNormalizer<\/code>\u00a0\u52a0\u8f7d\u79bb\u7ebf\u751f\u6210\u7684\u00a0<code>replace.fst<\/code>\u3002<\/p>\n\n\n\n<p>4.<strong>\u52a0\u8f7d\u52a8\u6001\u89c4\u5219<\/strong>: \u89e3\u6790\u547d\u4ee4\u884c\u6216\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u4e34\u65f6\u89c4\u5219\uff0c\u5b58\u5165\u00a0<code>runtime_rule_map_<\/code>\u3002<\/p>\n\n\n\n<h3>2.2.2 \u6838\u5fc3\u5904\u7406\u6d41\u6c34\u7ebf (Processing Pipeline)<\/h3>\n\n\n\n<p><strong>\u4ee3\u7801\u4f4d\u7f6e<\/strong>:&nbsp;<code>src\/homophone-replacer.cc<\/code>&nbsp;\u4e2d\u7684&nbsp;<code>Apply<\/code>&nbsp;\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p><strong>Step 1: \u6587\u672c\u5206\u8bcd (Segmentation)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u64cd\u4f5c<\/strong>: \u8c03\u7528 Jieba \u5bf9\u8f93\u5165\u53e5\u5b50\u8fdb\u884c\u5206\u8bcd\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u76ee\u7684<\/strong>: \u76f8\u6bd4\u4e8e\u9010\u5b57\u5904\u7406\uff0c\u5206\u8bcd\u80fd\u591f\u4fdd\u7559\u8bed\u4e49\u5355\u5143\u3002\u66f4\u91cd\u8981\u7684\u662f\uff0c\u57fa\u4e8e\u8bcd\u7684\u62fc\u97f3\u8f6c\u6362\u80fd\u6709\u6548\u89e3\u51b3<strong>\u591a\u97f3\u5b57<\/strong>\u95ee\u9898\uff08\u4f8b\u5982\uff0c\u201c\u91cd\u201d\u5728\u201c\u91cd\u8981\u201d\u548c\u201c\u91cd\u590d\u201d\u4e2d\u8bfb\u97f3\u4e0d\u540c\uff0c\u5206\u8bcd\u540e\u67e5\u8bcd\u5178\u80fd\u5f97\u5230\u51c6\u786e\u62fc\u97f3\uff09\u3002<\/p>\n\n\n\n<p><strong>Step 2: \u62fc\u97f3\u5e8f\u5217\u6784\u5efa (Pinyin Conversion)<\/strong><\/p>\n\n\n\n<p>&nbsp;\u2022<strong>\u903b\u8f91<\/strong>: \u904d\u5386\u5206\u8bcd\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u00a0\u2022<strong>\u67e5\u8bcd\u5178<\/strong>: \u4f18\u5148\u5728\u00a0<code>lexicon.txt<\/code>\u00a0\u4e2d\u67e5\u627e\u6574\u4e2a\u8bcd\u7684\u62fc\u97f3\u3002\u00a0 \u00a0 \u00a0 \u00a0 <\/p>\n\n\n\n<p>\u00a0\u2022<strong>\u56de\u9000\u7b56\u7565<\/strong>: \u5982\u679c\u8bcd\u5178\u4e2d\u4e0d\u5b58\u5728\uff08\u5982\u672a\u767b\u5f55\u8bcd\uff09\uff0c\u5219\u5c06\u8bcd\u62c6\u89e3\u4e3a\u5355\u5b57\uff0c\u9010\u5b57\u67e5\u62fc\u97f3\u5e76\u62fc\u63a5\u3002\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u2022<strong>\u975e\u4e2d\u6587\u5b57\u7b26\u5904\u7406<\/strong>: \u6570\u5b57\u3001\u6807\u70b9\u3001\u82f1\u6587\u7b49\u4e0d\u8fdb\u884c\u8f6c\u6362\uff0c\u4f5c\u4e3a\u201c\u951a\u70b9\u201d\u4fdd\u7559\u5728\u5e8f\u5217\u4e2d\u3002<\/p>\n\n\n\n<p>&nbsp;\u2022 &nbsp; &nbsp;&nbsp;<strong>\u8f93\u51fa:&nbsp;<\/strong>\u6784\u9020\u51fa\u4e00\u4e2a\u4e0e\u539f\u6587\u672c\u5bf9\u5e94\u7684<strong>\u62fc\u97f3\u6d41<\/strong>\u3002<\/p>\n\n\n\n<p><strong>Step 3: FST \u89c4\u5219\u5339\u914d\u4e0e\u66ff\u6362 (FST Normalization)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u64cd\u4f5c<\/strong>: \u8c03\u7528\u00a0<code>kaldifst::TextNormalizer::Normalize<\/code>\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u8f93\u5165<\/strong>: \u539f\u59cb\u8bcd\u5e8f\u5217 + \u62fc\u97f3\u5e8f\u5217\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u673a\u5236<\/strong>:<\/p>\n\n\n\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u2022FST \u5f15\u64ce\u5728\u62fc\u97f3\u5e8f\u5217\u4e0a\u8fdb\u884c\u201c\u884c\u8d70\u201d\u3002\u00a0 \u00a0 \u00a0 <\/p>\n\n\n\n<p>     \u00a0\u2022\u5982\u679c\u62fc\u97f3\u5e8f\u5217\u5339\u914d\u4e86\u00a0<code>replace.fst<\/code>\u00a0\u4e2d\u7684\u67d0\u6761\u8def\u5f84\uff08\u4f8b\u5982\u00a0<code>xuan2jie4<\/code>\uff09\uff0cFST \u5c06\u8f93\u51fa\u5bf9\u5e94\u7684 Output Label\uff08\u5373\u7ea0\u9519\u540e\u7684\u6c49\u5b57\u201c\u7384\u6212\u201d\uff09\u3002\u00a0 \u00a0 \u00a0 \u00a0<\/p>\n\n\n\n<p>      \u2022\u5982\u679c\u672a\u5339\u914d\uff0c\u5219\u6309\u539f\u6837\u8f93\u51fa\u539f\u59cb\u8bcd\u3002<\/p>\n\n\n\n<p>\u2022\u00a0\u00a0<strong>\u6280\u672f\u4f18\u52bf<\/strong>: FST \u53ef\u4ee5\u5728\u4e00\u6b21\u904d\u5386\u4e2d\u5b8c\u6210\u6240\u6709\u89c4\u5219\u7684\u5339\u914d\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a $O(N)$\uff08N\u4e3a\u6587\u672c\u957f\u5ea6\uff09\uff0c\u4e0e\u89c4\u5219\u6570\u91cf\u65e0\u5173\u3002<\/p>\n\n\n\n<p><strong>Step 4: \u52a8\u6001\u89c4\u5219\u540e\u5904\u7406 (Dynamic Runtime Overrides)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u573a\u666f<\/strong>: \u9488\u5bf9 FST \u6a21\u578b\u672a\u8986\u76d6\uff0c\u6216\u9700\u8981\u4e34\u65f6\u7d27\u6025\u4fee\u6b63\u7684 Case\uff08\u5982\u521a\u53d1\u5e03\u7684\u65b0\u4ea7\u54c1\u540d\uff09\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u903b\u8f91<\/strong> \u00a0 \u2022\u5728 FST \u8f93\u51fa\u7684\u57fa\u7840\u4e0a\uff0c\u518d\u6b21\u5168\u53e5\u8f6c\u62fc\u97f3\u3002\u00a0 \u00a0 \u00a0\u2022\u4f7f\u7528\u00a0<code>add_rules<\/code>\u00a0\u4e2d\u5b9a\u4e49\u7684\u89c4\u5219\u8fdb\u884c<strong>\u6700\u957f\u5b57\u7b26\u4e32\u4f18\u5148\u5339\u914d<\/strong>\u3002\u00a0\u00a0 \u2022\u5b9a\u4f4d\u5230\u5339\u914d\u7684\u62fc\u97f3\u533a\u95f4\u540e\uff0c\u53cd\u7b97\u51fa\u5bf9\u5e94\u7684\u539f\u8bcd\u4f4d\u7f6e\uff0c\u8fdb\u884c\u5f3a\u5236\u66ff\u6362\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2>3. \u5173\u952e\u6280\u672f\u96be\u70b9\u4e0e\u521b\u65b0\u70b9 (Challenges &amp; Innovations)<\/h2>\n\n\n\n<h3>3.1 \u521b\u65b0\u70b9 (Innovations)<\/h3>\n\n\n\n<p>1.&nbsp;<strong>\u201c\u5206\u8bcd\u8f85\u52a9\u201d\u7684\u62fc\u97f3\u8f6c\u6362\u7b56\u7565 (Segmentation-Aided Pinyin Conversion)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u4f20\u7edf\u75db\u70b9<\/strong>: \u7b80\u5355\u7684\u201c\u6c49\u5b57\u8f6c\u62fc\u97f3\u201d\u6781\u6613\u53d7\u591a\u97f3\u5b57\u5f71\u54cd\uff08\u5982\u201c\u957f\u201d\u8bfb\u00a0<code>chang<\/code>\u00a0\u8fd8\u662f\u00a0<code>zhang<\/code>\uff09\uff0c\u5bfc\u81f4\u62fc\u97f3\u6d41\u9519\u8bef\uff0c\u8fdb\u800c\u5bfc\u81f4\u7ea0\u9519\u5931\u8d25\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u672c\u9879\u76ee\u521b\u65b0<\/strong>: \u5229\u7528\u6210\u719f\u7684 NLP \u5206\u8bcd\u6280\u672f\u548c\u8bcd\u5178\uff0c\u5148\u5207\u8bcd\u518d\u8f6c\u62fc\u97f3\u3002\u5229\u7528\u8bcd\u5178\u4e2d\u9884\u7f6e\u7684\u6ce8\u97f3\u4fe1\u606f\u6d88\u9664\u591a\u97f3\u5b57\u6b67\u4e49\uff0c\u5927\u5e45\u63d0\u9ad8\u4e86\u62fc\u97f3\u6d41\u7684\u51c6\u786e\u6027\uff0c\u8fd9\u662f\u540e\u7eed\u9ad8\u7cbe\u5ea6\u7ea0\u9519\u7684\u57fa\u7840\u3002\u00a0 \u00a0<\/p>\n\n\n\n<p>2.\u00a0<strong>\u57fa\u4e8e FST \u7684\u9ad8\u6027\u80fd\u6d41\u5f0f\u7ea0\u9519 (High-Performance FST Correction)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u4f20\u7edf\u75db\u70b9<\/strong>: \u5982\u679c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u6216\u5b57\u7b26\u4e32\u67e5\u627e\u8868\uff08HashMap\uff09\uff0c\u5728\u89c4\u5219\u6570\u91cf\u8fbe\u5230\u6210\u5343\u4e0a\u4e07\u6761\u65f6\uff0c\u5339\u914d\u901f\u5ea6\u4f1a\u663e\u8457\u4e0b\u964d\uff0c\u4e14\u96be\u4ee5\u5904\u7406\u8de8\u8bcd\u8fb9\u754c\u7684\u5339\u914d\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u672c\u9879\u76ee\u521b\u65b0<\/strong>: \u5c06\u6240\u6709\u89c4\u5219\u7f16\u8bd1\u8fdb\u4e00\u4e2a\u9759\u6001\u7684 FST \u56fe\u4e2d\u3002\u65e0\u8bba\u89c4\u5219\u5e93\u591a\u5927\uff0c\u5339\u914d\u8017\u65f6\u4ec5\u4e0e\u8f93\u5165\u6587\u672c\u957f\u5ea6\u7ebf\u6027\u76f8\u5173\u3002\u8fd9\u4f7f\u5f97\u7cfb\u7edf\u6781\u5177\u6269\u5c55\u6027\uff0c\u80fd\u8f7b\u677e\u652f\u6491\u767e\u4e07\u7ea7\u8bcd\u6761\u7684\u5b9e\u65f6\u7ea0\u9519\u3002\u00a0 \u00a0 \u00a0 <\/p>\n\n\n\n<p>3. \u00a0<strong>\u9759\u6001\u4e0e\u52a8\u6001\u53cc\u6a21\u878d\u5408 (Hybrid Static-Dynamic Architecture)<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u8bbe\u8ba1<\/strong>: \u7cfb\u7edf\u7ed3\u5408\u4e86\u201c\u7f16\u8bd1\u578b FST\u201d\uff08\u9759\u6001\u3001\u9ad8\u6548\u3001\u8986\u76d6\u5e7f\uff09\u548c\u201c\u89e3\u91ca\u578b Runtime Map\u201d\uff08\u52a8\u6001\u3001\u7075\u6d3b\u3001\u5373\u65f6\u751f\u6548\uff09\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u4ef7\u503c<\/strong>: \u65e2\u89e3\u51b3\u4e86\u901a\u7528\u573a\u666f\u7684\u9ad8\u6027\u80fd\u9700\u6c42\uff0c\u53c8\u6ee1\u8db3\u4e86\u4e1a\u52a1\u573a\u666f\u4e2d\u201c\u70ed\u66f4\u65b0\u201d\u548c\u201c\u7d27\u6025\u5e72\u9884\u201d\u7684\u521a\u9700\uff0c\u65e0\u9700\u6bcf\u6b21\u4fee\u6539\u89c4\u5219\u90fd\u91cd\u65b0\u7f16\u8bd1\u8017\u65f6\u7684 FST \u6a21\u578b\u3002<\/p>\n\n\n\n<h3>3.2 \u6280\u672f\u96be\u70b9 (Challenges)<\/h3>\n\n\n\n<p>1.&nbsp;<strong>\u62fc\u97f3\u4e0e\u6587\u672c\u7684\u5bf9\u9f50\u95ee\u9898:<\/strong><\/p>\n\n\n\n<p>\u2022<strong>\u95ee\u9898<\/strong>: FST \u662f\u5728\u62fc\u97f3\u5c42\u9762\u4e0a\u5de5\u4f5c\u7684\uff0c\u8f93\u51fa\u7684\u662f\u66ff\u6362\u540e\u7684\u6c49\u5b57\u3002\u5982\u679c\u4ec5\u4ec5\u66ff\u6362\u4e86\u90e8\u5206\u62fc\u97f3\uff0c\u5982\u4f55\u786e\u4fdd\u8f93\u51fa\u7684\u6587\u672c\u4e0e\u539f\u6587\u672c\u7684\u5176\u4ed6\u90e8\u5206\uff08\u5982\u6807\u70b9\u3001\u672a\u66ff\u6362\u7684\u8bcd\uff09\u6b63\u786e\u62fc\u63a5\uff1f<\/p>\n\n\n\n<p>\u2022<strong>\u89e3\u51b3<\/strong>: \u7cfb\u7edf\u7ef4\u62a4\u4e86\u00a0<code>words<\/code>\uff08\u539f\u8bcd\uff09\u548c\u00a0<code>pronunciations<\/code>\uff08\u62fc\u97f3\uff09\u7684\u53cc\u91cd\u961f\u5217\uff0c\u5e76\u5728 FST \u5f52\u4e00\u5316\u8fc7\u7a0b\u4e2d\u4fdd\u6301\u540c\u6b65\u3002\u52a8\u6001\u89c4\u5219\u5904\u7406\u65f6\uff0c\u8bbe\u8ba1\u4e86\u590d\u6742\u7684\u4e0b\u6807\u6620\u5c04\u7b97\u6cd5\uff0c\u5c06\u62fc\u97f3\u5b57\u7b26\u4e32\u7684\u504f\u79fb\u91cf\u7cbe\u786e\u6620\u5c04\u56de\u8bcd\u5411\u91cf\u7684\u7d22\u5f15\uff0c\u786e\u4fdd\u66ff\u6362\u64cd\u4f5c\u4e0d\u4f1a\u7834\u574f\u53e5\u5b50\u7ed3\u6784\u3002\u00a0 \u00a0 \u00a0 <\/p>\n\n\n\n<p>2. \u591a\u97f3\u5b57\u4e0e\u672a\u767b\u5f55\u8bcd\u7684\u8986\u76d6\u7387:<\/p>\n\n\n\n<p>\u2022<strong>\u95ee\u9898<\/strong>: \u8bcd\u5178\u4e0d\u53ef\u80fd\u5305\u542b\u6240\u6709\u8bcd\uff0c\u672a\u767b\u5f55\u8bcd\uff08OOV\uff09\u7684\u62fc\u97f3\u8f6c\u6362\u5bb9\u6613\u51fa\u9519\u3002<\/p>\n\n\n\n<p>\u2022<strong>\u89e3\u51b3<\/strong>: \u91c7\u7528\u4e86\u201c\u8bcd\u5178\u4f18\u5148 + \u5355\u5b57\u515c\u5e95\u201d\u7684\u7b56\u7565\u3002\u867d\u7136\u5355\u5b57\u8f6c\u6362\u65e0\u6cd5\u5904\u7406\u8bed\u5883\u76f8\u5173\u7684\u591a\u97f3\u5b57\uff0c\u4f46\u4f5c\u4e3a\u515c\u5e95\u65b9\u6848\u4fdd\u8bc1\u4e86\u7cfb\u7edf\u7684\u9c81\u68d2\u6027\uff0c\u4e0d\u4f1a\u56e0\u4e3a\u4e00\u4e2a\u8bcd\u4e0d\u8ba4\u8bc6\u5c31\u5bfc\u81f4\u6574\u4e2a\u6d41\u7a0b\u5d29\u6e83\u3002<\/p>\n\n\n\n<h2>4. \u603b\u7ed3<\/h2>\n\n\n\n<p>\u672c\u9879\u76ee\u901a\u8fc7\u5f15\u5165&nbsp;<strong>Pynini\/FST<\/strong>&nbsp;\u6280\u672f\uff0c\u6784\u5efa\u4e86\u4e00\u4e2a\u5de5\u4e1a\u7ea7\u7684\u4e2d\u6587\u540c\u97f3\u5b57\u7ea0\u9519\u65b9\u6848\u3002\u5176\u6838\u5fc3\u7ade\u4e89\u529b\u5728\u4e8e\uff1a\u5229\u7528 FST \u89e3\u51b3\u4e86\u5927\u89c4\u6a21\u89c4\u5219\u5339\u914d\u7684\u6027\u80fd\u74f6\u9888\uff0c\u5229\u7528\u5206\u8bcd\u6280\u672f\u89e3\u51b3\u4e86\u591a\u97f3\u5b57\u8f6c\u5199\u7684\u51c6\u786e\u6027\u95ee\u9898\uff0c\u5e76\u8f85\u4ee5\u52a8\u6001\u89c4\u5219\u673a\u5236\u63d0\u4f9b\u4e86\u6781\u4f73\u7684\u5de5\u7a0b\u843d\u5730\u7075\u6d3b\u6027\u3002<\/p>\n\n\n\n<p>\u9879\u76ee\u4ee3\u7801\uff1ahttps:\/\/github.com\/xinliu9451\/homophone-replacer<sup>[1]<\/sup><\/p>\n\n\n\n<h3>References<\/h3>\n\n\n\n<p><code>[1]<\/code>:&nbsp;<em>https:\/\/github.com\/xinliu9451\/homophone-replacer<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u521b\uff1a\u667a\u58f0\u5de5\u574a https:\/\/github.com\/xinliu9451\/homophone-repla 1 &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2026\/05\/01\/homophone-repl\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u4e2d\u6587\u540c\u97f3\u5b57\u66ff\u6362ASR\u7ea0\u9519\u7cfb\u7edf\u6280\u672f\u5b9e\u73b0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,34],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/31042"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=31042"}],"version-history":[{"count":1,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/31042\/revisions"}],"predecessor-version":[{"id":31043,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/31042\/revisions\/31043"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=31042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=31042"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=31042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}