import gradio as gr from ez_cite import ez_cite example1 = r"""In the current Noisy Intermediate-Scale Quantum (NISQ) era, a few methods have been proposed to construct useful quantum algorithms that are compatible with mild hardware restrictions. Most of these methods involve the specification of a quantum circuit Ansatz, optimized in a classical fashion to solve specific computational tasks. Next to variational quantum eigensolvers in chemistry and variants of the quantum approximate optimization algorithm, machine learning approaches based on such parametrized quantum circuits stand as some of the most promising practical applications to yield quantum advantages.""" example2 = r"""Instead of measuring physical systems and then processing the classical measurement outcomes to infer properties of the physical systems, quantum sensors will eventually be able to transduce quantum information in physical systems directly to a quantum memory, where it can be processed by a quantum computer.""" # wrap the ez_cite.py def generate_cite_and_bib_data(introduction): cite_text, bib_data = ez_cite(introduction, debug=False) return cite_text, bib_data iface = gr.Interface( fn=generate_cite_and_bib_data, inputs=[gr.Textbox(value='Enter your introduction here', label='introduction', show_label=True, lines=10)], outputs=[gr.Textbox(info='This may take several minutes.', label='.tex', lines=5, show_label=True, show_copy_button=True, interactive=True), gr.Textbox(info='This may take several minutes.', label='.bib', lines=5, show_label=True, show_copy_button=True, interactive=True)], live=False, title="Easy Cite App (beta-v0.0.5 made by Chip)", description="Enter your introduction and click the buttons to generate Cite Text and Bib Data.", css=""" .output { white-space: pre-line; } .container { width: 100%; margin: auto; padding: 5px; } .textbox { width: 100%; } """, examples=[ [example1], [example2] ] ) iface.launch()