Update app.py
Browse files
app.py
CHANGED
@@ -50,16 +50,20 @@ def generate_json(file_id, correct_text, wrong_text, wrong_ids):
|
|
50 |
|
51 |
return json_data, temp_file.name
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
with gr.Blocks() as demo:
|
54 |
file_id_input = gr.Textbox(label="請輸入文件ID")
|
55 |
# 使用 binary 作为文件类型,这样上传的文件将以二进制形式传递给函数
|
56 |
correct_file = gr.File(label="上傳校正過的逐字稿文本文件", type="binary")
|
57 |
wrong_file = gr.File(label="上傳未校正的ASR辨識文本文件", type="binary")
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
<a href='https://blog.twman.org/2021/04/ASR.html' target='_blank'>那些語音處理踩的坑</a><br>
|
62 |
-
<a href='https://blog.twman.org/2021/04/NLP.html' target='_blank'>那些自然語言處理踩的坑</a>""",
|
63 |
|
64 |
compare_button = gr.Button("比較文本")
|
65 |
correct_text_output = gr.TextArea(label="校正過的逐字稿文本內容")
|
|
|
50 |
|
51 |
return json_data, temp_file.name
|
52 |
|
53 |
+
TITLE = """<h1>逐字稿文本內容比對工具</h1>"""
|
54 |
+
SUBTITLE = """<h2 align="center"><a href='https://www.twman.org' target='_blank'>TonTon Huang Ph.D. @ 2024/04 </a><br></h2>"""
|
55 |
+
LINKS = """<a href='https://blog.twman.org/2021/04/ASR.html' target='_blank'>那些語音處理 (Speech Processing) 踩的坑</a> | <a href='https://blog.twman.org/2021/04/NLP.html' target='_blank'>那些自然語言處理 (Natural Language Processing, NLP) 踩的坑</a> | <a href='https://blog.twman.org/2024/02/asr-tts.html' target='_blank'>那些ASR和TTS可能會踩的坑</a> | <a href='https://blog.twman.org/2024/02/LLM.html' target='_blank'>那些大模型開發會踩的坑</a> | <a href='https://blog.twman.org/2023/04/GPT.html' target='_blank'>什麼是大語言模型,它是什麼?想要嗎?</a><br>
|
56 |
+
<a href='https://blog.twman.org/2023/07/wsl.html' target='_blank'>用PaddleOCR的PPOCRLabel來微調醫療診斷書和收據</a> | <a href='https://blog.twman.org/2023/07/HugIE.html' target='_blank'>基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析</a><br>"""
|
57 |
+
|
58 |
+
|
59 |
with gr.Blocks() as demo:
|
60 |
file_id_input = gr.Textbox(label="請輸入文件ID")
|
61 |
# 使用 binary 作为文件类型,这样上传的文件将以二进制形式传递给函数
|
62 |
correct_file = gr.File(label="上傳校正過的逐字稿文本文件", type="binary")
|
63 |
wrong_file = gr.File(label="上傳未校正的ASR辨識文本文件", type="binary")
|
64 |
+
gr.HTML(TITLE)
|
65 |
+
gr.HTML(SUBTITLE)
|
66 |
+
gr.HTML(LINKS)
|
|
|
|
|
67 |
|
68 |
compare_button = gr.Button("比較文本")
|
69 |
correct_text_output = gr.TextArea(label="校正過的逐字稿文本內容")
|