File size: 658 Bytes
9b88e9e
 
2f64665
9b88e9e
 
 
 
 
 
 
 
 
2f64665
 
 
9b88e9e
 
 
 
 
b1f46ad
9b88e9e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import requests
import re
from lookup import processCgi

def fetch_bibtex(arxiv_link):
    # Extract the arXiv ID from the link
    arxiv_id = re.findall(r'arxiv\.org\/abs\/([\w\.]+)', arxiv_link)[0]
    
    # Use an API or web scraping method to fetch the BibTeX
    # For simplicity, here's a placeholder for the BibTeX entry
    bibtex_entry = "Placeholder BibTeX for " + arxiv_id

    output = processCgi(arxiv_id)

    return output


import gradio as gr

interface = gr.Interface(fn=fetch_bibtex,
                         inputs=gr.Textbox(lines=2, placeholder="Enter arXiv link here..."),
                         outputs="text")

interface.launch()