Spaces:
Runtime error
Runtime error
Commit
·
104ff43
1
Parent(s):
c91708c
Update app.py
Browse filesremove support for uploading of files
app.py
CHANGED
|
@@ -12,16 +12,8 @@ from gradio.mix import Parallel
|
|
| 12 |
from transformers import pipeline
|
| 13 |
nltk.download('punkt')
|
| 14 |
|
| 15 |
-
|
| 16 |
-
# Defining a function to read in the text file
|
| 17 |
-
def read_in_text(url):
|
| 18 |
-
with open(url, 'r') as file:
|
| 19 |
-
article = file.read()
|
| 20 |
-
return article
|
| 21 |
-
|
| 22 |
|
| 23 |
-
def clean_text(
|
| 24 |
-
text = url
|
| 25 |
text = text.encode("ascii", errors="ignore").decode(
|
| 26 |
"ascii"
|
| 27 |
) # remove non-ascii, Chinese characters
|
|
@@ -43,9 +35,9 @@ nlp = spacy.load("en_core_web_sm")
|
|
| 43 |
|
| 44 |
|
| 45 |
#Defining a function to get the summary of the article
|
| 46 |
-
def final_summary(
|
| 47 |
#reading in the text and tokenizing it into sentence
|
| 48 |
-
text = clean_text(
|
| 49 |
|
| 50 |
chunks = []
|
| 51 |
sentences = nlp(text)
|
|
|
|
| 12 |
from transformers import pipeline
|
| 13 |
nltk.download('punkt')
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
def clean_text(text):
|
|
|
|
| 17 |
text = text.encode("ascii", errors="ignore").decode(
|
| 18 |
"ascii"
|
| 19 |
) # remove non-ascii, Chinese characters
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
#Defining a function to get the summary of the article
|
| 38 |
+
def final_summary(text):
|
| 39 |
#reading in the text and tokenizing it into sentence
|
| 40 |
+
text = clean_text(text)
|
| 41 |
|
| 42 |
chunks = []
|
| 43 |
sentences = nlp(text)
|