Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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
|
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.
|
32 |
-
title="Predict academic impact
|
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 |
|