ssocean commited on
Commit
87edf46
·
verified ·
1 Parent(s): 8b09361

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -19,17 +19,17 @@ def predict(title, abstract):
19
  outputs = model(**inputs.to(device))
20
  # 应用 Sigmoid 函数来获取概率输出
21
  probability = torch.sigmoid(outputs.logits).item()
22
- return {"Predicted Academic Impact": round(probability, 4)}
23
 
24
  # 创建 Gradio 界面
25
  iface = gr.Interface(
26
  fn=predict,
27
  inputs=[
28
  gr.Textbox(lines=2, placeholder="Enter Paper Title Here...", label="Paper Title"),
29
- gr.Textbox(lines=5, placeholder="Enter Paper Abstract Here... (Do not input line breaks.)", label="Paper Abstract")
30
  ],
31
- outputs=gr.Number(label="Predicted Impact"),
32
- title="Predict academic impact (range from 0-1) for newly published papers with fine-tuned LLMs",
33
  description="Predict the normalized academic impact of a paper based on its title and abstract. Please note that the predicted impact is a probabilistic value generated by the model and does not accurately reflect the article's future citation performance. It should not be associated with writing quality, novelty, or other attributes. The author assumes no responsibility for the predictive metrics."
34
  )
35
 
 
19
  outputs = model(**inputs.to(device))
20
  # 应用 Sigmoid 函数来获取概率输出
21
  probability = torch.sigmoid(outputs.logits).item()
22
+ return {"Predicted Impact": round(probability, 4)}
23
 
24
  # 创建 Gradio 界面
25
  iface = gr.Interface(
26
  fn=predict,
27
  inputs=[
28
  gr.Textbox(lines=2, placeholder="Enter Paper Title Here...", label="Paper Title"),
29
+ gr.Textbox(lines=5, placeholder="Enter Paper Abstract Here... (Do not input line breaks. No more than 1024 tokens.)", label="Paper Abstract")
30
  ],
31
+ outputs=gr.Label(label="Predicted Impact"),
32
+ title="Predict academic impact with LLMs",
33
  description="Predict the normalized academic impact of a paper based on its title and abstract. Please note that the predicted impact is a probabilistic value generated by the model and does not accurately reflect the article's future citation performance. It should not be associated with writing quality, novelty, or other attributes. The author assumes no responsibility for the predictive metrics."
34
  )
35