youngtsai commited on
Commit
ce5433b
·
1 Parent(s): 83014cf

簡潔重申段落主旨,可以用重述主題句、摘要支持句、回應或評論主題句的方式來寫結論句(例如:強調重要性或呼籲採取行動)等方式來寫

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -668,7 +668,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
668
  topic_input = gr.Textbox(label="選擇合適的主題或是自訂主題:")
669
  with gr.Column():
670
  generate_topics_button = gr.Button("✨ JUTOR 隨機產生 10 個段落主題,再挑選一個來練習吧!", variant="primary")
671
- topic_output = gr.Textbox(label="AI Generated Topic 主題", visible=True, value=[])
672
 
673
  generate_topics_button.click(
674
  fn=show_elements,
@@ -690,7 +690,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
690
  @gr.render(inputs=topic_output)
691
  def render_topics(topics):
692
  topics_list = json.loads(topics)
693
- topic_radio = gr.Radio(topics_list, label="Topics", elem_id="topic_button")
694
  topic_radio.select(
695
  fn=update_topic_input,
696
  inputs=[topic_radio],
@@ -722,10 +722,10 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
722
  gr.Markdown("### 如果不知道要寫什麼,也可以讓Jutor提供要點/關鍵字,以兩個要點/關鍵字為限。")
723
  with gr.Row():
724
  with gr.Column():
725
- points_input = gr.Textbox(label="#1 關鍵字")
726
  with gr.Column():
727
  generate_points_button = gr.Button("✨ 找尋靈感?使用 JUTOR 產生要點/關鍵字", variant="primary")
728
- points_output = gr.Textbox(label="AI Generated Points 要點", visible=True, value=[])
729
 
730
  generate_points_button.click(
731
  fn=show_elements,
@@ -748,7 +748,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
748
  @gr.render(inputs=points_output)
749
  def render_points(points):
750
  points_list = json.loads(points)
751
- points_radio = gr.Radio(points_list, label="Points", elem_id="point_button")
752
  points_radio.select(
753
  fn=update_points_input,
754
  inputs=[points_radio],
@@ -793,10 +793,10 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
793
  gr.Markdown("""舉例,情境是 `School & Learning`,段落主題是 `Time Management`,那麼 `Balancing school work and leisure time is a crucial aspect of effective time management` 就是合適的主題句,因為它清楚點出該段落將説明有效運用時間來讓課業及娛樂取得平衡。""")
794
  with gr.Row():
795
  with gr.Column():
796
- topic_sentence_input = gr.Textbox(label="Topic Sentences")
797
  with gr.Column():
798
  generate_topic_sentences_button = gr.Button("生成並在下面 3 個 JUTOR 產生的主題句中,選出一個最合適的", variant="primary")
799
- topic_sentence_output = gr.Textbox(label="AI Generated Topic Sentences 主題句", value=[])
800
 
801
  generate_topic_sentences_button.click(
802
  fn=show_elements,
@@ -826,8 +826,8 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
826
  radio_options = [ts["topic-sentence"] for ts in topic_sentences_list]
827
 
828
  # Creating the radio button element
829
- topic_sentences_radio = gr.Radio(radio_options, label="Topic Sentences", elem_id="topic_sentence_button")
830
- topic_sentences_suggestions = gr.HTML() # Setting up the action when a radio button is selected
831
  topic_sentences_radio.select(
832
  fn=update_topic_sentence_input,
833
  inputs=[topic_sentences_radio, topic_sentence_output],
@@ -880,19 +880,19 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
880
  - Evidence 提供證據:引用相關數據、研究或事實來佐證。例如全球互聯網用戶數已經突破了 50 億人,佔全球總人口近 65%。
881
  - Example 舉例:舉自家為例,説明如何將家事的責任分配給每個家庭成員。
882
  """)
883
- with gr.Accordion("參考指引:針對要點的支持句,要寫幾句呢?", open=False):
884
  gr.Markdown("""
885
- - 一個關鍵字,寫 3-6 句
886
- - 兩個關鍵字,每個要點寫 2-3 句
887
- - 三個關鍵字,每個要點寫 1-2 句
888
  """)
889
  with gr.Row():
890
  with gr.Column():
891
- gr.Markdown("### 寫出關於「關鍵字」的支持句")
892
- supporting_sentences_input = gr.Textbox(label="Supporting Sentences")
893
  with gr.Column():
894
- generate_supporting_sentences_button = gr.Button("JUTOR 產生例句,幫助你撰寫支持句。", variant="primary")
895
- supporting_sentences_output = gr.Radio(choices=[],label="AI Generated Supporting Sentences 支持句", elem_id="supporting_sentences_button")
896
 
897
  generate_supporting_sentences_button.click(
898
  fn=generate_supporting_sentences,
@@ -945,7 +945,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
945
  gr.Markdown("# Step 5. 寫出結論句")
946
  with gr.Row():
947
  with gr.Column():
948
- gr.Markdown("## 總結主要觀點,強化整個資訊的傳遞。重述、摘要、回應或評論主題句。")
949
  with gr.Column():
950
  with gr.Accordion("參考指引:撰寫「結論句」的方法?", open=False):
951
  gr.Markdown("""
@@ -957,8 +957,8 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue=gr.themes.colors.blue, secondary
957
  with gr.Column():
958
  conclusion_sentence_input = gr.Textbox(label="寫出總結段落的結論句")
959
  with gr.Column():
960
- generate_conclusion_sentence_button = gr.Button("JUTOR 產生例句,幫助你撰寫結論句。", variant="primary")
961
- conclusion_sentence_output = gr.Radio(choices=[], label="AI Generated Conclusion Sentence 結論句")
962
 
963
  generate_conclusion_sentence_button.click(
964
  fn=generate_conclusion_sentences,
 
668
  topic_input = gr.Textbox(label="選擇合適的主題或是自訂主題:")
669
  with gr.Column():
670
  generate_topics_button = gr.Button("✨ JUTOR 隨機產生 10 個段落主題,再挑選一個來練習吧!", variant="primary")
671
+ topic_output = gr.Textbox(label="AI 產出主題", visible=True, value=[])
672
 
673
  generate_topics_button.click(
674
  fn=show_elements,
 
690
  @gr.render(inputs=topic_output)
691
  def render_topics(topics):
692
  topics_list = json.loads(topics)
693
+ topic_radio = gr.Radio(topics_list, label="主題", elem_id="topic_button")
694
  topic_radio.select(
695
  fn=update_topic_input,
696
  inputs=[topic_radio],
 
722
  gr.Markdown("### 如果不知道要寫什麼,也可以讓Jutor提供要點/關鍵字,以兩個要點/關鍵字為限。")
723
  with gr.Row():
724
  with gr.Column():
725
+ points_input = gr.Textbox(label="#1 要點/關鍵字")
726
  with gr.Column():
727
  generate_points_button = gr.Button("✨ 找尋靈感?使用 JUTOR 產生要點/關鍵字", variant="primary")
728
+ points_output = gr.Textbox(label="AI 產出主題句/關鍵字", visible=True, value=[])
729
 
730
  generate_points_button.click(
731
  fn=show_elements,
 
748
  @gr.render(inputs=points_output)
749
  def render_points(points):
750
  points_list = json.loads(points)
751
+ points_radio = gr.Radio(points_list, label="要點/關鍵字", elem_id="point_button")
752
  points_radio.select(
753
  fn=update_points_input,
754
  inputs=[points_radio],
 
793
  gr.Markdown("""舉例,情境是 `School & Learning`,段落主題是 `Time Management`,那麼 `Balancing school work and leisure time is a crucial aspect of effective time management` 就是合適的主題句,因為它清楚點出該段落將説明有效運用時間來讓課業及娛樂取得平衡。""")
794
  with gr.Row():
795
  with gr.Column():
796
+ topic_sentence_input = gr.Textbox(label="主題句")
797
  with gr.Column():
798
  generate_topic_sentences_button = gr.Button("生成並在下面 3 個 JUTOR 產生的主題句中,選出一個最合適的", variant="primary")
799
+ topic_sentence_output = gr.Textbox(label="AI 產出主題句", value=[])
800
 
801
  generate_topic_sentences_button.click(
802
  fn=show_elements,
 
826
  radio_options = [ts["topic-sentence"] for ts in topic_sentences_list]
827
 
828
  # Creating the radio button element
829
+ topic_sentences_radio = gr.Radio(radio_options, label="主題句", elem_id="topic_sentence_button")
830
+ topic_sentences_suggestions = gr.HTML()
831
  topic_sentences_radio.select(
832
  fn=update_topic_sentence_input,
833
  inputs=[topic_sentences_radio, topic_sentence_output],
 
880
  - Evidence 提供證據:引用相關數據、研究或事實來佐證。例如全球互聯網用戶數已經突破了 50 億人,佔全球總人口近 65%。
881
  - Example 舉例:舉自家為例,説明如何將家事的責任分配給每個家庭成員。
882
  """)
883
+ with gr.Accordion("參考指引:針對要點/關鍵字的支持句,要寫幾句呢?", open=False):
884
  gr.Markdown("""
885
+ - 一個要點/關鍵字,寫 3-6 句
886
+ - 兩個要點/關鍵字,每個寫 2-3 句
887
+ - 三個要點/關鍵字,每個寫 1-2 句
888
  """)
889
  with gr.Row():
890
  with gr.Column():
891
+ gr.Markdown("### 請根據要點/關鍵字來寫支持句")
892
+ supporting_sentences_input = gr.Textbox(label="支持句")
893
  with gr.Column():
894
+ generate_supporting_sentences_button = gr.Button("JUTOR 產出支持句,供參考並自行寫出支持句", variant="primary")
895
+ supporting_sentences_output = gr.Radio(choices=[],label="AI 產出支持句", elem_id="supporting_sentences_button")
896
 
897
  generate_supporting_sentences_button.click(
898
  fn=generate_supporting_sentences,
 
945
  gr.Markdown("# Step 5. 寫出結論句")
946
  with gr.Row():
947
  with gr.Column():
948
+ gr.Markdown("## 簡潔重申段落主旨,可以用重述主題句、摘要支持句、回應或評論主題句的方式來寫結論句(例如:強調重要性或呼籲採取行動)等方式來寫")
949
  with gr.Column():
950
  with gr.Accordion("參考指引:撰寫「結論句」的方法?", open=False):
951
  gr.Markdown("""
 
957
  with gr.Column():
958
  conclusion_sentence_input = gr.Textbox(label="寫出總結段落的結論句")
959
  with gr.Column():
960
+ generate_conclusion_sentence_button = gr.Button("JUTOR 產出結論句,供參考並自行寫出支持句", variant="primary")
961
+ conclusion_sentence_output = gr.Radio(choices=[], label="AI 產出結論句")
962
 
963
  generate_conclusion_sentence_button.click(
964
  fn=generate_conclusion_sentences,