Spaces:
Sleeping
Sleeping
project added
Browse files
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 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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")
|