Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,17 +11,6 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
12 |
|
13 |
|
14 |
-
def extract_first_sentence(text):
|
15 |
-
"""
|
16 |
-
Extracts the first sentence from a given text.
|
17 |
-
"""
|
18 |
-
sentences = re.split(r"(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)\s+", text)
|
19 |
-
if sentences:
|
20 |
-
return sentences[0]
|
21 |
-
else:
|
22 |
-
return text
|
23 |
-
|
24 |
-
|
25 |
def extract_abstract_and_summarize(pdf_file):
|
26 |
"""
|
27 |
Extracts the abstract and summarizes it in one sentence with information till "Introduction".
|
@@ -66,4 +55,4 @@ interface = gr.Interface(
|
|
66 |
title="PDF Summarization & Audio Tool",
|
67 |
description="""PDF Summarization App. This app extracts the abstract from a PDF, summarizes it in one sentence with information till "Introduction", and generates an audio of it. Only upload PDFs with abstracts. Please read the README.MD for information about the app and sample PDFs.""",
|
68 |
)
|
69 |
-
interface.launch(share=True)
|
|
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
12 |
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
def extract_abstract_and_summarize(pdf_file):
|
15 |
"""
|
16 |
Extracts the abstract and summarizes it in one sentence with information till "Introduction".
|
|
|
55 |
title="PDF Summarization & Audio Tool",
|
56 |
description="""PDF Summarization App. This app extracts the abstract from a PDF, summarizes it in one sentence with information till "Introduction", and generates an audio of it. Only upload PDFs with abstracts. Please read the README.MD for information about the app and sample PDFs.""",
|
57 |
)
|
58 |
+
interface.launch(share=True)
|