Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ warnings.filterwarnings('ignore')
|
|
3 |
!pip install torch
|
4 |
import os
|
5 |
import gradio as gr
|
6 |
-
|
7 |
|
8 |
import tempfile
|
9 |
import numpy as np
|
@@ -15,6 +15,12 @@ from nltk import pos_tag
|
|
15 |
from nltk.corpus import stopwords
|
16 |
from pdfminer.high_level import extract_text
|
17 |
from nltk.tokenize.texttiling import TextTilingTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
co = cohere.Client(os.environ.get("CO_API_KEY"))
|
20 |
|
|
|
3 |
!pip install torch
|
4 |
import os
|
5 |
import gradio as gr
|
6 |
+
|
7 |
|
8 |
import tempfile
|
9 |
import numpy as np
|
|
|
15 |
from nltk.corpus import stopwords
|
16 |
from pdfminer.high_level import extract_text
|
17 |
from nltk.tokenize.texttiling import TextTilingTokenizer
|
18 |
+
# Download necessary NLTK data
|
19 |
+
nltk.download('punkt')
|
20 |
+
nltk.download('stopwords')
|
21 |
+
|
22 |
+
# Download spaCy model
|
23 |
+
spacy.cli.download("en_core_web_sm")
|
24 |
|
25 |
co = cohere.Client(os.environ.get("CO_API_KEY"))
|
26 |
|