neovalle commited on
Commit
a7ddeb5
·
verified ·
1 Parent(s): f79fa2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -26,12 +26,12 @@ pipe = pipeline(
26
 
27
  def score_qa(question, answer):
28
  """
29
- Prompt Flan-T5 to return just an integer score from 1–10 (no extra text).
30
  Fallback to 5 if we fail to parse a number.
31
  """
32
  prompt = f"""
33
  You are an ecolinguistics judge. You will be given a question and an answer.
34
- Please return a single integer score from 1 to 10 based on how well the answer
35
  addresses ecological concerns, clarity, and factual correctness.
36
 
37
  Only return the number, nothing else.
@@ -95,10 +95,10 @@ demo = gr.Interface(
95
  fn=judge_ecolinguistics_from_csv,
96
  inputs=gr.File(label="Upload a CSV with question_number, question, answer columns"),
97
  outputs=gr.File(label="Download the scored CSV"),
98
- title="Ecolinguistics Q&A Scoring (Flan‑T5‑Large)",
99
  description=(
100
  "Upload a CSV containing columns: question_number, question, and answer. "
101
- "The model assigns each answer a score (1–10) based on ecolinguistic criteria. "
102
  "A final row shows the total score across all questions."
103
  )
104
  )
 
26
 
27
  def score_qa(question, answer):
28
  """
29
+ Prompt Flan-T5 to return just an integer score.
30
  Fallback to 5 if we fail to parse a number.
31
  """
32
  prompt = f"""
33
  You are an ecolinguistics judge. You will be given a question and an answer.
34
+ Please return a single integer score from 0 to 5 based on how well the answer
35
  addresses ecological concerns, clarity, and factual correctness.
36
 
37
  Only return the number, nothing else.
 
95
  fn=judge_ecolinguistics_from_csv,
96
  inputs=gr.File(label="Upload a CSV with question_number, question, answer columns"),
97
  outputs=gr.File(label="Download the scored CSV"),
98
+ title="Ecolinguistics Q&A Scoring",
99
  description=(
100
  "Upload a CSV containing columns: question_number, question, and answer. "
101
+ "The model assigns each answer a score (0-5) based on ecolinguistic criteria. "
102
  "A final row shows the total score across all questions."
103
  )
104
  )