Kaynağa Gözat

Add selected files only

SherryLiu 7 ay önce
işleme
b0e439a71f
3 değiştirilmiş dosya ile 946 ekleme ve 0 silme
  1. 584 0
      dictionary/dictionary_reviewed_rows_weighted.txt
  2. 152 0
      requirements.txt
  3. 210 0
      whisper.py

+ 584 - 0
dictionary/dictionary_reviewed_rows_weighted.txt

@@ -0,0 +1,584 @@
+高雄展覽館 100 n
+高展館 100 n
+建準 100 n
+精誠科技 100 n
+精誠 100 n
+systex 100 n 
+什麼意思 80 n
+是什麼 80 n 
+碳排放 100 n
+碳盤查 100 v
+請問 80 v 
+2050 50 m
+一貫式 50 k
+一貫煉 50 v
+三氟化氮 50 n
+三氯乙烯 50 nz
+三氯乙烷 50 nz
+三氯甲烷 50 nz
+上市櫃 50 zg
+不銹鋼 50 n
+世界 50 n
+中央 50 n
+中小 50 j
+中華民國 50 nt
+中長期 50 j
+主管 50 n
+乙苯 50 n
+事宜 50 n
+事項 50 n
+二極體 50 n
+二氧化碳 50 nz
+二氯乙烷 50 nz
+二氯甲烷 50 nz
+二甲苯 50 nz
+交易 50 n
+交易所 50 nt
+交流 50 n
+交通部 50 nt
+京都 50 ns
+企業 50 n
+估算 50 v
+低位 50 n
+低碳 50 n
+住商 50 n
+作業 50 n
+使用 50 v
+供需 50 n
+係數 50 m
+保存 50 v
+保育 50 v
+保護署 50 ng
+修正 50 nr
+倡議 50 n
+價值 50 n
+元件 50 n
+先期 50 t
+內政部 50 nt
+內部 50 f
+全國 50 nt
+全氟 50 n
+全球 50 n
+公共 50 b
+公司 50 n
+公告 50 n
+公噸 50 m
+公定 50 n
+公正 50 nr
+公約 50 n
+六氟化硫 50 nz
+其他 50 r
+具備 50 v
+再生能源 50 l
+出口 50 vn
+出口國 50 zg
+分公司 50 n
+分析 50 vn
+初始 50 v
+利用 50 n
+制度 50 n
+功能 50 n
+化學 50 n
+化學家 50 n
+化石 50 n
+匯量 50 n
+區域 50 n
+半導體 50 n
+協定 50 v
+協會 50 n
+協議 50 n
+原住民 50 n
+原住民族 50 n
+原則 50 n
+原料 50 n
+原物料 50 n
+去除 50 v
+參與 50 v
+及國際會議 50 n
+取得 50 v
+取樣 50 v
+台灣 50 ns
+各細節 50 n
+各部門 50 zg
+合作 50 vn
+含氟 50 n
+含量 50 n
+吸收 50 v
+品保 50 n
+品牌 50 n
+品質 50 n
+商業 50 n
+商標法 50 n
+四氯乙烯 50 nz
+四氯化碳 50 nz
+回收 50 v
+因應 50 v
+因應法 50 vn
+固定 50 a
+固定式 50 l
+國土 50 n
+國家 50 n
+國家永續 50 d
+國情 50 n
+國際 50 n
+國際驗證 50 nt
+土地利用 50 ns
+土壤 50 n
+地方 50 n
+執行 50 v
+培訓 50 vn
+基本 50 n
+基板 50 n
+基準 50 n
+基礎 50 n
+基線 50 n
+基金 50 n
+基金會 50 zg
+報告 50 n
+增氧設備 50 vn
+增量 50 n
+外交部 50 nt
+外加性 50 n
+外購 50 v
+多樣性 50 n
+多邊 50 r
+大眾 50 n
+天然氣 50 zg
+太平洋 50 ns
+契約 50 ns
+好算 50 v
+委員會 50 n
+威爾斯 50 nrt
+安全 50 an
+宣告 50 n
+宣導 50 vn
+實施 50 v
+實驗室 50 n
+審查 50 vn
+審核 50 v
+專案 50 n
+專章 50 n
+對策 50 n
+展開 50 v
+層級 50 n
+層面 50 n
+工具 50 n
+工業 50 n
+工業局 50 n
+巴黎 50 ns
+市場 50 n
+平台 50 n
+平衡 50 a
+廢棄 50 v
+廢棄物 50 n
+廢水 50 n
+建立 50 v
+建築 50 n
+強制性 50 n
+強化 50 v
+強度 50 n
+形象 50 n
+彩色 50 n
+影響 50 vn
+徵收 50 nr
+德國萊因 50 nrt
+情境 50 n
+情形 50 n
+意見 50 n
+憲章 50 n
+成本 50 n
+成長 50 v
+我國 50 r
+承認 50 v
+承諾 50 v
+承諾 50 x
+技術 50 n
+投資 50 vn
+抵換 50 v
+抵減 50 v
+指引 50 v
+指數 50 n
+指標 50 n
+排放 50 v
+排放源 50 ng
+排放量 50 n
+排碳金 50 n
+推動 50 v
+推動產品 50 n
+推廣 50 v
+措施 50 n
+提供 50 v
+提升 50 v
+換購 50 v
+揭露 50 v
+揮發性 50 n
+撰寫 50 v
+擴散區 50 n
+改善 50 v
+改用 50 v
+改造 50 v
+政府 50 n
+政策 50 n
+效果 50 n
+效率 50 n
+效益 50 n
+效能 50 n
+教育 50 vn
+教育部 50 n
+整體 50 n
+數據 50 n
+文件 50 n
+新南 50 ns
+新設 50 nt
+斷路器 50 n
+方式 50 n
+方案型 50 k
+方法 50 n
+旋轉式 50 n
+既有 50 c
+日本 50 ns
+時尚產業 50 n
+晶圓 50 vg
+會計 50 v
+有機物 50 n
+有限公司 50 n
+服務 50 vn
+服務業 50 n
+期程 50 n
+期間 50 f
+材料 50 n
+東北 50 ns
+林業 50 n
+查證 50 v
+查驗 50 v
+校驗 50 n
+核發 50 n
+核配 50 vn
+條文 50 n
+森林 50 n
+標準 50 n
+標準化 50 n
+標的 50 uj
+標籤 50 zg
+機制 50 n
+機會 50 n
+機構 50 n
+機組 50 n
+機車 50 n
+機關 50 n
+檢測 50 vn
+檢驗 50 vn
+檢驗局 50 n
+權證 50 n
+歐盟 50 j
+比率 50 n
+氣候 50 n
+氣渦 50 n
+氣相沉積 50 v
+氣體 50 n
+氧化亞氮 50 n
+氧化物 50 n
+氧化矽 50 nz
+氧化鈣 50 x
+氧化鋁 50 zg
+氧化鐵 50 zg
+氫氟碳化物 50 n
+氮氧化物 50 n
+水泥 50 n
+水質 50 n
+永續 50 d
+污染物 50 n
+汰換 50 v
+汰舊換新 50 a
+決策者 50 k
+汽力 50 n
+汽機車 50 n
+汽車 50 n
+沼氣 50 n
+法律 50 n
+活動 50 vn
+流程 50 n
+海洋 50 ns
+液晶 50 n
+涵蓋 50 v
+淘汰 50 v
+淨零排放 50 l
+清冊 50 n
+清潔 50 a
+減碳 50 n
+減緩 50 v
+減量 50 v
+減量事項 50 n
+減量 50 x
+測定 50 v
+測試 50 vn
+準則 50 n
+溫室 50 n
+溫室氣體 50 n
+溫暖化 50 n
+漁船 50 n
+潛勢 50 n
+澳洲 50 ns
+濾光片 50 nz
+煉製 50 zg
+煉鋼 50 n
+照明 50 v
+熟料 50 n
+熱值 50 n
+熱軋 50 v
+燃料 50 n
+燃氣 50 n
+燃油 50 n
+燃煤 50 n
+燃燒 50 v
+燒成 50 v
+燒成爐 50 n
+獎勵 50 vn
+現況 50 n
+環保署 50 ng
+環境 50 n
+生命 50 vn
+生料 50 n
+生物 50 n
+生產 50 vn
+產品 50 n
+產業 50 n
+產業淨 50 n
+產業界 50 n
+產生熱 50 n
+用量 50 n
+甲烷 50 nz
+甲苯 50 nz
+界定 50 n
+當量 50 n
+登錄 50 v
+發光 50 v
+發展 50 vn
+發電 50 vn
+發電業 50 n
+監測法 50 n
+監督 50 vn
+監護 50 vn
+盤查 50 vn
+目標 50 n
+目的 50 n
+直接 50 ad
+相互 50 d
+相關 50 v
+省電 50 j
+石油 50 n
+研擬 50 vn
+研析 50 vn
+研發 50 j
+研磨 50 vn
+研究 50 vn
+研究所 50 n
+研究院 50 n
+破壞 50 v
+碳中和 50 c
+碳價 50 n
+碳化物 50 n
+碳匯 50 v
+碳定價 50 n
+碳排 50 v
+碳標籤 50 zg
+碳權 50 n
+碳洩漏 50 v
+碳稅 50 n
+碳費 50 n
+碳費費率 50 n
+碳足跡 50 n
+碳邊境 50 s
+碳鋼 50 n
+確保事項 50 n
+確認 50 v
+科學 50 n
+科技 50 n
+移動 50 vn
+移轉 50 vn
+移除 50 v
+稅費 50 n
+程序 50 n
+種類 50 n
+積體 50 n
+穩定 50 a
+空氣 50 n
+空調 50 n
+立恩威 50 nr
+第三方 50 m
+管制 50 vn
+管理 50 vn
+管理法 50 n
+管理系統 50 zg
+管理 50 x
+節約 50 n
+範疇 50 nr
+粒狀 50 n
+糧食 50 n
+系統 50 n
+組織 50 v
+組織型 50 k
+結合型 50 n
+統計 50 v
+統計及 50 c
+經濟 50 n
+經濟部 50 n
+經驗 50 n
+綠色 50 n
+綱要 50 v
+總碳 50 n
+總量 50 n
+績效 50 b
+繳付 50 v
+美國 50 ns
+老舊 50 a
+聯合 50 nt
+聯合國 50 nt
+聲明 50 n
+股份 50 n
+胚生產 50 n
+能力 50 n
+能源 50 n
+自主 50 v
+自然 50 d
+自然碳匯 50 v
+自願 50 d
+自願性 50 n
+芝加哥 50 ns
+苯乙烯 50 nz
+英國 50 ns
+蒸汽 50 n
+薄膜 50 n
+薄膜區 50 x
+藉由 50 nr
+處理 50 v
+處理階段 50 n
+蝕刻 50 v
+蝕刻區 50 n
+行政院 50 n
+行銷 50 n
+衛理 50 n
+衛生 50 an
+衝擊 50 vn
+裂解 50 v
+製程 50 q
+製造 50 v
+製造業 50 ng
+複循環 50 v
+要點 50 q
+規則 50 n
+規劃 50 n
+規定 50 n
+規格 50 n
+規模 50 n
+規範 50 n
+觀測 50 vn
+觸媒 50 n
+計入期 50 n
+計畫 50 n
+計畫型 50 k
+計算 50 v
+設備 50 vn
+設定 50 v
+設施 50 n
+評估 50 vn
+評比 50 v
+試算 50 vn
+試驗 50 vn
+認可 50 v
+認定 50 v
+認證 50 v
+誘因 50 n
+調整 50 vn
+調適 50 v
+證明 50 n
+證碳 50 n
+議定 50 v
+議定書 50 n
+變化 50 vn
+變壓器 50 n
+變更 50 v
+變遷 50 vn
+財務 50 nt
+財政部 50 nt
+貢獻 50 nr
+資料 50 n
+資源 50 n
+資訊 50 n
+質量 50 n
+購買 50 v
+趨勢 50 n
+路徑 50 n
+車輛 50 n
+軋造 50 v
+軋鋼 50 n
+輔導 50 vn
+輪機 50 n
+輸配線路 50 n
+輻射 50 v
+轉型 50 n
+辦法 50 n
+農委會 50 nt
+農業 50 n
+農機 50 n
+週期 50 t
+逸散 50 v
+運具 50 n
+運輸 50 vn
+道瓊 50 nz
+選擇 50 v
+邊境 50 n
+邊界 50 n
+部門 50 n
+配售 50 vn
+配送 50 v
+配額型 50 k
+重組 50 vn
+量化 50 v
+量測 50 v
+金屬 50 n
+金管會 50 n
+金融 50 n
+銷售 50 vn
+鋼生產 50 n
+鋼胚 50 n
+鋼鋼 50 n
+鋼鐵業 50 n
+鍋爐 50 n
+鑑別 50 v
+長期 50 d
+開發行 50 v
+間接 50 b
+關稅 50 n
+闡釋 50 v
+陣列 50 q
+階段 50 n
+集魚燈 50 n
+零排放 50 l
+電力 50 n
+電動 50 n
+電工 50 n
+電弧爐 50 n
+電晶體 50 n
+電氣 50 n
+電路 50 n
+需求 50 v
+非政府 50 nt
+項目 50 n
+預測 50 vn
+額度 50 n
+類別 50 n
+類型 50 n
+顧問 50 nr
+顯示器 50 n
+顯示器業 50 n
+風險 50 n
+飲食 50 n
+香港 50 ns
+驅動力 50 n
+驗證 50 v
+高效率 50 n
+黃金 50 nr
+論壇 50 zg
+量化 50 n
+行政院 50 n

