Spaces:
Runtime error
Runtime error
Jueri
commited on
Commit
•
28ef76c
1
Parent(s):
40f9671
Update readme and typos
Browse files
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
title: Clean_bibtex
|
3 |
-
emoji:
|
4 |
colorFrom: yellow
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
|
|
1 |
---
|
2 |
title: Clean_bibtex
|
3 |
+
emoji: 📚
|
4 |
colorFrom: yellow
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
app.py
CHANGED
@@ -1,32 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from clean_bibtex.clean_bibtex import get_url, get_dblp_bibtext, parse_bibtext_file_titles
|
3 |
|
4 |
-
DEFAULT_TEXT = """@inproceedings{DBLP:conf/naacl/DevlinCLT19,
|
5 |
-
author = {Jacob Devlin and
|
6 |
-
Ming{-}Wei Chang and
|
7 |
-
Kenton Lee and
|
8 |
-
Kristina Toutanova},
|
9 |
-
editor = {Jill Burstein and
|
10 |
-
Christy Doran and
|
11 |
-
Thamar Solorio},
|
12 |
-
title = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
|
13 |
-
Understanding},
|
14 |
-
booktitle = {Proceedings of the 2019 Conference of the North American Chapter of
|
15 |
-
the Association for Computational Linguistics: Human Language Technologies,
|
16 |
-
{NAACL-HLT} 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long
|
17 |
-
and Short Papers)},
|
18 |
-
pages = {4171--4186},
|
19 |
-
publisher = {Association for Computational Linguistics},
|
20 |
-
year = {2019},
|
21 |
-
url = {https://doi.org/10.18653/v1/n19-1423},
|
22 |
-
doi = {10.18653/v1/n19-1423},
|
23 |
-
timestamp = {Fri, 06 Aug 2021 00:41:31 +0200},
|
24 |
-
biburl = {https://dblp.org/rec/conf/naacl/DevlinCLT19.bib},
|
25 |
-
bibsource = {dblp computer science bibliography, https://dblp.org}
|
26 |
-
}
|
27 |
-
"""
|
28 |
-
|
29 |
-
|
30 |
def parse_titles(bibtex):
|
31 |
titles = []
|
32 |
lines = bibtex.split("\n")
|
@@ -68,15 +42,15 @@ def cleaner(bibtex, keep_keys, file_obj):
|
|
68 |
|
69 |
iface = gr.Interface(
|
70 |
fn=cleaner,
|
71 |
-
title="
|
72 |
-
description="Clean a
|
73 |
inputs=[
|
74 |
gr.inputs.Textbox(label="Paste a string here:", lines=1),
|
75 |
gr.inputs.Checkbox(label="Keep original keys:"),
|
76 |
gr.inputs.File(label="Drag a Bibtex file here:", file_count="single", type="file", optional=True),
|
77 |
],
|
78 |
outputs=[
|
79 |
-
gr.outputs.File(label="Cleaned
|
80 |
gr.outputs.Textbox(type="auto", label="Errors:"),
|
81 |
],
|
82 |
)
|
|
|
1 |
import gradio as gr
|
2 |
from clean_bibtex.clean_bibtex import get_url, get_dblp_bibtext, parse_bibtext_file_titles
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
def parse_titles(bibtex):
|
5 |
titles = []
|
6 |
lines = bibtex.split("\n")
|
|
|
42 |
|
43 |
iface = gr.Interface(
|
44 |
fn=cleaner,
|
45 |
+
title="BibTeX cleaner",
|
46 |
+
description="Clean a BibTeX file or string by dragging the incomplete or broken BibTeX file into the file box or pasting a BibTeX string into the string field. The titles are extracted, searched at the DBLP, compiled into a clean BibTeX file.",
|
47 |
inputs=[
|
48 |
gr.inputs.Textbox(label="Paste a string here:", lines=1),
|
49 |
gr.inputs.Checkbox(label="Keep original keys:"),
|
50 |
gr.inputs.File(label="Drag a Bibtex file here:", file_count="single", type="file", optional=True),
|
51 |
],
|
52 |
outputs=[
|
53 |
+
gr.outputs.File(label="Cleaned BibTeX file:"),
|
54 |
gr.outputs.Textbox(type="auto", label="Errors:"),
|
55 |
],
|
56 |
)
|