SagarVelamuri commited on
Commit
448b0e7
·
verified ·
1 Parent(s): 99387cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -15,7 +15,14 @@ TE_CODE = "tel_Telu"
15
  ip = IndicProcessor(inference=True)
16
 
17
  # --------------------- Sentence Splitting (spaCy) ---------------------
18
- nlp = spacy.load("en_core_web_sm")
 
 
 
 
 
 
 
19
 
20
  def split_into_sentences(text):
21
  """Split English text into sentences using spaCy."""
 
15
  ip = IndicProcessor(inference=True)
16
 
17
  # --------------------- Sentence Splitting (spaCy) ---------------------
18
+ import spacy
19
+ try:
20
+ nlp = spacy.load("en_core_web_sm")
21
+ except OSError:
22
+ from spacy.cli import download
23
+ download("en_core_web_sm")
24
+ nlp = spacy.load("en_core_web_sm")
25
+
26
 
27
  def split_into_sentences(text):
28
  """Split English text into sentences using spaCy."""