youngtsai commited on
Commit
0fea6e9
·
1 Parent(s): fa5cc21

paragraph_evaluate_output

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -267,8 +267,8 @@ with gr.Blocks() as demo:
267
  paragraph_output = gr.Textbox(label="Generated Paragraph 完整段落")
268
  paragraph_input = gr.Textbox(label="Paragraph")
269
 
270
- gr.Markdown("## 8. Analyze 分析")
271
- default_user_generate_paragraph_analyze_prompt = """
272
  Based on the final paragraph provided, evaluate the writing in terms of content, organization, grammar, and vocabulary. Provide feedback in simple and supportive language.
273
 
274
  -- 根據上述的文章,以「內容(content)」層面評分。
@@ -315,9 +315,9 @@ with gr.Blocks() as demo:
315
  “coherence_and_cohesion“: {coherence_and_cohesion dict}
316
  }}
317
  """
318
- user_generate_paragraph_analyze_prompt = gr.Textbox(label="Paragraph Analyze Prompt", value=default_user_generate_paragraph_analyze_prompt)
319
- generate_paragraph_analyze_button = gr.Button("Save and Analyze")
320
- paragraph_Analyze_output = gr.Textbox(label="Generated Paragraph 完整段落")
321
 
322
  generate_topics_button.click(
323
  fn=generate_topics,
@@ -403,4 +403,13 @@ with gr.Blocks() as demo:
403
  outputs=paragraph_output
404
  )
405
 
 
 
 
 
 
 
 
 
 
406
  demo.launch()
 
267
  paragraph_output = gr.Textbox(label="Generated Paragraph 完整段落")
268
  paragraph_input = gr.Textbox(label="Paragraph")
269
 
270
+ gr.Markdown("## 8. evaluate 分析")
271
+ default_user_generate_paragraph_evaluate_prompt = """
272
  Based on the final paragraph provided, evaluate the writing in terms of content, organization, grammar, and vocabulary. Provide feedback in simple and supportive language.
273
 
274
  -- 根據上述的文章,以「內容(content)」層面評分。
 
315
  “coherence_and_cohesion“: {coherence_and_cohesion dict}
316
  }}
317
  """
318
+ user_generate_paragraph_evaluate_prompt = gr.Textbox(label="Paragraph evaluate Prompt", value=default_user_generate_paragraph_evaluate_prompt)
319
+ generate_paragraph_evaluate_button = gr.Button("Save and Evaluate")
320
+ paragraph_evaluate_output = gr.Textbox(label="Generated Paragraph evaluate 完整段落分析")
321
 
322
  generate_topics_button.click(
323
  fn=generate_topics,
 
403
  outputs=paragraph_output
404
  )
405
 
406
+ generate_paragraph_evaluate_button.click(
407
+ fn=generate_paragraph_evaluate,
408
+ inputs=[
409
+ paragraph_input,
410
+ user_generate_paragraph_evaluate_prompt
411
+ ],
412
+ outputs=paragraph_evaluate_output
413
+ )
414
+
415
  demo.launch()