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

paragraph_evaluate_output

Browse files
Files changed (1) hide show
  1. app.py +53 -0
app.py CHANGED
@@ -265,6 +265,59 @@ with gr.Blocks() as demo:
265
  gr.Markdown("## 7. Paragraph Integration and Revision")
266
  generate_paragraph_button = gr.Button("Generate Paragraph")
267
  paragraph_output = gr.Textbox(label="Generated Paragraph 完整段落")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
  generate_topics_button.click(
270
  fn=generate_topics,
 
265
  gr.Markdown("## 7. Paragraph Integration and Revision")
266
  generate_paragraph_button = gr.Button("Generate Paragraph")
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)」層面評分。
275
+ - 評分等級有三級:beginner, intermediate, advanced. - 以繁體中文解釋
276
+ 評分結果以 JSON 格式輸出: content: {
277
+ "content_level": "#beginner/intermediate/advanced",
278
+ "content_explanation": "#中文解釋"
279
+ }
280
+
281
+ -- 根據上述的文章,以「組織(organization)」層面評分。
282
+ - 評分等級有三級:beginner, intermediate, advanced. - 以繁體中文解釋
283
+ 評分結果以 JSON 格式輸出: organization: {
284
+ "organization_level": "#beginner/intermediate/advanced",
285
+ "organization_explanation": "#中文解釋"
286
+ }
287
+
288
+ -- 根據上述的文章,以「文法和用法(Grammar and usage)」層面評分。
289
+ - 評分等級有三級:beginner, intermediate, advanced. - 以繁體中文解釋
290
+ 評分結果以 JSON 格式輸出: grammar_and_usage: {
291
+ "GrammarAndUsage_level": "#beginner/intermediate/advanced",
292
+ "GrammarAndUsage_explanation": "#中文解釋"
293
+ }
294
+
295
+ -- 根據上述的文章,以「詞彙(Vocabulary )」層面評分。
296
+ - 評分等級有三級:beginner, intermediate, advanced. - 以繁體中文解釋
297
+ 評分結果以 JSON 格式輸出: vocabulary: {
298
+ "Vocabulary_level": "#beginner/intermediate/advanced",
299
+ "Vocabulary_explanation": "#中文解釋"
300
+ }
301
+
302
+ -- 根據上述的文章,以「連貫性和連接詞(Coherence and Cohesion)」層面評分。
303
+ - 評分等級有三級:beginner, intermediate, advanced. - 以繁體中文解釋
304
+ 評分結果以 JSON 格式輸出: coherence_and_cohesion: {
305
+ "CoherenceAndCohesion_level": "#beginner/intermediate/advanced",
306
+ "CoherenceAndCohesion_explanation": "#中文解釋"
307
+ }
308
+
309
+ 將上述的輸出為 JSON:
310
+ {{
311
+ “content“: {content’s dict},
312
+ “organization“: {organization dict},
313
+ “grammar_and_usage“: {grammar_and_usage dict},
314
+ “vocabulary“: {vocabulary dict},
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,