+ 152 - 0
requirements.txt

@@ -0,0 +1,152 @@
+aiohappyeyeballs==2.4.0
+aiohttp==3.10.5
+aiosignal==1.3.1
+annotated-types==0.7.0
+anyio==4.4.0
+attrs==24.2.0
+audioread==3.0.1
+babel==2.16.0
+bce-python-sdk==0.9.19
+blinker==1.8.2
+Bottleneck==1.4.0
+certifi==2024.7.4
+cffi==1.17.0
+charset-normalizer==3.3.2
+click==8.1.7
+colorama==0.4.6
+coloredlogs==15.0.1
+colorlog==6.8.2
+contourpy==1.3.0
+cycler==0.12.1
+Cython==3.0.11
+datasets==2.21.0
+decorator==5.1.1
+dill==0.3.4
+Distance==0.1.3
+distro==1.9.0
+editdistance==0.8.1
+fastapi==0.112.2
+filelock==3.15.4
+Flask==3.0.3
+flask-babel==4.0.0
+flatbuffers==24.3.25
+fonttools==4.53.1
+frozenlist==1.4.1
+fsspec==2024.6.1
+future==1.0.0
+fuzzywuzzy==0.18.0
+g2p-en==2.1.0
+g2pM==0.1.2.5
+h11==0.14.0
+h5py==3.11.0
+httpcore==1.0.5
+httpx==0.27.2
+huggingface-hub==0.24.6
+humanfriendly==10.0
+idna==3.8
+inflect==7.3.1
+itsdangerous==2.2.0
+jieba==0.42.1
+Jinja2==3.1.4
+jiter==0.5.0
+joblib==1.4.2
+jsonlines==4.0.0
+kaldiio==2.18.0
+kiwisolver==1.4.5
+Levenshtein==0.25.1
+librosa==0.8.1
+llvmlite==0.43.0
+loguru==0.7.2
+lxml==5.3.0
+markdown-it-py==3.0.0
+MarkupSafe==2.1.5
+matplotlib==3.9.2
+mdurl==0.1.2
+mock==5.1.0
+more-itertools==10.4.0
+mpmath==1.3.0
+multidict==6.0.5
+multiprocess==0.70.12.2
+nara-wpe==0.0.10
+nltk==3.9.1
+numba==0.60.0
+numpy==2.0.2
+onnx==1.16.2
+onnxruntime==1.19.0
+openai==1.42.0
+packaging==24.1
+paddle2onnx==0.8.1
+paddleaudio==1.0.2
+paddlefsl==1.1.0
+paddlenlp==2.6.1
+paddlespeech==1.0.1
+paddlespeech-feat==0.1.0
+pandas==2.2.2
+pathos==0.2.8
+pattern_singleton==1.2.0
+pillow==10.4.0
+pip-autoremove==0.10.0
+platformdirs==4.2.2
+pooch==1.8.2
+portalocker==2.10.1
+pox==0.3.4
+ppft==1.7.6.8
+praatio==5.0.0
+prettytable==3.11.0
+protobuf==3.20.2
+psutil==6.0.0
+pyarrow==17.0.0
+pycparser==2.22
+pycryptodome==3.20.0
+pydantic==2.8.2
+pydantic_core==2.20.1
+Pygments==2.18.0
+pyparsing==3.1.4
+pypinyin==0.52.0
+pypinyin-dict==0.8.0
+pytest-runner==6.0.1
+python-dateutil==2.9.0.post0
+python-dotenv==1.0.1
+python-Levenshtein==0.25.1
+pytz==2024.1
+pyworld==0.3.4
+PyYAML==6.0.2
+rapidfuzz==3.9.6
+rarfile==4.2
+regex==2024.7.24
+requests==2.32.3
+resampy==0.2.2
+rich==13.8.0
+sacrebleu==2.4.3
+safetensors==0.4.4
+scikit-learn==1.5.1
+scipy==1.14.1
+sentencepiece==0.1.99
+seqeval==1.2.2
+shellingham==1.5.4
+six==1.16.0
+sniffio==1.3.1
+soundfile==0.12.1
+starlette==0.38.2
+sympy==1.13.2
+tabulate==0.9.0
+TextGrid==1.6.1
+threadpoolctl==3.5.0
+tiktoken==0.7.0
+timer==0.3.0
+tqdm==4.66.5
+typeguard==4.3.0
+typer==0.12.5
+typing_extensions==4.12.2
+tzdata==2024.1
+urllib3==2.2.2
+uvicorn==0.30.6
+visualdl==2.5.3
+wcwidth==0.2.13
+webrtcvad==2.0.10
+websockets==13.0.1
+Werkzeug==3.0.4
+xxhash==3.5.0
+yacs==0.1.8
+yarl==1.9.4
+zhon==2.0.2

