Spaces:
Sleeping
Sleeping
project added
Browse files
app.py
CHANGED
@@ -37,7 +37,19 @@ client = Groq(api_key=os.getenv("GROQ_API_KEY_2"))
|
|
37 |
#client = Groq(api_key="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")
|
38 |
|
39 |
# Initialize spaCy NLP model for named entity recognition (NER)
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
# Initialize sentiment analysis model using Hugging Face
|
43 |
sentiment_analyzer = pipeline("sentiment-analysis")
|
|
|
37 |
#client = Groq(api_key="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")
|
38 |
|
39 |
# Initialize spaCy NLP model for named entity recognition (NER)
|
40 |
+
import spacy
|
41 |
+
|
42 |
+
# Download the model if it's not already installed
|
43 |
+
try:
|
44 |
+
nlp = spacy.load("en_core_web_sm")
|
45 |
+
except OSError:
|
46 |
+
print("Downloading 'en_core_web_sm' model...")
|
47 |
+
import os
|
48 |
+
os.system("python -m spacy download en_core_web_sm")
|
49 |
+
nlp = spacy.load("en_core_web_sm")
|
50 |
+
|
51 |
+
# Your code continues here
|
52 |
+
print("Model loaded successfully!")
|
53 |
|
54 |
# Initialize sentiment analysis model using Hugging Face
|
55 |
sentiment_analyzer = pipeline("sentiment-analysis")
|