Reshmarb commited on
Commit
402b569
·
1 Parent(s): e02d958

project added

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -273,8 +273,16 @@ logger.addHandler(file_handler)
273
  client = Groq(api_key=os.getenv("GROQ_API_KEY_2"))
274
 
275
  # Initialize spaCy NLP model for named entity recognition (NER)
276
- nlp = spacy.load("en_core_web_sm")
277
- print("Model loaded successfully")
 
 
 
 
 
 
 
 
278
 
279
  # Initialize sentiment analysis model using Hugging Face
280
  sentiment_analyzer = pipeline("sentiment-analysis")
 
273
  client = Groq(api_key=os.getenv("GROQ_API_KEY_2"))
274
 
275
  # Initialize spaCy NLP model for named entity recognition (NER)
276
+ import spacy
277
+ from spacy.util import get_package_path
278
+
279
+ try:
280
+ model_path = get_package_path("en_core_web_sm")
281
+ nlp = spacy.load(model_path)
282
+ print("Model loaded using absolute path!")
283
+ except Exception as e:
284
+ print(f"Error: {e}")
285
+
286
 
287
  # Initialize sentiment analysis model using Hugging Face
288
  sentiment_analyzer = pipeline("sentiment-analysis")