+ 210 - 0
whisper.py

@@ -0,0 +1,210 @@
+import os
+import argparse
+from openai import OpenAI
+from dotenv import load_dotenv
+import jieba
+from datetime import datetime
+from pypinyin import pinyin, Style
+
+load_dotenv('environment.env')
+client = OpenAI()
+
+system_prompt = """你是一位專業的轉錄校對助理,專門處理有關溫室氣體、碳排放和碳管理的對話轉錄。
+你的任務是:
+1. 確保以下專業術語的準確性:溫室氣體、碳排放、碳管理、碳盤查、碳權交易、碳足跡、淨零排放、碳權。
+2. 在必要時添加適當的標點符號,如句號、逗號
+3. 使用台灣的繁體中文,確保語言表達符合台灣的用語習慣。
+4. 只更正明顯的錯誤或改善可讀性,不要改變原文的意思或結構。
+5. 不要回答問題、解釋概念或添加任何不在原文中的信息。
+6. 如果原文是一個問句,保持它的問句形式,不要提供答案。
+
+請只根據提供的原文進行必要的更正,不要添加或刪除任何實質性內容。在修正時,請特別注意上下文,確保修正後的詞語符合整句話的語境。"""
+
+def transcribe(audio_file):
+    try:
+        transcript = client.audio.transcriptions.create(
+            file=audio_file,
+            model="whisper-1",
+            response_format="text"
+        )
+        return transcript
+    except Exception as e:
+        print(f"轉錄時發生錯誤:{str(e)}")
+        return None
+
+def save_output(file_name, raw_transcript, corrected_transcript):
+    output_dir = "output"
+    os.makedirs(output_dir, exist_ok=True)
+    
+    output_file = os.path.join(output_dir, "transcription_results.txt")
+    
+    with open(output_file, "a", encoding="utf-8") as f:
+        f.write(f"\n{'='*50}\n")
+        f.write(f"文件名: {file_name}\n")
+        f.write(f"處理時間: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n")
+        f.write("原始轉錄:\n")
+        f.write(f"{raw_transcript}\n\n")
+        f.write("修正後的轉錄:\n")
+        f.write(f"{corrected_transcript}\n")
+
+def process_audio_file(file_path):
+    try:
+        with open(file_path, "rb") as audio_file:
+            file_size = os.path.getsize(file_path) / (1024 * 1024)  # 轉換為 MB
+            if file_size > 25:
+                print(f"警告:文件 {os.path.basename(file_path)} 大小為 {file_size:.2f} MB,超過了 25 MB 的限制。可能無法處理。")
+
+            print(f"\n處理文件:{os.path.basename(file_path)}")
+            raw_transcript = transcribe(audio_file)
+            if raw_transcript is None:
+                return
+
+            print("\n原始轉錄:")
+            print(raw_transcript)
+
+            corrected_transcript = post_process_transcript(raw_transcript)
+            print("\n修正後的轉錄:")
+            print(corrected_transcript)
+
+            save_output(os.path.basename(file_path), raw_transcript, corrected_transcript)
+
+    except Exception as e:
+        print(f"處理文件 {os.path.basename(file_path)} 時發生錯誤:{str(e)}")
+
+def process_folder(folder_path):
+    processed_files = 0
+
+    for filename in os.listdir(folder_path):
+        if filename.lower().endswith((".mp3", ".wav", ".m4a")):
+            file_path = os.path.join(folder_path, filename)
+            process_audio_file(file_path)
+            processed_files += 1
+
+    print("\n=== 總結 ===")
+    print(f"處理的文件數:{processed_files}")
+
+def chinese_soundex(pinyin_str):
+    soundex_map = {
+        'b': '1', 'p': '1', 'm': '1', 'f': '1',
+        'd': '2', 'n': '2', 'l': '2',
+        'g': '3', 'k': '3', 'h': '3', 't': '3',
+        'j': '4', 'q': '4', 'x': '4',
+        'zh': '5', 'ch': '5', 'sh': '5', 'r': '5',
+        'z': '6', 'c': '6', 's': '6',
+        'an': '7', 'ang': '7', 'en': '8', 'eng': '8', 'in': '8', 'ing': '8',
+        'ong': '9', 'un': '9', 'uan': '9',
+        'i': 'A', 'u': 'A', 'v': 'A',  # 'v' is used for 'ü' in some systems
+        'e': 'B', 'o': 'B',
+    }
+    
+    code = ''
+    tone = '0'
+    i = 0
+    while i < len(pinyin_str):
+        if pinyin_str[i:i+2] in soundex_map:
+            code += soundex_map[pinyin_str[i:i+2]]
+            i += 2
+        elif pinyin_str[i] in soundex_map:
+            code += soundex_map[pinyin_str[i]]
+            i += 1
+        elif pinyin_str[i].isdigit():
+            tone = pinyin_str[i]
+            i += 1
+        else:
+            i += 1
+    
+    code = code[:1] + ''.join(sorted(set(code[1:])))
+    return (code[:3] + tone).ljust(4, '0')
+
+def compare_chinese_words(word1, word2, tone_sensitive=True):
+    pinyin1 = ''.join([p[0] for p in pinyin(word1, style=Style.TONE3, neutral_tone_with_five=True)])
+    pinyin2 = ''.join([p[0] for p in pinyin(word2, style=Style.TONE3, neutral_tone_with_five=True)])
+    
+    soundex1 = chinese_soundex(pinyin1)
+    soundex2 = chinese_soundex(pinyin2)
+    
+    if tone_sensitive:
+        return soundex1 == soundex2
+    else:
+        return soundex1[:3] == soundex2[:3]
+
+error_correction = {
+    "看拳": "碳權",
+    "看盤插": "碳盤查",
+    "盤插": "盤查",
+    "看": "碳",
+    "看權": "碳權"
+}
+
+def set_jieba_dictionary(dict_path):
+    if os.path.exists(dict_path):
+        jieba.set_dictionary(dict_path)
+        jieba.initialize()
+        print(f"Set jieba dictionary to {dict_path}")
+    else:
+        print(f"Dictionary file {dict_path} not found. Using default dictionary.")
+
+def fuzzy_correct_chinese(text, correct_terms):
+    words = jieba.lcut(text)
+    corrected_words = []
+    for word in words:
+        word_pinyin = ''.join([p[0] for p in pinyin(word, style=Style.NORMAL)])
+        print(f"Term: {word}, Pinyin: {word_pinyin}")  # Added print statement
+        if word in error_correction:
+            corrected_words.append(error_correction[word])
+        else:
+            for term in correct_terms:
+                if compare_chinese_words(word, term, tone_sensitive=True):
+                    print(f"corrected: {word} -> {term}")
+                    corrected_words.append(term)
+                    break
+            else:
+                corrected_words.append(word)
+    return ''.join(corrected_words)
+
+
+def post_process_transcript(transcript, temperature=0):
+    correct_terms = ["溫室氣體", "碳排放", "碳管理", "碳盤查", "碳權交易", "碳費",
+                     "碳權", "碳足跡", "足跡", "淨零排放", "零排放", "淨零",
+                     "氣候變遷法", "氣候", "氣候變遷",
+                     "台灣"]
+    
+    corrected_transcript = fuzzy_correct_chinese(transcript, correct_terms)
+    
+    messages = [
+        {"role": "system", "content": system_prompt},
+        {"role": "user", "content": f"請校對並修正以下轉錄文本,但不要改變其原意或回答問題:\n\n{corrected_transcript}"}
+    ]
+
+    response = client.chat.completions.create(
+        model="gpt-4",
+        temperature=temperature,
+        messages=messages
+    )
+
+    return response.choices[0].message.content
+
+def main():
+    parser = argparse.ArgumentParser(description="處理音頻文件使用 Whisper")
+    parser.add_argument("--file", help="要處理的單個音頻文件的路徑")
+    parser.add_argument("--folder", default="data", help="包含音頻文件的文件夾路徑(默認:data)")
+    parser.add_argument("--dict", default="dictionary/dictionary_reviewed_rows_weighted.txt")
+    args = parser.parse_args()
+
+    set_jieba_dictionary(args.dict)
+
+    if args.file:
+        if os.path.isfile(args.file):
+            process_audio_file(args.file)
+        else:
+            print(f"錯誤:文件 '{args.file}' 不存在。")
+    elif args.folder:
+        if os.path.isdir(args.folder):
+            process_folder(args.folder)
+        else:
+            print(f"錯誤:文件夾 '{args.folder}' 不存在。")
+    else:
+        print("錯誤:請指定一個文件(--file)或文件夾(--folder)來處理。")
+
+if __name__ == "__main__":
+    main()