Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,7 @@ def classify_paper(title, abstract):
|
|
| 50 |
input_tensor = torch.tensor(item['input_ids'])[None]
|
| 51 |
logits = classifier.model(input_tensor).logits[0]
|
| 52 |
preds = torch.sigmoid(logits).detach().cpu().numpy()
|
| 53 |
-
result = {classifier.model.config.id2label[num]: float(prob) for num, prob in enumerate(preds) if prob > 0.
|
| 54 |
return result
|
| 55 |
|
| 56 |
|
|
@@ -81,7 +81,7 @@ with gr.Blocks(title='Paper classifier') as demo:
|
|
| 81 |
|
| 82 |
gr.Markdown('## Examples')
|
| 83 |
gr.Examples(
|
| 84 |
-
examples=[['https://arxiv.org/abs/1706.03762'], ['https://arxiv.org/abs/
|
| 85 |
inputs=arxiv_link,
|
| 86 |
outputs=[title, abstract],
|
| 87 |
fn=get_arxiv_title_and_abstract,
|
|
|
|
| 50 |
input_tensor = torch.tensor(item['input_ids'])[None]
|
| 51 |
logits = classifier.model(input_tensor).logits[0]
|
| 52 |
preds = torch.sigmoid(logits).detach().cpu().numpy()
|
| 53 |
+
result = {classifier.model.config.id2label[num]: float(prob) for num, prob in enumerate(preds) if prob > 0.25}
|
| 54 |
return result
|
| 55 |
|
| 56 |
|
|
|
|
| 81 |
|
| 82 |
gr.Markdown('## Examples')
|
| 83 |
gr.Examples(
|
| 84 |
+
examples=[['https://arxiv.org/abs/1706.03762'], ['https://arxiv.org/abs/2304.06718'], ['https://arxiv.org/abs/1307.0058']],
|
| 85 |
inputs=arxiv_link,
|
| 86 |
outputs=[title, abstract],
|
| 87 |
fn=get_arxiv_title_and_abstract,
|